function popUp(inStrURL, inIntWidth, inIntHeight)
{
	var intLeft = intTop = 0;
	intLeft = (screen.width - inIntWidth) / 2;
	intTop = (screen.height - inIntHeight) / 2;

	
	crip = window.open(inStrURL, 'popUps','scrollbars=0,menubar=0,toolbar=0,status=0,left=' + intLeft + ',top=' + intTop + ',width=' + inIntWidth + ',height=' + inIntHeight);
	crip.focus();
	crip = null;
}


 function popUpName(inStrURL, strWindowName, inIntWidth, inIntHeight, inScrollOn)
{
	var intLeft = intTop = 0;
	
	intLeft = (screen.width - inIntWidth) / 2;
	intTop = (screen.height - inIntHeight) / 2;

	//inScrollOn default off
	if (inScrollOn==null)
		inScrollOn = 0;
		
		
	
	crip = window.open(inStrURL, strWindowName,'scrollbars=' + inScrollOn +',menubar=0,toolbar=0,status=0,left=' + intLeft + ',top=' + intTop + ',width=' + inIntWidth + ',height=' + inIntHeight);
	crip.focus();
	crip = null;
	
}




function popUp2(inStrURL, inIntWidth, inIntHeight)
{
	var intLeft = intTop = 0;
	intLeft = (screen.width - inIntWidth) / 2;
	intTop = (screen.height - inIntHeight) / 2;

	if((crip == null) || (crip.closed))
	{
		crip = window.open(inStrURL, 'popUps','resizable=yes,left=' + intLeft + ',top=' + intTop + ',width=' + inIntWidth + ',height=' + inIntHeight);
		crip.focus();
	}
	else
	{
		crip.navigate(url);
		crip.focus();
	}
}


//Help Popup window
	var crip = null;
	function HelpWin()
	{

	x=200
	y=300
	screenX=screen.height
	screenY=50

		if((crip == null) || (crip.closed)) 
		{
			crip = window.open(getpath(), 'PopHelp', 'toolbar=no,menubar=no,scrollbars=yes,screenX='+screenX+',left='+screenX+',screenY='+screenY+',top='+screenY+',width='+x+',height='+y+',resizable=no');
			crip.focus();
		}
		else
		{
			crip.navigate(url);
			crip.focus();
		}
	}




	function getpath() {
		var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
		var url = location.href.substring(dir.length,location.href.length+1);
		href="help.asp?PageName=" + url
		return href

	   }


//Goto Buttons

	function goToURL(url) {

		window.location = url; 
	}
	
//get Help page name 
	function getPageName() {
		var dir = location.href.substring(0,location.href.lastIndexOf('/')+1);
		var url = location.href.substring(dir.length,location.href.length+1);
		href=url
		return href
	   }	   
	

//max char
	function CharLim() {
		var charObj=event.srcElement;
		if (charObj.value.length > (charObj.maxLength*1)-1)
		{ 
			charObj.value=charObj.value.substring(0,charObj.maxLength*1);
			return false;
		}
		else
		{
			return;
		}
	}

///////////////////////////////////////////////////////////////
//  Form Validation
///////////////////////////////////////////////////////////////

function isEmailAddr(email)
{
  var result = false;
  var theStr = new String(email);
  var index = theStr.indexOf("@");
  if (index > 0)
  {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
	result = true;
  }
  return result;
}

function validRequired(formField,fieldLabel)
{
	var result = true;
	
	if (formField.value == "")
	{
		alert('Please enter a value for the "' + fieldLabel +'" field.');
		formField.focus();
		result = false;
	}
	
	return result;
}

function allDigits(str)
{
	return inValidCharSet(str,"0123456789");
}

function inValidCharSet(str,charset)
{
	var result = true;

	// Note: doesn't use regular expressions to avoid early Mac browser bugs	
	for (var i=0;i<str.length;i++)
		if (charset.indexOf(str.substr(i,1))<0)
		{
			result = false;
			break;
		}
	
	return result;
}

function validEmail(formField,fieldLabel,required)
{
	var result = true;
	
	if (required && !validRequired(formField,fieldLabel))
		result = false;

	if (result && ((formField.value.length < 3) || !isEmailAddr(formField.value)) )
	{
		alert("Please enter a complete email address in the form: yourname@yourdomain.com");
		formField.focus();
		result = false;
	}
   
  return result;

}

function validNum(formField,fieldLabel,required)
{
	var result = true;

	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		if (!allDigits(formField.value))
 		{
 			alert('Please enter a number for the "' + fieldLabel +'" field.');
			formField.focus();		
			result = false;
		}
	} 
	
	return result;
}


function validInt(formField,fieldLabel,required)
{
	var result = true;

	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		var num = parseInt(formField.value,10);
 		if (isNaN(num))
 		{
 			alert('Please enter a number for the "' + fieldLabel +'" field.');
			formField.focus();		
			result = false;
		}
	} 
	
	return result;
}


function validDate(formField,fieldLabel,required)
{
	var result = true;

	if (required && !validRequired(formField,fieldLabel))
		result = false;
  
 	if (result)
 	{
 		var elems = formField.value.split("/");
 		
 		result = (elems.length == 3); // should be three components
 		
 		if (result)
 		{
 			var month = parseInt(elems[0],10);
  			var day = parseInt(elems[1],10);
 			var year = parseInt(elems[2],10);
			result = allDigits(elems[0]) && (month > 0) && (month < 13) &&
					 allDigits(elems[1]) && (day > 0) && (day < 32) &&
					 allDigits(elems[2]) && ((elems[2].length == 2) || (elems[2].length == 4));
 		}
 		
  		if (!result)
 		{
 			alert('Please enter a date in the format MM/DD/YYYY for the "' + fieldLabel +'" field.');
			formField.focus();		
		}
	} 
	
	return result;
}
function fnPost(strLocation)
		{
		var x;
		 
		form1.action = strLocation;
		form1.submit();
		 
		}
		
		
		
function fnLocation(strLocation)
{
	window.location.href= strLocation;
	
}

function fnPostClose(theForm)
{
	theForm.submit();
	window.close();
}