function checkMaiden(){	
	if (document.register.title.value == 'Mr.'){
		window.document.getElementById('maiden').style.display = "none";
	} else {
    	window.document.getElementById('maiden').style.display = "";
	}
}

function hideAddr(){	
	window.document.getElementById('shipstreet').style.display = "none";
	window.document.getElementById('shipcity').style.display = "none";
	window.document.getElementById('shipstate').style.display = "none";
	window.document.getElementById('shipzip').style.display = "none";		
}

function showAddr(){	
	window.document.getElementById('shipstreet').style.display = "";
	window.document.getElementById('shipcity').style.display = "";
	window.document.getElementById('shipstate').style.display = "";
	window.document.getElementById('shipzip').style.display = "";	
}

function hideSDegree(){	
	window.document.getElementById('syear').style.display = "none";
	window.document.getElementById('scollege').style.display = "none";
	window.document.getElementById('sdegree').style.display = "none";	
}

function showSDegree(){	
	window.document.getElementById('syear').style.display = "";
	window.document.getElementById('scollege').style.display = "";
	window.document.getElementById('sdegree').style.display = "";	
}

function hideVol(){	
	window.document.getElementById('vollist').style.display = "none";	
}

function showVol(){	
	window.document.getElementById('vollist').style.display = "";
}

String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
}

function checkForm(){
	var control = true;	
	window.document.getElementById('amail').className = "";
	window.document.getElementById('mail').className = "";
	window.document.getElementById('dphone').className = "";
	window.document.getElementById('year').className = "";
	window.document.getElementById('lastname').className = "";
	window.document.getElementById('fname').className = "";
					
	if (document.register.amail.value.trim() != ""){
		if ( !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.register.amail.value)) ){
			window.document.getElementById('amail').className = "spancapt";
			document.register.amail.value = "";
			document.register.amail.focus();
			control = false;			
		} 
	}
	
	if ( !(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.register.mail.value)) ){
			window.document.getElementById('mail').className = "spancapt";
			document.register.mail.value = "";
			document.register.mail.focus();
			control = false;					
	} 
	
	if ( document.register.dphone.value.trim() == '' ){
			window.document.getElementById('dphone').className = "spancapt";
			document.register.dphone.value = "";
			document.register.dphone.focus();
			control = false;					
	} 
	
	if ( document.register.year.value.trim() == '' ){
			window.document.getElementById('year').className = "spancapt";
			document.register.year.value = "";
			document.register.year.focus();
			control = false;					
	} 
	
	if ( document.register.lastname.value.trim() == '' ){
			window.document.getElementById('lastname').className = "spancapt";
			document.register.lastname.value = "";
			document.register.lastname.focus();
			control = false;					
	} 
	
	if ( document.register.fname.value.trim() == '' ){
			window.document.getElementById('fname').className = "spancapt";
			document.register.fname.value = "";
			document.register.fname.focus();
			control = false;					
	} 
	
	if (control == false){
		window.document.getElementById('startcapt').style.display = "none";
		window.document.getElementById('errcapt').style.display = "block";
	}
	
 	return control;
}