//These Javascript functions are use for School IndexPage validation
var VerifyUOPMail_scrname = '/com/assets/templates/VerifyUOP_EMail.cfm';

function ContinueSchool()
{
		document.getElementById('BlurMe').style.display = 'none';
		document.getElementById('ThankYouPage').style.display = 'none';
}

var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
var calunit=ns? "" : "px"

function ShowThankYouPage()
{
	w = 350;
	if (ie){
		documentWidth  =truebody().offsetWidth/2+truebody().scrollLeft-20;
		documentHeight =truebody().offsetHeight/2+truebody().scrollTop-20;}	
	else if (ns){
		documentWidth=window.innerWidth/2+window.pageXOffset-20;
		documentHeight=window.innerHeight/2+window.pageYOffset-20;} 
	else if (w3){
		documentWidth=self.innerWidth/2+window.pageXOffset-20;
		documentHeight=self.innerHeight/2+window.pageYOffset-20;} 

		document.getElementById('ThankYouPage').style.left    = documentWidth-w+calunit;
		document.getElementById('ThankYouPage').style.top     = '150'+calunit;

		document.getElementById('BlurMe').style.display = 'inline';
		document.getElementById('ThankYouPage').style.display = 'inline';
		
}
function truebody(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function popCategory()
{
	subdata = document.getElementById('User_SubCategory');
	allsubdata = document.getElementById('User_AllSubCategory');
	maindata = document.getElementById('User_MainCategory');
	tmpdata = allsubdata.options[allsubdata.selectedIndex].value;
	if (tmpdata == '')
		return;
	splitdata = tmpdata.split('|');
	subdata.length = 2;
	subdata.options[1].value = splitdata[1];
	subdata.options[1].text  = allsubdata.options[allsubdata.selectedIndex].text;
	subdata.options[1].selected = true;
	for (i = 0; i < maindata.length; i++)
	  {
		if (maindata.options[i].text == 'All Programs')
			maindata.options[i].value = splitdata[0];
	  }
}
function CheckFields()
{
	data = document.GetDetail;

	if (trimVar(data.FirstName.value) == '')
		{ alert('Please complete\r\r First Name\r\r in order to continue'); return; }
	if (trimVar(data.LastName.value) == '')
		{ alert('Please complete\r\r Last Name\r\r in order to continue'); return; }
	if (trimVar(data.Address1.value) == '')
		{ alert('Please complete\r\r Street Address\r\r in order to continue'); return; }
	if (trimVar(data.EveArea.value) == '')
		{ alert('Please complete\r\r Phone Area Code\r\r in order to continue'); return; }
	if (trimVar(data.EvePhone.value) == '')
		{ alert('Please complete\r\r Phone Number\r\r in order to continue'); return; }
	if (!CheckPhone(1))
		return;
	if (trimVar(data.EmailAddress.value) == '')
		{ alert('Please complete\r\r EMail Address\r\r in order to continue'); return; }

	if (data.User_SubCategory.selectedIndex == 0)
	  {
		alert('Please complete Subject selection in order to continue');
		return;
	  }
	if (data.User_Qualification.selectedIndex == 0)
	  {
		alert('Please complete What are You Looking for selection in order to continue');
		return;
	  }
	if (data.User_GraduationYear.selectedIndex == 0)
	  {
		alert('Please complete High School Graduation Year selection in order to continue');
		return;
	  }
	if (trimVar(data.Zip.value) == '')
		{ alert('Please complete\r\r Zip Code\r\r in order to continue'); return; }
	if (data.City.value == '' || data.State.value == '')
	{
		checkZip(data.Zip.value);
	 	t = setTimeout('CheckFields()', 1000)
	}
	else
		VerifyInfo('ItemBody');
}

function checkUOPEMail(data)
{
	var Time = new Date();
	Unique = Time.getTime();
//		document.getElementById('ItemBody').style.display = 'inline';
		framename = 'ItemBody';
		scrname = VerifyUOPMail_scrname+'?FrameCall=Yes&EMail='+data+'&'+Unique;
		document.getElementById(framename).src           = scrname;
}
function UOP_ReturnResult(data)
{
	document.getElementById('UOP_Duplicate').value=data;
	document.getElementById('ItemBody').style.display = 'none';
}

