<!--

// start reload window if nav4 resized

function reloadPage(init) {  
  	if (init==true) 
		with (navigator) 
		{
		if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
			{
    		document.MM_pgW=innerWidth; 
			document.MM_pgH=innerHeight; 
			onresize=reloadPage; 
			}
		}
  		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
			location.reload();
} // end reloadPage

// keeps table width at 100 of window, prevents color of background 
// from coming through on right side of a 100% table

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function change_colors(){
	document.body.style.scrollbarBaseColor='#666666'
	document.body.style.scrollbarArrowColor='#ffffff'
	document.body.style.scrollbarDarkShadowColor='#336699'
	document.body.style.scrollbarFaceColor='#003366'
	document.body.style.scrollbarHighlightColor='#C0C0C0'
	document.body.style.scrollbarShadowColor='#000080'
	document.body.style.scrollbar3dlightColor='#000080'
}// end change_colors


// start form validation functions


function badEmail(txtBox){

	var notEmail = false;
	
	with(txtBox.value){

		var dot = charAt(length-1);
		var i,cca;

		//if (indexOf("@") < 1  ||
			//indexOf(".") < 3  ||
			//indexOf("@") >= indexOf(".")-1  ||
			//indexOf(" ") != -1 ||
			//dot == "."){
			//notEmail = true;
		//} // end if

		if (indexOf("@") < 1  ||
			indexOf(" ") != -1 ||
			dot == "."){
			notEmail = true;
		} // end if

		for (ctr=0; ctr<length; ctr++){

			// invalid codes
			// 0 to 44
			// 47
			// 58 to 63
			// 91 to 94
			// 96
			// 123 to 255

			cca = charCodeAt(ctr);
			
			for (i=0; i<=44; i++){
				if (i==cca)
					notEmail = true;
			} // end for

			if (cca==47)
					notEmail = true;

			for (i=58; i<=63; i++){
				if (i==cca)
					notEmail = true;
			} // end for

			for (i=91; i<=94; i++){
				if (i==cca)
					notEmail = true;
			} // end for

			if (cca==96)
					notEmail = true;

			for (i=123; i<=255; i++){
				if (i==cca)
					notEmail = true;
			} // end for

		} // end for

		if (notEmail){
			txtBox.focus();
			txtBox.select();
			alert("Invalid email address format");
			return true;
		} // end if

		return false;

	} // end with

} // end badEmail



function badID(txtBox){

	var notID = false;
	
	with(txtBox.value){

		for (ctr=0; ctr<length; ctr++){

			// invalid codes, letters and numbers only
			// 0 to 47
			// 58 to 64
			// 91 to 96
			// 123 to 255

			cca = charCodeAt(ctr);
			
			for (i=0; i<=47; i++){
				if (i==cca)
					notID = true;
			} // end for

			for (i=58; i<=64; i++){
				if (i==cca)
					notID = true;
			} // end for

			for (i=91; i<=96; i++){
				if (i==cca)
					notID = true;
			} // end for

			for (i=123; i<=255; i++){
				if (i==cca)
					notID = true;
			} // end for

		} // end for

		if (notID){
			txtBox.focus();
			txtBox.select();
			alert("Choose letters and numbers only for User Name");
			return true;
		} // end if

		return false;

	} // end with

} // end badID

function isMissing(txtBox,msg){
	if (txtBox.value==""){
		txtBox.focus();
		alert(msg);
		return true; //error
	} // end if
	return false;
} // end isMissing


function trimSpaces(txtBox){

	while(''+txtBox.value.charAt(txtBox.value.length-1)==' ')txtBox.value=txtBox.value.substring(0,txtBox.value.length-1);
	
	while(''+txtBox.value.charAt(0)==' ')txtBox.value=txtBox.value.substring(1,txtBox.value.length);

} // end trimSpaces

function badString(txtBox){
	if (txtBox.value!="" || txtBox.value!=null){
		if (txtBox.value.indexOf("'")>=0){
			txtBox.focus();
			txtBox.select();
			alert("Single quotes are not allowed");
			return true;
		} // end if
		if (txtBox.value.indexOf(" ")>=0){
			txtBox.focus();
			txtBox.select();
			alert("Spaces are not allowed");
			return true;
		} // end if
	} // end if
	return false;
} // end badString

function badQueryString(txtBox){
	if (txtBox.value!="" || txtBox.value!=null){
		if (txtBox.value.indexOf("'")>=0){
			txtBox.focus();
			txtBox.select();
			alert("Single quotes are not allowed");
			return true;
		} // end if
		if (txtBox.value.indexOf("&")>=0){
			txtBox.focus();
			txtBox.select();
			alert("Ampersands are not allowed");
			return true;
		} // end if
	} // end if
	return false;
} // end badQueryString

// end form validation functions


// for dhtml menu

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

// this function accepts arguments in
// multiples of 3 for one or more layers
// MM_showHideLayers('layerName','','show or hide')

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}


// -->
