function validateLength250(source, args) 
{
	args.IsValid = (args.Value.length <= 250);          
}

function openPopupWindow(theURL, theWindow, thePos, theWidth, theHeight) {
	if(thePos=="center"){
		LeftPosition=(screen.availWidth)?(screen.availWidth-theWidth-10)/2:1;
		TopPosition=(screen.availHeight)?(screen.availHeight-theHeight-25)/2:1;
	}
	if(thePos=="default"){
		LeftPosition=100;
		TopPosition=100;
	}
	else if((thePos!="center" && thePos!="default") || thePos==null){
		LeftPosition=(screen.availWidth)?(screen.availWidth-theWidth)/2:1;
		TopPosition=(screen.availHeight)?(screen.availHeight-theHeight)/2:1;
	}
	window.open(theURL,theWindow,'top='+TopPosition+',left='+LeftPosition+',width='+theWidth+',height='+theHeight+',resizable=yes,scrollbars=yes,menubar=no,toolbar=no,directories=no,location=no,status=no');
}

function openPopupWindowNoScroll(theURL, theWindow, thePos, theWidth, theHeight) {
	if(thePos=="center"){
		LeftPosition=(screen.availWidth)?(screen.availWidth-theWidth-10)/2:1;
		TopPosition=(screen.availHeight)?(screen.availHeight-theHeight-25)/2:1;
	}
	if(thePos=="default"){
		LeftPosition=100;
		TopPosition=100;
	}
	else if((thePos!="center" && thePos!="default") || thePos==null){
		LeftPosition=(screen.availWidth)?(screen.availWidth-theWidth)/2:1;
		TopPosition=(screen.availHeight)?(screen.availHeight-theHeight)/2:1;
	}
	window.open(theURL,theWindow,'top='+TopPosition+',left='+LeftPosition+',width='+theWidth+',height='+theHeight+',resizable=no,scrollbars=no,menubar=no,toolbar=no,directories=no,location=no,status=no');
}
function changeLocation(obj)
{
	if(obj.value != '')
		window.location.href=obj.value;
}
function setDefaultDocument(ID)
{
	//alert(ID);
	var control = document.getElementById(ID);
	//alert(control);
	control.checked = true;
	
}

function validateLength2000(source, args) 
{
	args.IsValid = (args.Value.length <= 2000);          
}
