
function OB(id){
	return document.getElementById(id);
}

function OBV(id){
	return document.getElementById(id).value;
}

function verifyEmail(email_str){
	return (email_str.indexOf(".") > 2) && (email_str.indexOf("@") > 0);
}

function verifyAdRequestForm(){
	
	if( OBV('fullname') == ''){
		OB('fullname').focus();
		alert('Please specify Full Name');
		return false;
	}
	
	if( (OBV('email') == '') || !verifyEmail(OBV('email')) ){
		OB('email').focus();
		alert('Please specify valid email');
		return false;
	}
	
	if( OBV('ad_request_info') == '' ){
		OB('ad_request_info').focus();
		alert('Please specify Ad request Info');
		return false;
	}
	
	return true;
}

function verifyComplaintForm(){
	
	if( OBV('fullname') == ''){
		OB('fullname').focus();
		alert('Please specify Full Name');
		return false;
	}
	
	if( (OBV('email') == '') || !verifyEmail(OBV('email')) ){
		OB('email').focus();
		alert('Please specify valid email');
		return false;
	}
	
	if( OBV('complaint_info') == '' ){
		OB('complaint_info').focus();
		alert('Please specify Complaint Info');
		return false;
	}
	
	return true;
}

function verifyContactForm(){
	
	if( OBV('fullname') == ''){
		OB('fullname').focus();
		alert('Please specify Full Name');
		return false;
	}
	
	if( OBV('company') == ''){
		OB('company').focus();
		alert('Please specify company');
		return false;
	}
	
	if( OBV('address') == ''){
		OB('address').focus();
		alert('Please specify address');
		return false;
	}
	
	if( OBV('telephone') == ''){
		OB('telephone').focus();
		alert('Please specify telephone');
		return false;
	}
	
	if( OBV('fax') == ''){
		OB('fax').focus();
		alert('Please specify fax');
		return false;
	}
	
	if( (OBV('email') == '') || !verifyEmail(OBV('email')) ){
		OB('email').focus();
		alert('Please specify valid email');
		return false;
	}
	
	if( OBV('comments') == '' ){
		OB('comments').focus();
		alert('Please specify comments');
		return false;
	}
	
	return true;
}