function pageInit(){
	initMoreLinkPg();
	reValue();
}

function validateSmall(form){
	
	if(form.SUBJECT.value ==''){
		alert("Please select a subject area that you are interested in");
		return false;
	}	
	
	if(form.DEGREELEVEL.value ==''){
		alert("Please select the hightest level of education you have completed");
		form.DEGREELEVEL.focus();
		return false;
	}
	
	if(document.UserForm.MILITARY && document.UserForm.MILITARY.value ==""){
		alert("Please indicate whether you are associated with the U.S. military");
		form.MILITARY.focus();
		return false;	
	}
	if(checkzip(form.ZIP.value) == 0){
		alert("Please enter a valid zip code");
		form.ZIP.focus();
		return false;
	}
	return true;	
}

function validateForm1(form){
	
	if(validateSubArea(document.UserForm.SUBJECT) == false){
		alert("Please pick one or more subject areas that you are interested in");
		return false;
	}	
	
	if(form.DEGREELEVEL.value ==''){
		alert("Please select the hightest level of education you have completed");
		form.DEGREELEVEL.focus();
		return false;
	}
	
	if(document.UserForm.MILITARY && document.UserForm.MILITARY.value ==""){
		alert("Please indicate whether you are associated with the U.S. military");
		form.MILITARY.focus();
		return false;	
	}
	if(checkzip(form.ZIP.value) == 0){
		alert("Please enter a valid zip code");
		form.ZIP.focus();
		return false;
	}
	return true;	
}
function validateSubArea(sel_area){
	for( i = 0; i<sel_area.length; i++){
		if(sel_area[i].checked){
			return true;
		}
	}
	return false;
}
function setSubject(str){
	if(str != ""){		
		var sel_area = document.UserForm.SUBJECT;
		for(var i = 0; i<sel_area.length; i++){			
			if(str.indexOf(sel_area[i].value)>=0){			
				sel_area[i].checked = true;
			}			
		}
	}
}

function checkzip(value){
	if(trimString(value)==""){
		return 0;
	}
	else if(value.length != 5){
		return 0;
	}
	else{
		return validZip(value);
	}
}

function validZip(zipnum){

	var numExp = /[^0-9]/;
	if(numExp.test(zipnum)){
		return 0;
	}
	////doing zipcode check ////
	
	var invalidZip = Array(
		"000", "001", "002", "003", "004", "099", "213", "269", "343", "345",
		"348", "353", "419", "428", "429", "517", "518", "519", "529", "533",
		"536", "552", "568", "578", "579", "589", "621", "632", "642", "643",
		"659", "663", "682", "694", "695", "696", "697", "698", "699", "702",
		"709", "715", "732", "742", "771", "817", "818", "819", "839", "848",
		"849", "851", "854", "858", "861", "862", "866", "867", "868", "869",
		"872", "876", "886", "887", "888", "892", "896", "899", "909", "929",
		"987");
	
	if(invalidZip.contains(zipnum.substring(0,3))){
		return 0;
	}
	return 1;
}
