// JSCheck Script
	// Change field color back from yellow to white
	function changeColor(obj) {
		obj.style.background = "white";	
	}
	
	//if( !checkField(1,obj.fieldName,"Please do whatever you are supposed to") ) {return false;}
	//1. text field
	//2. select box
	//3. checkbox or radio
	function checkField(typ,fld,msg) {
		switch ( typ ) {
			case 1:
				if ( !fld.value.length ) {
					alert(msg)
					fld.focus()
					fld.style.background = "#FF9";
					return false;
				}
			break;
			case 2:
				if ( !fld.selectedIndex ) {
					alert(msg)
					fld.focus()
					fld.style.background = "#FF9";
					return false;
				}
			break;
			case 3:
				isChecked = false;
				for ( iCount=0;iCount<fld.length;iCount++) {
					if ( fld[iCount].checked ) {
						isChecked = true;
						return true;
					}
				}
				if ( !isChecked ) {
					alert(msg)
					fld[0].focus()
					return false;
				}
			default:
				alert('Unknown Data Type')
				fld.focus();
				return false;
		}		
		return true;
	}
	function checkNumber(input) {
		var legalArray = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
		for (var i = 0; i < input.value.length; i++){
			var legal = false;
			for (var k = 0; k < legalArray.length; k++){
				if (input.value.charAt(i) == legalArray[k]){
					legal = true;
				}
			}
			if (!legal){
				input.value = input.value.substring(0, i) + input.value.substring(i + 1);
				i--;
			}
		}
	}

	
	
//showWINDOW Script
	 var win;
	  function showWINDOW(url,x,y,x_cord,y_cord) {
		if(x_cord==null || y_cord==null){
	 		x_cord = 25;
	 		y_cord = 25;
	 	}
	    if(x==null || y==null){
	 		x = 657;
	 		y = 430;
	 	}
	 	var str = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width="+x+",height="+y; 
		var z = parseFloat(navigator.appVersion);
	  	win = window.open(url, "win", str);
		//win.moveTo(x_cord,y_cord);
		
		if (navigator.appName.substring(0.8) == "Netscape" || z > 4){
	 		this.win.focus();
	 	}
	 }
	 
//showWINDOWmedia Script
	 var win;
	  function showWINDOWmedia(url,x,y,x_cord,y_cord) {
		if(x_cord==null || y_cord==null){
	 		x_cord = 25;
	 		y_cord = 25;
	 	}
	    if(x==null || y==null){
	 		x = 657;
	 		y = 430;
	 	}
	 	var str = "toolbar=yes,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="+x+",height="+y; 
		var z = parseFloat(navigator.appVersion);
	  	win = window.open(url, "win", str);
		win.moveTo(x_cord,y_cord);
		
		if (navigator.appName.substring(0.8) == "Netscape" || z > 4){
	 		this.win.focus();
	 	}
	 }

//block characters from fields
			
	//input field syntax = onkeyup="valid(this,'special')" onblur="valid(this,'special')"
	//key
		// ^ = underscore
		// W = 
	var r={
		'special':/[\W,\_]/g, //numbers and letters only
		'special2':/[^\w\,\_\.]/g, //allows only numbers and alpha,underscore,comma & period
		'quotes':/[\'\"\`]/g, //allows everything except quotes, single quotes and ticks
		'dblquotes':/[\"]/g, //allows everything except quotes, single quotes and ticks
		'passwords':/[^\w\,\_\!\@\$\?\~\*]/g, //passwords allows only numbers and alpha,underscore and comma
		'passwordsnocomma':/[^\w\_\!\@\$\?\~\*]/g, //passwordsnocomma allows only numbers and alpha,underscore
		'names':/[^\w\,\s]/g, //names allows only numbers,alpha,spaces and commas
		'nohtml':/[^\w\,\s\@\&\-\+\?\]\[\*\!\'\"\(\)\:\%\/\=\#\.]/g, //names allows only numbers,alpha,spaces and commas
		'namesnocomma':/[^\w\s]/g, //namesnocomma allows only numbers,alpha and spaces
		'domainalias':/[^\w\s\.\_]/g, //domainalias allows only numbers,alpha,spaces,period and underscore
		'allownumbers':/[^\d]/g, //allownumbers allows only numbers
		'allowmoneynumbers':/[^\d\.]/g, //allownumbers allows only numbers and periods
		'allowtime':/[^\d\:]/g, //allownumbers allows only numbers and colons
		'allowspace':/[^\w\s]/g, //allowspace allows only space and underscore
		'allowemailwithcomma':/[^\w\@\-\,\.]/g, //allowemailwithcomma allows only numbers,alpha,@,underscore,comma and period
		'allowemail':/[^\w\@\-\.]/g, //allowemail allows only numbers,alpha,@,underscore,hyphen and period
		'allowurl':/[^\w\.\-\/\:\&\?\=\%]/g, //allowemail allows only numbers,alpha,underscore,hyphen and period
		'allowdate':/[^\d\/]/g, //allowdate allows only numbers & /
		'allowphone':/[^\d-]/g, //allowdate allows only numbers & -
		'allowfoldername':/[^\w\-]/g //allowemail allows only numbers,alpha,underscore,hyphen and period
		
	}
	
	function valid(o,w){
	  o.value = o.value.replace(r[w],'');
	}
