/**
 * @Project   CareerDegreeSource.com - EDS_Live
 *  �2006 CareerDegreeSource.com 
 * @date    2006/03/09
 * @author   �2006 PennyWise Solutions.
 */

// JavaScript Document
/*var CapellaError = '';
var CapellaPhoneError = '';
var CapellaPhoneError2 = '';
var waitResponse = '';*/
var zipStateError = '';
var hidden_zipcode;
function Trim(strValue){
    return LTrim(RTrim(strValue));
}
function LTrim(strValue){
    var LTRIMrgExp = /^\s */;
    return strValue.replace(LTRIMrgExp, "");
}
function RTrim(strValue){
    var RTRIMrgExp = /\s *$/;
    return strValue.replace(RTRIMrgExp, "");
}
function IsEmpty(fn,ofn) {
 var _tv = Trim(fn.value)
   if ((_tv.length==0) || (_tv==null)) {
	 if(fn.focus) fn.focus(); alert('Please Enter the '+ofn+'.'); return false;
   }else return true
}
function minLengthCheck(fn,ofn,length){
if(fn.value != ''){
 if(fn.value.length < length){
  if(fn.focus) fn.focus();
	if (ofn == 'First Name' )
        alert(' Invalid '+ofn);
     else if ( ofn == 'Last Name' )
        alert(' Invalid '+ofn);
     else 
        alert('The Field "'+ofn+'" should have minimum '+length+' characters.');
     return false;
  }else return true;
}else return true;
}
function maxLengthCheck(fn,ofn,length){
if(fn.value != ''){
if(fn.value.length > length){
  if(fn.focus) fn.focus();
	alert('The Field "'+ofn+'" should have less than or equal to '+length+' characters.');return false;
  }else return true;
}else return true;
}
function alphabetsCheck(fn,ofn){
  if((fn.value.search
	&& fn.value.search(new RegExp("^[a-zA-Z ']+$",'g'))==-1 && fn.value.length>0)){
		if(fn.focus) fn.focus();
		alert('The Field "'+ofn+'" can contain only alphabets.');
		return false;
  }else return true;
}
function numbersCheck(fn,ofn){
 if((fn.value.search && fn.value.search(new RegExp('^[0-9]+$','g'))==-1 && fn.value.length>0)){
	if(fn.focus) fn.focus();
		alert('The Field "'+ofn+'" can contain only numbers.');
		return false;
	}else return true;
}
function floatCheck(fn,ofn){
 if((fn.value.search && fn.value.search(new RegExp('^[0-9]+[.][0-9]+$','g'))==-1 && fn.value.length>0)){
	if(fn.focus) fn.focus();
		alert('The Field "'+ofn+'" can contain only Float numbers.');
		return false;
	}else return true;
}
function alphaNumericCheck(fn,ofn){
if((fn.value.search && fn.value.search(new RegExp('^[a-zA-Z0-9 \\n]+$','g'))==-1 && fn.value.length>0)){
 if(fn.focus) fn.focus();
	alert('The Field "'+fn+'" can contain only numbers & characters');
 return false;
}else return true;
}
function ValidateEmail(theinput){
var s=theinput.value
if(s.search){  
	return (s.search(new RegExp('^(?!(www\\.))((?:(?:(?:[a-zA-Z0-9][\\.\\-_]?)*)[a-zA-Z0-9])+)\\@((?:(?:(?:[a-zA-Z0-9][\\.\\-]?){0,62})[a-zA-Z0-9])+)\\.(AC|AD|AE|AERO|AF|AG|AI|AL|AM|AN|AO|AQ|AR|ARPA|AS|ASIA|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BIZ|BJ|BM|BN|BO|BR|BS|BT|BV|BW|BY|BZ|CA|CAT|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|COM|COOP|CR|CU|CV|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EDU|EE|EG|ER|ES|ET|EU|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GOV|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|INFO|INT|IO|IQ|IR|IS|IT|JE|JM|JO|JOBS|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MG|MH|MIL|MK|ML|MM|MN|MO|MOBI|MP|MQ|MR|MS|MT|MU|MUSEUM|MV|MW|MX|MY|MZ|NA|NAME|NC|NE|NET|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|ORG|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PRO|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|ST|SU|SV|SY|SZ|TC|TD|TEL|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TP|TR|TRAVEL|TT|TV|TW|TZ|UA|UG|UK|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|YE|YT|ZA|ZM|ZW){1}$','gi'))>=0)
}
if(s.indexOf){
	var at_character=s.indexOf('@')
	if(at_character<=0 || at_character+4>s.length) return false;
}
if(s.length<6) return false;
else return true;
}
function emailCheck(fn,ofn){																									
  if(ValidateEmail(fn)==false && fn.value.length>0){
	if(fn.focus) fn.focus();
		alert('Please Enter a valid Email Address.');
		return false;
  }else return true;
}
function checkboxValidation(fn,ofn,_ofn){
 var ar = _ofn+'[]' ;
 var len = fn.elements[ar].length;
  var flag = false,i;
   for(i=0;i<len;i++){
		if ( fn.elements[ar][i].checked  == false ){ 
		  flag = false;
		 }else{
		   flag = true ;
		   break;
		 } 
   }
   if ( !flag ){
   flag = false;
	alert('It was not specified the '+ofn+'.');
		return false;
   }else return true;
}
function radioButtonValidation(fn,ofn,_ofn){
 var len = fn.elements[_ofn].length;
  var flag = false,i;
   for(i=0;i<len;i++){
		if ( fn.elements[_ofn][i].checked  == false ){ 
		  flag = false;
		 }else{
		   flag = true ;
		   break;
		 } 
   }
   if ( !flag ){
   flag = false;
   if (ofn == 'Are you at least 21 years of age?' ){
   		alert('Please answer Are you at least 21 years of age?');
   }else if (ofn == 'Have you ever studied or worked in the English language?'){
        alert('Please answer Have you ever studied or worked in the English Language?');
   }else{
	alert('It was not specified the '+ofn+'.');
   }
		return false;
   }else return true;
}
function checkboxRadioValidation4(fn,ofn){
  var flag = false;
		if ( fn.checked  == false ){ 
		  flag = false;
		 }
		 else {
		   flag = true ;
		  } 
   if ( !flag ){
   flag = false;
   if (ofn == 'By checking this box, you give Everest University Online express consent to contact you at the phone number(s) provided for the purposes of servicing this inquiry, contacting you in the future and removal of this number(s) from Everest University Online Do Not Call list.' ){
   		alert('For your information to be submitted, please check box off');
   }else if (ofn.indexOf("Privacy_Policy.pdf")!=-1){
        alert('It was not specified the '+"By submitting this form, I agree that Kaplan, including its affiliates, may contact me via email, telephone, text, or prerecorded message regarding its programs and offers, as well as those of a third-party institution. If I reside outside the United States, I consent to the transfer of my data to the United States.");
   }else{
		alert('It was not specified the '+ofn+'.');	
   }
		return false;
   }else return true;
}
function isEmptySelect(fn,ofn) {
	if(fn.options[fn.selectedIndex].value =='select' || fn.options[fn.selectedIndex].value == '' || fn.options[fn.selectedIndex].value == 0){
		if(fn.focus) fn.focus();
        if(ofn == 'I am looking for a course'){
            alert('Please select either Online or Campus based for Course option');
        }else{
			alert('Please Select the '+ofn+'.');
        }
		return false;
	}else return true;
}
function PhoneValidation(fn,ofn,ptype,length){
if(fn.value ==''){
	if(fn.focus) fn.focus();
	alert('Please Enter The '+ ofn +' '+ ptype +' Number.');return false;}
if((fn.value.search	&& 
	    fn.value.search(new RegExp('^[0-9]+$','g'))==-1 && 
		fn.value.length >0 ))
		{
			if(fn.focus)
				fn.focus();
			alert('Please The '+ ofn +' '+ ptype +' Number can contain only numbers.');return false;		}
	if(( fn.value.length != length))
		{
			if(fn.focus)
				fn.focus();
			alert('Please The '+ ofn +' '+ ptype +' Length should be '+length+' digits.');return false;		}
 return true;
}
function PhoneValidationSpecial(field1,field2,field3){
	var userInput  = field1.value + field2.value + field3.value;
	var regexObj = {
		usa : /^([2-9][0-8]\d)[2-9]\d{2}\d{4}$/
	}
	regexp = new RegExp(regexObj.usa);
	if(regexp.test(userInput)) {
		return true;
	}else {
		if(field1.focus) field1.focus();
		alert('Please specify a valid phone number.');
		return false;
	}
}
function getHttpRequestObj() {
  var req = false;
  if(window.XMLHttpRequest) {
      try {
         req = new XMLHttpRequest();
      } 
      catch(e) {
         req = false;
      }
  } 
  else if(window.ActiveXObject) {
      try {
         req = new ActiveXObject("Msxml2.XMLHTTP");
      } 
      catch(e) {
         try {
            req = new ActiveXObject("Microsoft.XMLHTTP");
         } 
         catch(e) {
            req = false;
         }
      }
  }
  return req;
}

// CDS-E110: CODE ADDED FOR VALIDATING ZIP FOR A GIVEN CAMPUS
function validateCampusZip(){
	var campus = document.request_form.c_id ;
	    campus = campus.options[campus.selectedIndex].value ; 
		
	var zip = document.request_form.zipCode.value ;
	
	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
	//	getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateCampusZip.php?zip='+zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseCampusZip;
		http.open('GET', url, true);
		http.send(null);
	}
	
}
/* only zip validated here */
function handleHttpResponseCampusZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	   // var getButton  = document.getElementById('sButton');
	   var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
//END OF CODE FOR VALIDATING ZIP FOR GIVEN CAMPUS

// CHR442 IDAT - New School: CODE ADDED FOR VALIDATING ZIP FOR A GIVEN CAMPUS
function validateIADTCampusZip(){
	var campus = document.request_form.sycampusid ;
	    campus = campus.options[campus.selectedIndex].value ; 
		
	var zip = document.request_form.addr_zipcode.value ;
	
	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
	//	getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateCampusZip.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseIADTCampusZip;
		http.open('GET', url, true);
		http.send(null);
	}
	
}
/* only zip validated here */
function handleHttpResponseIADTCampusZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	   // var getButton  = document.getElementById('sButton');
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'International Academy of Design and Technology does not accept inquiries for this program from your state.';
			 }
   }
}
//CHR442 IDAT - New School END OF CODE FOR VALIDATING ZIP FOR GIVEN CAMPUS

// CHR603 Devry Acceptable Zip Codes - START
function parseResponseText(str) {
	  if(str.indexOf('NOT FOUND') != -1) {
		        return null;
				  }
	    
	    var parsed = Array();
		  parsed = str.split('|');

		    return parsed;
}
function validateDevryZip(){

	var zip = Trim(document.request_form.zip.value) ;
	var campus1 = 295;
	var campus2 = 298;
	
	if ( zip != '' && isNumeric(zip) && (zip.toString().length == 5 ) ) {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'validateDevryZip.php?zip=' + zip +'&campus1='+campus1+'&campus2='+campus2;
		http = getHttpRequestObj();
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseDevryZip;
		http.open('GET', url, true);
		http.send(null);
	}
}

function addClassroompreferenceOption(flag) {

 var selectbox = document.request_form.classroompreference;
 var i;
 for(i=selectbox.options.length-1;i>=0;i--) {
    selectbox.remove(i);
 }
 
 	  var browserName = navigator.appName; 
      var version = navigator.appVersion;
	  var progs   = document.request_form.classroompreference;
	  var opt = document.createElement("OPTION");
				opt.value = 'select';
				opt.text  = 'select';
	  if (browserName=="Netscape" && version.indexOf('Safari') != -1)
	  {
	  	progs.options[progs.length] = opt;
	  }else {
	  	progs.options.add(opt);		  
	  }
	  if (flag == 1){
		  var opt = document.createElement("OPTION");
					opt.value = 'In Classroom';
					opt.text  = 'In Classroom';
					opt.setAttribute('selected','selected');
		  if (browserName=="Netscape" && version.indexOf('Safari') != -1)
		  {
		  	progs.options[progs.length] = opt;
		  }else {
		  	progs.options.add(opt);
		  	progs.options.selectedIndex	= 1;	  
		  }
          document.request_form.locationpreference.value = 'select';
	  }else if (flag == 0){
		  var opt = document.createElement("OPTION");
			opt.value = 'In Classroom';
			opt.text  = 'In Classroom';
			
			if (browserName=="Netscape" && version.indexOf('Safari') != -1)
			{
				progs.options[progs.length] = opt;
			}else {
				progs.options.add(opt);	  
			} 
			var opt = document.createElement("OPTION");
			opt.value = 'Online';
			opt.text  = 'Online';
			
			if (browserName=="Netscape" && version.indexOf('Safari') != -1)
			{
				progs.options[progs.length] = opt;
			}else {
				progs.options.add(opt);	  
			}
			var opt = document.createElement("OPTION");
			opt.value = 'Both';
			opt.text  = 'Both';
			
			if (browserName=="Netscape" && version.indexOf('Safari') != -1)
			{
				progs.options[progs.length] = opt;
			}else {
				progs.options.add(opt);	  
			}
            document.request_form.locationpreference.value = 'select';
	  }
}

/* only zip validated here */
function handleHttpResponseDevryZip(){
	if(http.readyState == 4){
	    var data = parseResponseText(http.responseText);
	   // var getButton  = document.getElementById('sButton');
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
				
			 if(data[0] == 1 && data[1] == 1) {
				CampusZipError = '';
                CampusZipConfirmError = 'DeVry offers highly engaged onsite classes in the area of your zip code. Would you like to learn more by enrolling in onsite?';
				addClassroompreferenceOption('0');
			 }else if(data[0] == 0 && data[1] == 1) {                
				CampusZipError = '';
                CampusZipConfirmError = 'DeVry offers highly engaged onsite classes in the area of your zip code. Would you like to learn more by enrolling in onsite?';
				addClassroompreferenceOption('0');
			 }else if(data[0] == 0 && data[1] == 0){
                CampusZipConfirmError = '';
				addClassroompreferenceOption('0'); 
				CampusZipError = 'Sorry, DeVry University does not have any campuses in your area.  However, DeVry does offer your chosen program of study online.  If you are interested in attending DeVry Online, please select the online option.';
			 }
   }
}



function onloadDevryZip(){
	
	var zip = Trim(document.request_form.zip.value) ;
	var campus1 = 295;
	var campus2 = 298;
			
	if ( zip != '' && isNumeric(zip) && (zip.toString().length == 5 ) ) {
		var url = 'validateDevryZip.php?zip=' + zip +'&campus1='+campus1+'&campus2='+campus2;
		httponloadDevryZip = getHttpRequestObj();
		httponloadDevryZip.onreadystatechange = handleHttpResponseonloadDevryZip;
		httponloadDevryZip.open('GET', url, true);
		httponloadDevryZip.send(null);
	}
	
}

function handleHttpResponseonloadDevryZip(){
	if(httponloadDevryZip.readyState == 4){
	    var data = parseResponseText(httponloadDevryZip.responseText);   
	    		
			 if(data[0] == 1 && data[1] == 1) {                    
					CampusZipError = '';
                    CampusZipConfirmError = 'DeVry offers highly engaged onsite classes in the area of your zip code. Would you like to learn more by enrolling in onsite?';
					addClassroompreferenceOption('0');
			 }else if(data[0] == 0 && data[1] == 1) {                    
					CampusZipError = '';
                    CampusZipConfirmError = 'DeVry offers highly engaged onsite classes in the area of your zip code. Would you like to learn more by enrolling in onsite?';
					addClassroompreferenceOption('0');
			 }else if(data[0] == 0 && data[1] == 0){
                    CampusZipConfirmError = '';
					addClassroompreferenceOption('0');
					CampusZipError = 'Sorry, DeVry University does not have any campuses in your area.  However, DeVry does offer your chosen program of study online.  If you are interested in attending DeVry Online, please select the online option.';
				
			 }
   }
}

function isNumeric(value) {
  if (!value.toString().match(/^[-]?\d*\.?\d*$/)) return false;
  return true;
}

// CHR603 Devry Acceptable Zip Codes - END

// CHR787 Devry Location Preference Changes - Starts
function onChangeDevryLocations(lflag){
    currForm = document.request_form;
    if(lflag == '1') {
        var locationpreference = currForm.locationpreference ;
            locationpreference = locationpreference.options[locationpreference.selectedIndex].value ;        
        if(locationpreference == 'DV ONLINE') {
            currForm.classroompreference.value = 'Online';
         }else if(locationpreference == 'DVUC OL') {
             currForm.classroompreference.value = 'Online';
         }else {
                var classroompreference = currForm.classroompreference ;
                classroompreference = classroompreference.options[classroompreference.selectedIndex].value ;
                if(classroompreference == 'In Classroom'){
                currForm.classroompreference.value = 'In Classroom';
                } else if(classroompreference == 'Both'){
                currForm.classroompreference.value = 'Both';
                } else {
                currForm.classroompreference.value = 'In Classroom';
                }
        }
    } else {
        currForm.classroompreference.value = 'select';
        currForm.locationpreference.value = '';
    }
}
// CHR787 Devry Location Preference Changes - Ends
 	//CDS-E177 -Removing Hard-coding from Capella for validation
function handleHttpResponseStateZip(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   //alert('zip'+ response)
	  // var getButton  = document.getElementById('sButton');
	  var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
	   var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
	//	getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				CapellaError = '';
			 }else if(response == 0){
				CapellaError = 'Please Enter a Valid Zip Code for the State selected.';
			 }
	validateState_Phone();
	//validateState_Phone2();
   }
   //
}
 	//CDS-E177 -Removing Hard-coding from Capella for validation
function validateState_Zip(){
	var state = document.request_form.STATE ;
	    state = state.options[state.selectedIndex].value ; 
		
	var zip = document.request_form.ZIP.value ;
	
	if (zip != '' && state != '' && state != 'select') {
		//alert(zip+state);
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
	//	getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateStateZip.php?zip=' + zip +'&state='+state;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseStateZip;
		http.open('GET', url, true);
		http.send(null);
	}
	
}
/* only zip validated here */

function handleHttpResponseZip(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   // var getButton  = document.getElementById('sButton');
	   var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				CapellaError = '';
			 }else if(response == 0){
				CapellaError = 'Please Enter a Valid Zip Code for the State selected.';
			 }
   }
}
	//CDS-E177 -Removing Hard-coding from Capella for validation
function validateZip(){
	var state = document.request_form.STATE ;
	    state = state.options[state.selectedIndex].value ; 
		
	var zip = document.request_form.ZIP.value ;
	
	if (zip != '' && state != '' && state != 'select') {
		
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
		//getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateStateZip.php?zip=' + zip +'&state='+state;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseZip;
		http.open('GET', url, true);
		http.send(null);
	}
	
}

// End here
//CDS-E177 -Removing Hard-coding from Capella for validation
function handleHttpResponseStatePhone(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   //alert('a1'+ response);
	    //var getButton  = document.getElementById('sButton');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				CapellaPhoneError = '';
			 }else if(response == 0){
				CapellaPhoneError = 'Please Enter a Valid Home Area code for the State selected.';
			 }
	validateState_Phone2();		 
   }
}
//CDS-E177 -Removing Hard-coding from Capella for validation
function validateState_Phone(){
	
	var state = document.request_form.STATE ;
	    state = state.options[state.selectedIndex].value ; 
	
	var area = document.request_form.p1_121_4.value ;
	
	if (area != '' && state != '' && state != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
		//getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateStatePhone.php?area=' + area +'&state='+state;
		http = getHttpRequestObj();
		waitResponse = 'Validating phone number ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating phone number ...";
		http.onreadystatechange = handleHttpResponseStatePhone;
		http.open('GET', url, true);
		http.send(null);
	}
	
	
}	
// phone 2 validation starts here
//CDS-E177 -Removing Hard-coding from Capella for validation
function handleHttpResponseStatePhone2(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   //alert('a2'+ response);
	    //var getButton  = document.getElementById('sButton');
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		waitResponse = '';
		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				CapellaPhoneError2 = '';
			 }else if(response == 0){
				CapellaPhoneError2 = 'Please Enter a Valid Work Area code for the State selected.';
			 }
   }
}

//CDS-E177 -Removing Hard-coding from Capella for validation
function validateState_Phone2(){
	
	var state = document.request_form.STATE ;
	    state = state.options[state.selectedIndex].value ; 
    var area = document.request_form.p1_121_5.value ;
	
	if (area != '' && state != '' && state != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		//getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateStatePhone.php?area=' + area +'&state='+state;
		http = getHttpRequestObj();
		waitResponse = 'Validating phone number ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating phone number ...";
		http.onreadystatechange = handleHttpResponseStatePhone2;
		http.open('GET', url, true);
		http.send(null);
	}
}

/* Area code & prefix phone validations */

// phone 2 validation starts here
function handleHttpResponseAreaPrefix1(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   //alert('a2'+ response);
	    //var getButton  = document.getElementById('sButton');
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		waitResponse = '';
		

		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				PhoneAreaPrefixError1 = '';
			 }else if(response == 0){
				PhoneAreaPrefixError1 = 'Please Enter a Valid Phone Number.';
			 }
   }
}

function validateAreaCode_Prefix1(a,p){
    var area = a.value ;
    var prefix = p.value ;

	if (area != '' && prefix != '' ) {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		var url = 'validatePhoneAreaCodePrefix.php?area=' + area +'&prefix='+prefix;
		http = getHttpRequestObj();
		waitResponse = 'Validating phone number ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating phone number ...";
		http.onreadystatechange = handleHttpResponseAreaPrefix1;
		http.open('GET', url, true);
		http.send(null);
	} else {
        PhoneAreaPrefixError1 = '';
    }
}
function validateAreaCode_PrefixOnLoad1(a,p){
    var area = a.value ;
    var prefix = p.value ;

	if (area != '' && prefix != '' ) {
		var url = 'validatePhoneAreaCodePrefix.php?area=' + area +'&prefix='+prefix;
		http = getHttpRequestObj();
		http.onreadystatechange = handleHttpResponseAreaPrefix1;
		http.open('GET', url, true);
		http.send(null);
	} else {
        PhoneAreaPrefixError1 = '';
    }
}
function validateAreaCode_PrefixOnLoad2(a,p){
    var area = a.value ;
    var prefix = p.value ;

	if (area != '' && prefix != '' ) {
		var url = 'validatePhoneAreaCodePrefix.php?area=' + area +'&prefix='+prefix;
		http = getHttpRequestObj();
		http.onreadystatechange = handleHttpResponseAreaPrefix2;
		http.open('GET', url, true);
		http.send(null);
	} else {
        PhoneAreaPrefixError2 = '';
    }
}
/* END HERE */
/* Area code & prefix phone validations */

// phone 2 validation starts here
function handleHttpResponseAreaPrefix2(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   //alert('a2'+ response);
	    //var getButton  = document.getElementById('sButton');
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		waitResponse = '';
		

		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				PhoneAreaPrefixError2 = '';
			 }else if(response == 0){
				PhoneAreaPrefixError2 = 'Please Enter a Valid Phone Number.';
			 }
   }
}

function validateAreaCode_Prefix2(a,p){
    var area = a.value ;
    var prefix = p.value ;

	if (area != '' && prefix != '' ) {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		var url = 'validatePhoneAreaCodePrefix.php?area=' + area +'&prefix='+prefix;
		http = getHttpRequestObj();
		waitResponse = 'Validating phone number ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating phone number ...";
		http.onreadystatechange = handleHttpResponseAreaPrefix2;
		http.open('GET', url, true);
		http.send(null);
	} else {
        PhoneAreaPrefixError2 = '';
    }
}

function validateAreaCode_PrefixOnLoad3(a,p){
    var area = a.value ;
    var prefix = p.value ;

	if (area != '' && prefix != '' ) {
		var url = 'validatePhoneAreaCodePrefix.php?area=' + area +'&prefix='+prefix;
		http = getHttpRequestObj();
		http.onreadystatechange = handleHttpResponseAreaPrefix3;
		http.open('GET', url, true);
		http.send(null);
	} else {
        PhoneAreaPrefixError3 = '';
    }
}

/* Area code & prefix phone validations */

// phone 2 validation starts here
function handleHttpResponseAreaPrefix3(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   //alert('a2'+ response);
	    //var getButton  = document.getElementById('sButton');
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		waitResponse = '';
		

		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				PhoneAreaPrefixError3 = '';
			 }else if(response == 0){
				PhoneAreaPrefixError3 = 'Please Enter a Valid Phone Number.';
			 }
   }
}

function validateAreaCode_Prefix3(a,p){
    var area = a.value ;
    var prefix = p.value ;

	if (area != '' && prefix != '' ) {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		var url = 'validatePhoneAreaCodePrefix.php?area=' + area +'&prefix='+prefix;
		http = getHttpRequestObj();
		waitResponse = 'Validating phone number ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating phone number ...";
		http.onreadystatechange = handleHttpResponseAreaPrefix3;
		http.open('GET', url, true);
		http.send(null);
	} else {
        PhoneAreaPrefixError3 = '';
    }
}
// for all forms zip/state validations

function handleHttpResponseStateZipAll(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   // var getButton  = document.getElementById('sButton');
	   var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
		//getButton.innerHTML = '<input type="image" src="ces-images/btn-submit-request.gif" alt="Submit" width="79" height="22" border="0" style="cursor:pointer">';
			 if(response == 1) {
				zipStateError = '';
			 }else if(response == 0){
				zipStateError = 'Please Enter a Valid Zip Code for the State selected.';
			 }
   }
}

function validateStateZip(z,s,f){

	var state = s.options[s.selectedIndex].value ; 
	var zip = z.value ;

	
	if (zip != '' && state != '' && state != 'select') {
		
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
		//getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateStateZip.php?zip=' + zip +'&state='+state+'&format='+f;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseStateZipAll;
		http.open('GET', url, true);
		http.send(null);
	}
	
}
// step1 zip state validations

function handleHttpResponseStateZip1(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   var getButton  = document.getElementById('s1Button');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('d1Button');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('p1Submit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				zipStateError = '';
			 }else if(response == 0){
				zipStateError = 'Please Enter a Valid Zip Code for the State selected.';
			 }
   }
}

function validateStateZip1(z,s,f){

	var state = s.options[s.selectedIndex].value ; 
	var zip = z.value ;

	
	if (zip != '' && state != '' && state != 'select') {
		
		var getProcess = document.getElementById('p1Submit');
		var getButton  = document.getElementById('s1Button');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('d1Button');
			dButton.style.display = 'block';
		var url = 'validateStateZip.php?zip=' + zip +'&state='+state+'&format='+f;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseStateZip1;
		http.open('GET', url, true);
		http.send(null);
	}
	
}
//END here

/* CDS - E94  Argosy Implementation starts here */

function validateCampusZipPrograms() {

var campus = document.request_form.locationCode;
    campus = campus.options[campus.selectedIndex].value

var program = document.request_form.programOfInterest ;
	    program = program.options[program.selectedIndex].value ; 
		
var zip = document.request_form.addressZip.value ;

	if(campus!='' && zip != '' && program != '') {
		
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';

		var url = 'validateCampusZipPrograms.php?zip=' + zip +'&campus='+campus+'&program='+escape(program);
			http = getHttpRequestObj();
			waitResponse = 'Validating Campus,Zip and Program ...';
			getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating Campus,Zip and Program ...";
			http.onreadystatechange = handleHttpResponseCampusZipProgram;
			http.open('GET', url, true);
			http.send(null);	
	}
	
}
function handleHttpResponseCampusZipProgram(){
	
	if(http.readyState == 4){
	   var response = http.responseText;
	   var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				campusZipProgramError = '';
			 }else if(response == 0){
				campusZipProgramError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}

/* CDS - E94  Argosy Implementation ends here */

//CHR693 Capella University through new vendor - Cole&Weber - Start Here
function MSPhDalertmessage(){
 var progcode = document.request_form.program_code;
 var v = progcode.options[progcode.selectedIndex];

if( v.value == '368' || v.value == '370' || v.value == '353' || v.value == '622'){
        alert('Thank you for your interest in Capella University.  The specialization you have selected is for current K-12 professionals interested in extending their education with a graduate degree.  Please be aware that this specialization does not lead to initial teacher licensure.');
	}
if(  v.value == '1410'){
        alert('Thank you for your interest in Capella University.  Please be aware that the specialization you have selected is for current licensed registered nurses with a master’s degree in Nursing.');
	}

}
//CHR693 Capella University through new vendor - Cole&Weber - End Here

/* CDS -E110 Functions for Date Of Birth for Pepperdine */

//Get days in Month by passing iMonth and Year
function daysInMonth(iMonth, iYear){
	return 32 - new Date(iYear, iMonth, 32).getDate();
}

// Get Day Select Box options Passing Month and Year
function getDayOptions() {
	var month = document.request_form.age_month;
    	month = month.options[month.selectedIndex].value; 
	var year = document.request_form.age_year;
    	year = year.options[year.selectedIndex].value; 
	var noofdays;
	if(month=='select' || year =='select') {
		noofdays = 31
	} else {
		month = month - 1;
		noofdays = daysInMonth(month, year);
	}
	
	for(i=document.request_form.age_day.options.length-1;i>=0;i--)  { 
		document.request_form.age_day.remove(i);  
	} 
	var optn1 = document.createElement('OPTION'); 
	optn1.value = "select"
	optn1.text = "Day";
	document.request_form.age_day.options.add(optn1);
	for(var i=1;i<=noofdays;i++) {
		var optn1 = document.createElement('OPTION'); 
		optn1.value = optn1.text = i;
		document.request_form.age_day.options.add(optn1);
	}

}
/* CDS -E110 Functions for Date Of Birth for Pepperdine Ends*/
// CHR442 IDAT - New School: CODE ADDED FOR VALIDATING ZIP FOR A GIVEN CAMPUS Degree tree version
function validateIADTCampusZipDT(){
	var campus = document.request_form.sycampusid ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.addr_zipcode.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		//var getButton  = document.getElementById('sButton');
	//	getButton.innerHTML = "<img src='ces-images/btn-submit-requestDis.gif' alt='Submit' width='79' height='22' border='0'/>";
		var url = 'validateCampusZip.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseIADTCampusZipDT;
		http.open('GET', url, true);
		http.send(null);
	}

}
/* only zip validated here */
function handleHttpResponseIADTCampusZipDT(){
	if(http.readyState == 4){
	   var response = http.responseText;
	   // var getButton  = document.getElementById('sButton');
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'International Academy of Design and Technology does not accept inquiries for this program from your state.';
			 }
   }
}
//CHR442 IDAT - New School END OF CODE FOR VALIDATING ZIP FOR GIVEN CAMPUS Degree tree version
// CHR603 Devry Acceptable Zip Codes - START Degree tree version

function validateDevryZipDT(){

	var zip = Trim(document.request_form.zip.value) ;
	var campus1 = 295;
	var campus2 = 298;

	if ( zip != '' && isNumeric(zip) && (zip.toString().length == 5 ) ) {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'validateDevryZip.php?zip=' + zip +'&campus1='+campus1+'&campus2='+campus2;
		http = getHttpRequestObj();
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseDevryZipDT;
		http.open('GET', url, true);
		http.send(null);
	}
   }

/* only zip validated here */
function handleHttpResponseDevryZipDT(){
	if(http.readyState == 4){
	    var data = parseResponseText(http.responseText);
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';

			 if(data[0] == 1 && data[1] == 1) {                
				CampusZipError = '';
                CampusZipConfirmError = 'DeVry offers highly engaged onsite classes in the area of your zip code. Would you like to learn more by enrolling in onsite?';
				addClassroompreferenceOption('0');
			 }else if(data[0] == 0 && data[1] == 1) {
                CampusZipConfirmError = 'DeVry offers highly engaged onsite classes in the area of your zip code. Would you like to learn more by enrolling in onsite?';
				CampusZipError = '';
				addClassroompreferenceOption('0');
			 }else if(data[0] == 0 && data[1] == 0){
                CampusZipConfirmError = '';
				addClassroompreferenceOption('0');
				CampusZipError = 'Sorry, DeVry University does not have any campuses in your area.  However, DeVry does offer your chosen program of study online.  If you are interested in attending DeVry Online, please select the online option.';

			 }
   }
 }
 // CHR603 Devry Acceptable Zip Codes -END Degree tree version

/* CHR678 UMUC Date of Birth field - Start Here */
function getDayOptionsumuc() {
	var month = document.request_form.birthmonth;
    	month = month.options[month.selectedIndex].value;
	var year = document.request_form.birthyear;
    	year = year.options[year.selectedIndex].value;
	var noofdays;
	if(month=='select' || year =='select') {
		noofdays = 31
	} else {
		month = month - 1;
		noofdays = daysInMonth(month, year);
	}

	for(i=document.request_form.birthday.options.length-1;i>=0;i--)  {
		document.request_form.birthday.remove(i);
	}
	var optn1 = document.createElement('OPTION');
	optn1.value = "select"
	optn1.text = "Day";
	document.request_form.birthday.options.add(optn1);
	for(var i=1;i<=noofdays;i++) {
		var optn1 = document.createElement('OPTION');
		optn1.value = optn1.text = i;
		document.request_form.birthday.options.add(optn1);
	}

}
 /* CHR678 UMUC Date of Birth field - Ends Here */
 // CHR688 Schools for Canada Site: CODE ADDED FOR PREPOPULATING CAMPUS PROGRAMS START HERE
function getCanadaCampusPrograms(sid){
    if(sid == '330') {
        var campusnew = document.request_form.campus ;
        var zip = document.request_form.postal_code.value;
    } else {
        var campusnew = document.request_form.CampusID ;
        var zip = document.request_form.PostalZipCode.value;
    }
	    campusid = campusnew.options[campusnew.selectedIndex].value ;

	if ( campusid != '') {
		var url = '/getCanadaCampus_programs.php?campus='+campusid +'&schoolId='+sid;
		http = getHttpRequestObj();
		http.onreadystatechange = handleHttpResponseCanadaCampusPrograms;
		http.open('GET', url, true);
		http.send(null);
        if(zip != ''){
        setTimeout("validateCanadaCampusZip("+sid+")",800);
        }
	}

}

function getCanadaCampusProgramsDT(sid){
    if(sid == '330') {
        var campusnew = document.request_form.campus ;
        var zip = document.request_form.postal_code.value;
    } else {
        var campusnew = document.request_form.CampusID ;
        var zip = document.request_form.PostalZipCode.value;
    }
	    campusid = campusnew.options[campusnew.selectedIndex].value ;

	if ( campusid != '') {
		var url = '/getCanadaCampus_programs.php?campus='+campusid +'&schoolId='+sid;
		http = getHttpRequestObj();
		http.onreadystatechange = handleHttpResponseCanadaCampusPrograms;
		http.open('GET', url, true);
		http.send(null);
        if(zip != ''){
        setTimeout("validateCanadaCampusZipDT("+sid+")",800);
        }
	}

}

function handleHttpResponseCanadaCampusPrograms(){

   if(http.readyState == 4){
      var progStr = http.responseText;
	  var arr1 = Array();
	  arr1 = progStr.split("\t");
      var sid = arr1[0];
      var arr = arr1[1].split("\n");
		if(progStr){
			updatePrograms(sid,arr);
		}
       }

}

function updatePrograms(sid,a) {
  var browserName = navigator.appName;
  var version = navigator.appVersion;
	if(a.length != 0) {
		clearPrograms(sid);

		var progs = getProgramsElem(sid);


		for(var i=0;i<a.length;i++){
			if(a[i]){
				var arr = Array();
				arr = a[i].split(":");
    			var opt = document.createElement("OPTION");
				opt.value = arr[0];
				opt.text = arr[1];
				if (browserName=="Netscape" && version.indexOf('Safari') != -1)
				{
				  progs.options[progs.length] = opt;
				}else {
				  progs.options.add(opt);
				}

			}
		}
	}
}

function clearPrograms(sid) {
 var selectbox = getProgramsElem(sid);
 var i;
 for(i=selectbox.options.length-1;i>=0;i--) {
    selectbox.remove(i);
 }

}
function getProgramsElem(sid) {
   if(sid == '330')
       return document.request_form.program_code;
   else
       return document.request_form.ProgramID;
}
// CHR688 Schools for Canada Site: CODE ADDED FOR PREPOPULATING CAMPUS PROGRAMS ENDS HERE

// CHR688 Schools for Canada Site: CODE ADDED FOR VALIDATING ZIP FOR A GIVEN CAMPUS START HERE
function validateCanadaCampusZip(sid){

    if(sid == '330') {
        var campus = document.request_form.campus ;
        var zip = document.request_form.postal_code.value ;
    } else {
        var campus = document.request_form.CampusID ;
        var zip = document.request_form.PostalZipCode.value ;
    }
    if(sid == '325') {
        campusid = campus.value ;
    } else {
        campusid = campus.options[campus.selectedIndex].value ;
    }

    // SETTING THE TIME GAP USING setTimeout() function BETWEEN THE TWO AJAX FUNCTIONS

	if (zip != '' && campusid != '' && campusid != 'select' ) {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'validateCanadaCampusZip.php?zip=' + zip +'&campus='+campusid +'&schoolId='+sid;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='/ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseCanadaCampusZip;
		http.open('GET', url, true);
		http.send(null);
	}

}
/* only zip validated here */
function handleHttpResponseCanadaCampusZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Postal Code for the Campus selected.';
			 }else if(response == 2){
				CampusZipError = 'Please Enter a Valid Postal Code for the Campus Burnaby.';
			 }
   }
}

function validateCanadaCampusZipDT(sid){

    if(sid == '330') {
        var campus = document.request_form.campus ;
        var zip = document.request_form.postal_code.value ;
    } else {
        var campus = document.request_form.CampusID ;
        var zip = document.request_form.PostalZipCode.value ;
    }
    if(sid == '325') {
        campusid = campus.value ;
    } else {
        campusid = campus.options[campus.selectedIndex].value ;
    }

    // SETTING THE TIME GAP USING setTimeout() function BETWEEN THE TWO AJAX FUNCTIONS

    if (zip != '' && campusid != '' && campusid != 'select' ) {

		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'validateCanadaCampusZip.php?zip=' + zip +'&campus='+campusid +'&schoolId='+sid;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='/ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseCanadaCampusZipDT;
		http.open('GET', url, true);
		http.send(null);
	}

}

function handleHttpResponseCanadaCampusZipDT(){
	if(http.readyState == 4){
	   var response = http.responseText;
	   var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Postal Code for the Campus selected.';
			 }else if(response == 2){
				CampusZipError = 'Please Enter a Valid Postal Code for the Campus Burnaby.';
			 }
   }
}
//CHR688 Schools for Canada Site END OF CODE FOR VALIDATING ZIP FOR GIVEN CAMPUS

//CHR745 Capella Zip Code Validation Start
function validateCapellaCWZip(){

    var zip = document.request_form.zip.value ;
	var program_code = document.request_form.program_code.value ;
    
	if (zip != '') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'validateCapellaCWZip.php?zip=' + zip +'&program_code=' + program_code ;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='/ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseCapellaCWZip;
		http.open('GET', url, true);
		http.send(null);
	}

}
/* only zip validated here */
function handleHttpResponseCapellaCWZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CapellaZipError = '';
			 }else if(response == 0){
				CapellaZipError = 'The zip code entered is not valid. You must have a valid U.S. zip code.';
			 }else if(response == 2){
				CapellaZipError = 'Thank you for your interest in Capella University. The specialization you have selected is not currently offered in your State. Best wishes in exploring your educational options.';
			 }else if(response == 3){
				CapellaZipError = 'Thank you for your interest in Capella University. The specialization you have selected is not currently offered in your State. Best wishes in exploring your educational options.';
			 }
			 
   }
}

function validateCapellaCWZipDT(){

    var zip = document.request_form.zip.value ;
	var program_code = document.request_form.program_code.value ;

	if (zip != '') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'validateCapellaCWZip.php?zip=' + zip +'&program_code=' + program_code ;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='/ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseCapellaCWZipDT;
		http.open('GET', url, true);
		http.send(null);
	}

}

function handleHttpResponseCapellaCWZipDT(){
	if(http.readyState == 4){
	   var response = http.responseText;
	   var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CapellaZipError = '';
			 }else if(response == 0){
				CapellaZipError = 'The zip code entered is not valid. You must have a valid U.S. zip code.';
			 }else if(response == 2){
				CapellaZipError = 'Thank you for your interest in Capella University. The specialization you have selected is not currently offered in your State. Best wishes in exploring your educational options.';
			 }else if(response == 3){
				CapellaZipError = 'Thank you for your interest in Capella University. The specialization you have selected is not currently offered in your State. Best wishes in exploring your educational options.';
			 }
   }
}

function onloadCapellaZip(){

	var zip = document.request_form.zip.value ;
	var program_code = document.request_form.program_code.value ;

	if ( zip != '' ) {
		var url = 'validateCapellaCWZip.php?zip=' + zip +'&program_code=' + program_code ;
		httponloadCapellaZip = getHttpRequestObj();
		httponloadCapellaZip.onreadystatechange = handleHttpResponseonloadCapellaZip;
		httponloadCapellaZip.open('GET', url, true);
		httponloadCapellaZip.send(null);
	}

}

function handleHttpResponseonloadCapellaZip(){
	if(httponloadCapellaZip.readyState == 4){
	    var response = httponloadCapellaZip.responseText;
			 if(response == 1) {
				CapellaZipError = '';
			 }else if(response == 0){
				CapellaZipError = 'The zip code entered is not valid. You must have a valid U.S. zip code.';
			 }else if(response == 2){
				CapellaZipError = 'Thank you for your interest in Capella University. The specialization you have selected is not currently offered in your State. Best wishes in exploring your educational options.';
			 }else if(response == 3){
				CapellaZipError = 'Thank you for your interest in Capella University. The specialization you have selected is not currently offered in your State. Best wishes in exploring your educational options.';
			 }
        }
}

//CHR745 Capella Zip Code Validation End


/* Walden video tracking */
function getResourceTrack(sId,rId,eId){
	var url = '/getResourceTrack.php?schoolId='+sId+'&resId='+rId+'&eventId='+eId;
	httpTrack = getHttpRequestObj();
	httpTrack.open('GET', url, true);
	httpTrack.send(null);

}

// CHR998 Devry Epsilon - New Jersy Program Start

function handleHttpResponseDevryNJState(){
	if(http1.readyState == 4){
		var response = http1.responseText;
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'block';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
		var optn1 = document.createElement('OPTION');
		var selObj = document.request_form.Program;
		
		if(response == 'YES') {
			var progExist = 'No';
			optn1.value = "AENDTJ"
			optn1.text = "Associate-Electroneurodiagnostic Technology";
			for (i=0; i<selObj.options.length; i++) {
			    if (selObj.options[i].value == "AENDTJ") {
					progExist = "Yes";
			    }
			}
			if(progExist == 'No'){
				selObj.options.add(optn1);
			}	
		}else if(response == 'NO'){
			for (i=0; i<selObj.options.length; i++) {
			    if (selObj.options[i].value == "AENDTJ") {
					selObj.remove(i);
			    }
			}
		}
	}
}

function checkDevryNJState(){

	var zip = document.request_form.Postal_Code.value;
	if (zip != '') {
		var getProcess = document.getElementById('pSubmit');
		var getButton  = document.getElementById('sButton');
			getButton.style.display = 'none';
		var dButton  = document.getElementById('dButton');
			dButton.style.display = 'block';
		
		var url = 'validateDevryNJState.php?zip=' + zip;
		http1 = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http1.onreadystatechange = handleHttpResponseDevryNJState;
		http1.open('GET', url, true);
		http1.send(null);
	}	
}
// CHR998 Devry Epsilon - New Jersy Program END
// CHR1184 Everglades Campus - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validateEGCampusZip(){
	var campus = document.request_form.campus ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.zip.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseEGCampusZip;
		http.open('GET', url, true);
		http.send(null);
	}

}
function handleHttpResponseEGCampusZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'The zip code entered does not qualify you for any of the campus locations. Please apply to Everglades online.';
			 }
   }
}
function validateEGCampusZipDT(){
	var campus = document.request_form.campus ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.zip.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseEGCampusZipDT;
		http.open('GET', url, true);
		http.send(null);
	}

}
function handleHttpResponseEGCampusZipDT(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'The zip code entered does not qualify you for any of the campus locations. Please apply to Everglades online.';
			 }
   }
}
// CHR1184 Everglades Campus - VALIDATING ZIP FOR A GIVEN CAMPUS - End
// CHR1204 ATI Career Training Center Campus - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validateATICampusZip(){
	var campus = document.request_form.campus_c ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.Zip.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		ATIhttp = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		ATIhttp.onreadystatechange = handleHttpResponseATICampusZip;
		ATIhttp.open('GET', url, true);
		ATIhttp.send(null);
	}

}
function handleHttpResponseATICampusZip(){
	if(ATIhttp.readyState == 4){
	   var response = ATIhttp.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
function validateATICampusZipDT(){
	var campus = document.request_form.campus_c ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.Zip.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		ATIhttp = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		ATIhttp.onreadystatechange = handleHttpResponseATICampusZipDT;
		ATIhttp.open('GET', url, true);
		ATIhttp.send(null);
	}

}
function handleHttpResponseATICampusZipDT(){
	if(ATIhttp.readyState == 4){
	   var response = ATIhttp.responseText;
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'The zip code entered does not qualify you for any of the campus locations. Please apply to Everglades online.';
			 }
   }
}
// CHR1204 ATI Career Training Center Campus - VALIDATING ZIP FOR A GIVEN CAMPUS - End
// CHR1151 EBI - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validateEBICampusZip(){
	var campus = document.request_form.campus_code ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.postal_code.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseEBICampusZip;
		http.open('GET', url, true);
		http.send(null);
	}

}
function handleHttpResponseEBICampusZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
function validateEBICampusZipDT(){
	var campus = document.request_form.campus_code ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.postal_code.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseEBICampusZipDT;
		http.open('GET', url, true);
		http.send(null);
	}

}
function handleHttpResponseEBICampusZipDT(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
// CHR1151 EBI - VALIDATING ZIP FOR A GIVEN CAMPUS - End
// CHR1205 South Texas Vocational Training Campus (STVT) - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validateSTVTCampusZip(){
	var campus = document.request_form.location ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.zip_postal.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		STVThttp = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		STVThttp.onreadystatechange = handleHttpResponseSTVTCampusZip;
		STVThttp.open('GET', url, true);
		STVThttp.send(null);
	}

}
function handleHttpResponseSTVTCampusZip(){
	if(STVThttp.readyState == 4){
	   var response = STVThttp.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
function validateSTVTCampusZipDT(){
	var campus = document.request_form.location ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.zip_postal.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		STVThttp = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		STVThttp.onreadystatechange = handleHttpResponseSTVTCampusZipDT;
		STVThttp.open('GET', url, true);
		STVThttp.send(null);
	}

}
function handleHttpResponseSTVTCampusZipDT(){
	if(STVThttp.readyState == 4){
	   var response = STVThttp.responseText;
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
// CHR1205 South Texas Vocational Training Campus (STVT) - VALIDATING ZIP FOR A GIVEN CAMPUS - End
// CHR1228_CAC_CHR1229_SHC_CHR1230_CCSDC - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validate_CAC_SHC_CCDC_CampusZip(){
	var campus = document.request_form.ddCampus ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.txtZipCode.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		CAC_SHC_CCDC_http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		CAC_SHC_CCDC_http.onreadystatechange = handleHttpResponse_CAC_SHC_CCDC_CampusZip;
		CAC_SHC_CCDC_http.open('GET', url, true);
		CAC_SHC_CCDC_http.send(null);
	}

}
function handleHttpResponse_CAC_SHC_CCDC_CampusZip(){
	if(CAC_SHC_CCDC_http.readyState == 4){
	   var response = CAC_SHC_CCDC_http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
function validate_CAC_SHC_CCDC_CampusZipDT(){
	var campus = document.request_form.ddCampus ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.txtZipCode.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		CAC_SHC_CCDC_http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		CAC_SHC_CCDC_http.onreadystatechange = handleHttpResponse_CAC_SHC_CCDC_CampusZipDT;
		CAC_SHC_CCDC_http.open('GET', url, true);
		CAC_SHC_CCDC_http.send(null);
	}

}
function handleHttpResponse_CAC_SHC_CCDC_CampusZipDT(){
	if(CAC_SHC_CCDC_http.readyState == 4){
	   var response = CAC_SHC_CCDC_http.responseText;
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
// CHR1228_CAC_CHR1229_SHC_CHR1230_CCSDC - VALIDATING ZIP FOR A GIVEN CAMPUS - End
// CHR1194 Provo and Eagle Gate - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validatePEGCampusZip(){
	var campus = document.request_form.campus_code.value ;

	var zip = document.request_form.postal_code.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		PROVO_EAGLE_http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		PROVO_EAGLE_http.onreadystatechange = handleHttpResponsePEGCampusZip;
		PROVO_EAGLE_http.open('GET', url, true);
		PROVO_EAGLE_http.send(null);
	}

}
function handleHttpResponsePEGCampusZip(){
	if(PROVO_EAGLE_http.readyState == 4){
	   var response = PROVO_EAGLE_http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code to apply for this School.';
			 }
   }
}
function validatePEGCampusZipDT(){
	var campus = document.request_form.campus_code.value ;
	var zip = document.request_form.postal_code.value ;


	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pSubmit');
		var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		PROVO_EAGLE_http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		PROVO_EAGLE_http.onreadystatechange = handleHttpResponsePEGCampusZipDT;
		PROVO_EAGLE_http.open('GET', url, true);
		PROVO_EAGLE_http.send(null);
	}

}
function handleHttpResponsePEGCampusZipDT(){
	if(PROVO_EAGLE_http.readyState == 4){
	   var response = PROVO_EAGLE_http.responseText;
	    var cgetButton  = document.getElementById('sButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dButton');
			cbdButton.style.display = 'none';
		var getProcess = document.getElementById('pSubmit');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code to apply for this School.';
			 }
   }
}
// CHR1194 Provo and Eagle Gate - VALIDATING ZIP FOR A GIVEN CAMPUS - End
// CHR1150 CDIA - VALIDATING ZIP FOR A GIVEN CAMPUS - Start
function validateCDIACampusZip(){
	var campus = document.request_form.campus_code ;
	    campus = campus.options[campus.selectedIndex].value ;

	var zip = document.request_form.zipcode.value ;

	if (zip != '' && campus != '' && campus != 'select') {
		var getProcess = document.getElementById('pContinue');
		var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'none';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'block';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'none';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'block';
		var url = 'Validate_Location_ZipCodes.php?zip=' + zip +'&campus='+campus;
		http = getHttpRequestObj();
		waitResponse = 'Validating zip code ...';
		getProcess.innerHTML = "<img src='ces-images/loading.gif' /> Validating zip code ...";
		http.onreadystatechange = handleHttpResponseCDIACampusZip;
		http.open('GET', url, true);
		http.send(null);
	}

}
function handleHttpResponseCDIACampusZip(){
	if(http.readyState == 4){
	   var response = http.responseText;
	    var cgetButton  = document.getElementById('cButton');
			cgetButton.style.display = 'block';
		var cbdButton  = document.getElementById('dcButton');
			cbdButton.style.display = 'none';
		var astep2  = document.getElementById('astep2');
			astep2.style.display = 'block';
		var step2  = document.getElementById('pstep2');
			step2.style.display = 'none';
		var getProcess = document.getElementById('pContinue');
		getProcess.innerHTML = '';
		waitResponse = '';
			 if(response == 1) {
				CampusZipError = '';
			 }else if(response == 0){
				CampusZipError = 'Please Enter a Valid Zip Code for the Campus selected.';
			 }
   }
}
// CHR1150 CDIA - VALIDATING ZIP FOR A GIVEN CAMPUS - End
