
function NewWindow(mypage, myname, w, h, scroll) {
		var winl = (screen.width - w) / 2;
		var wint = (screen.height - h) / 2;
		winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
		win = window.open(mypage, myname, winprops)
		
		if (parseInt(navigator.appVersion) >=4) { win.window.focus(); }
	}

function checknum(numfieldArray,numfieldDisplayArray,form){
	var i = 0; 
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;

for(i=0; i<numfieldArray.length; i++){
strString = eval("form." + numfieldArray[i] + ".value")

//  test strString consists of valid characters listed above
   for (a = 0; a < strString.length  && blnResult == true; a++)
      {
      strChar = strString.charAt(a);
      if (strValidChars.indexOf(strChar) == -1)
         {
			document.forms[i].df_zip.value="";
         }
      }
   return blnResult;
   }

}


function e(s) {

	rex=true;

	if (window.RegExp) 
	{st="a";ex=new RegExp(st);
		if (st.match(ex)) {
		r1=new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		r2=new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
		b=(!r1.test(s)&&r2.test(s));
		}
		else 
		{rex=false;
		}
	} 
	else
	{	rex=false;
	}
	if(!rex) b=(s.indexOf("@")>0 && s.indexOf(".")>0 && s!="" && s!="enter e-mail");
	return (b);
}

//check email for valid email address
function email_check(s) {	
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(s))
	{
		//alert('email check true');
		return true;
	}
	else
	{
		//alert('email check false');
		return false;
	}
}

function checkForm(pop) {
    //alert(splittorun);
	for (var i in document.forms) {
		
		if (formName == document.forms[i].name)
		{
			if (document.forms[i].cat_id.options[document.forms[i].cat_id.selectedIndex].value == "--")
			{
				alert("\nYou must select your area of study.");
				return false;
			}
			else
			{
				pop=true;
			}
	
		
		//setBool();
		
			key=document.forms[i].key.value;
			cat_id=document.forms[i].cat_id.options[document.forms[i].cat_id.selectedIndex].value;
			conc_id=document.forms[i].Concentration.options[document.forms[i].Concentration.selectedIndex].value;
			type_id=document.forms[i].type_id.options[document.forms[i].type_id.selectedIndex].value;
			
			document.forms[i].v4_cat_id.value=cat_id;
			document.forms[i].v4_conc_id.value=conc_id;
			document.forms[i].v4_type_id.value=type_id;

}
		
	}				
}
	
	
	/*if (document.getElementById(formName).cat_id.options[document.getElementById(formName).cat_id.selectedIndex].value == "--")
		{
		alert("\nYou must select your area of study.");
		return false;
		} 
		
setBool();


	if(pop == true)
	{
		
		key=document.formName.key.value;
		cat_id=document.formName.cat_id.options[document.formName.cat_id.selectedIndex].value;
		conc_id=document.formName.Concentration.options[document.formName.Concentration.selectedIndex].value;
		fid=document.formName.fid.value;
		sid=document.formName.sid.value;
		document.location='http://www.earnmydegree.com/index.cfm?action=hom.degree&cat_id='+cat_id+'&key='+key+'&landing=1&conc_id='+conc_id+'&fid='+fid+'&sid='+sid;
	}
				
}*/
	
/*function checkForm2(pop) 
{
	var found_it = "";
	var x_counter = 0;
	var pop = false;
	
	for (var i=0; i<document.Entry2.cat_id.length; i++)  
	{ 
		if (document.Entry2.cat_id[i].checked)
		{
			x_counter = 1;
			found_it = document.Entry2.cat_id[i].value
			setBool();
			pop = true;
			
			if(pop == true)
			{
			
				key=document.Entry2.key.value;
				fid=document.Entry2.fid.value;
				sid=document.Entry2.sid.value;
				document.location='http://www.earnmydegree.com/index.cfm?action=hom.degree&cat_id='+found_it+'&key='+key+'&landing=1&fid='+fid+'&sid='+sid;
			}
			
			
			break;
			
			return true;
		}
	
	}
	
	if (x_counter == 0) {
		alert("\nYou must select your area of study.");
		return false;
	}
	
	
	
}
*/

	