
function echeck(str) {
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true;				
	}


function checkcontactform(){
	var of = document.contactform;
	
	//return true;

	if(!of.name.value){
		alert('Enter a name.');
		return false;
	}
	if(!echeck(of.fromEmailAdd.value)){
		return false;
	}
	
	if(!of.phone.value){
		alert('Enter a phone.');
		return false;
	}
		
	if((document.contactform.IgnoreThisInfo1.value != document.contactform.IgnoreThisInfo2.value) || (document.contactform.IgnoreThisInfo1.value != i) || (document.contactform.IgnoreThisInfo2.value != i)){
		alert("Please validate the feedback form by typing the correct city name.");
		return false;
	}
	document.presform.loginAttempt.value="Randy-Code-Against-Robot-Spammers";
	//alert(document.presform.loginAttempt.value);
	return true;
}

function checkpropavail(){
	var of = document.propavail;
	
	//return true;

	if(!of.location.value){
		alert('Enter a location.');
		return false;
	}
	if(!of.current_occupant.value){
		alert('Enter current occupant.');
		return false;
	}
	if(!of.contact_person.value){
		alert('Enter contact_person.');
		return false;
	}
	if(!of.contact_phone_number.value){
		alert('Enter contact_phone_number.');
		return false;
	}
	if(!of.contact_email.value){
		alert('Enter contact_email.');
		return false;
	}

	return true;
}


function checkpropwanted(){
	var of = document.propwanted;
	
	//return true;

	if(!of.company_name.value){
		alert('Enter a name.');
		return false;
	}
	if(!of.company_contact.value){
		alert('Enter company_contact.');
		return false;
	}
	if(!of.company_phone_number.value){
		alert('Enter company_phone_number.');
		return false;
	}
	if(!of.company_fax_number.value){
		alert('Enter company_fax_number.');
		return false;
	}
	if(!of.company_email.value){
		alert('Enter company_email.');
		return false;
	}
	if(!of.company_zoning.value){
		alert('Enter company_zoning.');
		return false;
	}
	if(!of.company_prop_use.value){
		alert('Enter company_prop_use.');
		return false;
	}

	if(!of.building_multi_floor_rad[0].checked && !of.building_multi_floor_rad[1].checked){
		alert("Please select Can you make multiple floors work for you? buttons");
		return(false);
	}
	if(!of.electrical_service_rad[0].checked && !of.electrical_service_rad[1].checked){
		alert("Please select electrical service buttons");
		return(false);
	}
	if(!of.water_service_rad[0].checked && !of.water_service_rad[1].checked){
		alert("Please select water service buttons");
		return(false);
	}
	if(!of.gas_service_rad[0].checked && !of.gas_service_rad[1].checked){
		alert("Please select gas service buttons");
		return(false);
	}
	if(!of.rail_service_rad[0].checked && !of.rail_service_rad[1].checked){
		alert("Please select rail service buttons");
		return(false);
	}
	if(!of.fin_asis_rad[0].checked && !of.fin_asis_rad[1].checked){
		alert("Please select Financial Assistance buttons");
		return(false);
	}


	return true;
}


function checkeventregistration(){
	//return true;
	var mPrimary = document.eventregform.Event_Name.selectedIndex;
	if(!mPrimary){
		alert('Select Event.');
		return false;
	}
	if(!document.eventregform.name.value){
		alert('Enter a name.');
		return false;
	}
	if(!document.eventregform.companyname.value){
		alert('Enter a Company Name.');
		return false;
	}
	if(!document.eventregform.fromEmailAdd.value){
		alert('Enter an email.');
		return false;
	}
	if(!document.eventregform.phone.value){
		alert('Enter a phone.');
		return false;
	}
	if(!document.eventregform.name.value){
		alert('Enter a name.');
		return false;
	}
	if(!document.eventregform.name.value){
		alert('Enter a name.');
		return false;
	}
	var mPrimary = document.eventregform.payment.selectedIndex;
	if(!mPrimary){
		alert('Select Payment Method');
		return false;
	}
	return true;
}

function checkjoin1(){
	//return true;
	var mPrimary = document.join1form.MembershipLevel.selectedIndex;
	//var menuQty = document.join1form.Primary.options[mCatChosen].text;
	if(!mPrimary){
		alert('Select Membership Level');
		return false;
	}
	var mPrimary = document.join1form.EmployeesRange.selectedIndex;
	//var menuQty = document.join1form.Primary.options[mCatChosen].text;
	if(!mPrimary){
		alert('Select Employee Range');
		return false;
	}
	var mPrimary = document.join1form.Paymentmethod.selectedIndex;
	//var menuQty = document.join1form.Primary.options[mCatChosen].text;
	if(!mPrimary){
		alert('Select Payment Method');
		return false;
	}
	return true;
}


function checkjoin2(){
	var of = document.join2form;
	
	if(!of.theusername.value){
		alert('Enter a username.');
		return false;
	}
	if(!of.thepassword.value){
		alert('Enter a password and repeat password, CaSe sensitive,.');
		return false;
	}
	if(of.thepassword.value != of.thepassword1.value){
		alert('Passwords must match and are CaSe sensitive.');
		return false;
	}
	if(of.thepassword.value.length <= 5){
		alert('Passwords must be at least 6 characters.');
		return false;
	}


	if(!of.BusinessName1.value){
		alert('Enter a company Name1.');
		return false;
	}
	if(!of.BusinessAddress1.value){
		alert('Enter a Business Address1.');
		return false;
	}
	if(!of.BusinessCity.value){
		alert('Enter a BusinessCity.');
		return false;
	}
	if(!of.BusinessState.value){
		alert('Enter a BusinessState.');
		return false;
	}
	if(!of.BusinessZip.value){
		alert('Enter a BusinessZip.');
		return false;
	}
	if(!of.BusinessPhone.value){
		alert('Enter a BusinessPhone.');
		return false;
	}


	if(!of.FirstName.value){
		alert('Enter a First Name.');
		return false;
	}
	if(!of.LastName.value){
		alert('Enter a Last Name.');
		return false;
	}
	
	if(!echeck(of.PreferredEmail.value)){
		return false;
	}
	
	return true;
}


function checkresumeupload(){
	//return true;
	if(!document.resumeuploadform.resume_firstlast.value){
		alert('Enter a first name.');
		return false;
	}
	var mPrimary = document.resumeuploadform.resume_category.selectedIndex;
	if(!mPrimary){
		alert('Select a resume category.');
		return false;
	}
	if(!document.resumeuploadform.resume_summary.value){
		alert('Enter a resume summary.');
		return false;
	}
	if(!document.resumeuploadform.FiletoUpload.value.length){
		alert('Select a PDF');
		return false;
	}
	return true;
}


function selectvideo(thevideo){

	if(thevideo == "intromap"){
		frames['theframe'].location.href = 'videos/Steve_Welcome.html';
		return false;
	}
	if(thevideo == "whymap"){
		frames['theframe'].location.href = 'videos/WhyMap.html';
		return false;
	}
	if(thevideo == "rosania"){
		frames['theframe'].location.href = 'videos/Rosania.html';
		return false;
	}
	if(thevideo == "savage"){
		frames['theframe'].location.href = 'videos/Savage.html';
		return false;
	}
	if(thevideo == "windle"){
		frames['theframe'].location.href = 'videos/Windle.html';
		return false;
	}
}


function checkJoinInfo(){
	return true;
	
	if(!document.entryform.FirstName.value){
		alert('Enter a first name.');
		return false;
	}
	if(!document.entryform.LastName.value){
		alert('Enter a last name.');
		return false;
	}
	if(!document.entryform.PreferredEmail.value){
		alert('Enter your email address.');
		return false;
	}
	
	var mPrimary = document.entryform.Primary.selectedIndex;
	//var menuQty = document.entryform.Primary.options[mCatChosen].text;
	if(!mPrimary){
		alert('Select a Professional Discipline.');
		return false;
	}
	if(!document.entryform.College.value){
		alert('Enter your college.');
		return false;
	}
	if(!document.entryform.CollageGradYear.value){
		alert('Enter your college graduation year.');
		return false;
	}
	if(!document.entryform.PreferredEmail.value){
		alert('Enter your email address.');
		return false;
	}
	if(!document.entryform.thepassword.value || !document.entryform.thepassword1.value){
		alert('Enter a password and repeat password, CaSe sensitive,.');
		return false;
	}
	if(document.entryform.thepassword.value != document.entryform.thepassword1.value){
		alert('Passwords must match and are CaSe sensitive.');
		return false;
	}
	if(document.entryform.thepassword.value.length <= 5){
		alert('Passwords must be at least 6 characters.');
		return false;
	}
	if(!document.entryform.secureque.selectedIndex){
		alert('Please select a security question.');
		return false;
	}
	if(!document.entryform.secureans.value){
		alert('Please enter a security answer.');
		return false;
	}
	if(!document.entryform.AcceptTCjoin.checked){
		alert('You must accept the 1000 Years of Osteopathy Practitioner Finder database listing Practitioner agreement to Join.');
		return false;
	}
	return true;
}


function clearit(){
	document.newsform.joinemail.value="";
	//alert("init");
}
function checkInfo(){
	//alert(document.bbb.CompNameSrch.value);
	if(document.bbb.CompNameSrch.value == ""){
		alert('Enter a search term...it can be company name or product/service.');
		return false;
	}	
	if(document.bbb.CompNameSrch.value == "enter a company name or product"){
		document.bbb.CompNameSrch.value = "";
	}	
	return true;  //cause blank gives all results
	
}

function checkReg1Info(){
	if(!document.form_registration.regPassword.value || !document.form_registration.regPassword2.value){
		alert('Enter a password and repeat password, CaSe sensitive,.');
		return false;
	}
	if(document.form_registration.regPassword.value != document.form_registration.regPassword2.value){
		alert('Passwords must match and are CaSe sensitive.');
		return false;
	}
	if(document.form_registration.regPassword.value.length <= 5){
		alert('Passwords must be at least 6 characters.');
		return false;
	}
	
	if(!document.form_registration.regFirstName.value){
		alert('Enter a first name.');
		return false;
	}
	if(!document.form_registration.regLastName.value){
		alert('Enter a last name.');
		return false;
	}

	if(!echeck(document.form_registration.regEmailAdd.value)){
		return false;
	}
	
	if(!document.form_registration.regPhoneNo.value){
		alert('Enter your phone number.');
		return false;
	}
	
	if(!document.form_registration.regServiceDesc.value){
		alert('Enter the reason for your request.');
		return false;
	}
	return true;
}


function checkLoginInfo(){
	//alert("checkLoginInfo");
	if(!document.loginform.theusername.value){
		alert('Enter a username.');
		return false;
	}
	if(!document.loginform.thepassword.value){
		alert('Enter a password.');
		return false;
	}
	return true;
}


