function CheckSearch() {

	if(document.f1.what.value=="")
	{
		window.alert('Enter the search criteria, please!');
		document.f1.what.focus();
		return false;
	}


}

function SanitizeSearch() 
{
var illegalChars = /[()><=&]/;
// sanitizes form input



    if (illegalChars.test(document.SearchForm.kw.value))
	{
		window.alert('Please enter a search with valid characters.');
		document.SearchForm.kw.focus();
		return false;
	}

}



function SanitizeComments() 
{
var illegalChars = /[()><=&]/;
// sanitizes form input

    if (illegalChars.test(document.CommentsForm.message.value))
	{
		window.alert('You have entered invalid characters. Please try again');
		document.CommentsForm.message.focus();
		return false;
	}

}



function CheckFriend() {

	if(document.sfriend.f1.value=="")
	{
		window.alert('Enter your email address!');
		document.sfriend.f1.focus();
		return false;
	}

	if(document.sfriend.f2.value=="")
	{
		window.alert('Enter your friend email address!');
		document.sfriend.f2.focus();
		return false;
	}

}

function CheckLogin() {

var illegalChars = /[()><=&]/;
// sanitizes form input

	if(document.lform.us.value=="")
	{
		window.alert('Enter your username, please!');
		document.lform.us.focus();
		return false;
	}


    if (illegalChars.test(document.lform.us.value))
	{
		window.alert('You have entered invalid characters. Please try again');
		document.lform.us.focus();
		return false;
	}


	if(document.lform.ps.value=="")
	{
		window.alert('Enter your password, please!');
		document.lform.ps.focus();
		return false;
	}



    if (illegalChars.test(document.lform.ps.value))
	{
		window.alert('You have entered invalid characters. Please try again');
		document.lform.ps.focus();
		return false;
	}

}

function CheckForgot() {

	if(document.ForgotForm.u2.value=="")
	{
		window.alert('Enter your username, please!');
		document.ForgotForm.u2.focus();
		return false;
	}
}

function CheckRegister() {

var illegalChars = /[()><=&]/;
// sanitizes form input

 


	if(document.RegForm.NewUsername.value=="")
	{
		window.alert('Enter your username, please!');
		document.RegForm.NewUsername.focus();
		return false;
	}

    if (illegalChars.test(document.RegForm.NewUsername.value))
	{
		window.alert('Please enter a username with valid characters.');
		document.RegForm.NewUsername.focus();
		return false;
	}

	if(document.RegForm.p1.value=="")
	{
		window.alert('Enter your password, please!');
		document.RegForm.p1.focus();
		return false;
	}

    if (illegalChars.test(document.RegForm.p1.value))
	{
		window.alert('Please enter a password with valid characters.');
		document.RegForm.p1.focus();
		return false;
	}

	if(document.RegForm.p2.value=="")
	{
		window.alert('Confirm your password, please!');
		document.RegForm.p2.focus();
		return false;
	}

    if (illegalChars.test(document.RegForm.p2.value))
	{
		window.alert('Please enter a password with valid characters.');
		document.RegForm.p2.focus();
		return false;
	}

	if(document.RegForm.p1.value != "" && document.RegForm.p2.value != "" && document.RegForm.p1.value != document.RegForm.p2.value)
	{
		window.alert('Enter and confirm your password again!');
		document.RegForm.p1.value="";
		document.RegForm.p2.value="";
		document.RegForm.p1.focus();
		return false;
	}
/*
	if(document.RegForm.Manager.value=="")
	{
		window.alert('Enter your Manager name, please!');
		document.RegForm.Manager.focus();
		return false;
	}
*/
	if(document.RegForm.primary_specialty.value=="")
	{
		window.alert('Select your primary specialty, please!');
		document.RegForm.primary_specialty.focus();
		return false;
	}

	if(document.RegForm.FirstName.value=="")
	{
		window.alert('Enter your Company Name, please!');
		document.RegForm.FirstName.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.FirstName.value))
	{
		window.alert('Please enter a comapny with valid characters.');
		document.RegForm.FirstName.focus();
		return false;
	}

	if(document.RegForm.LastName.value=="")
	{
		window.alert('Enter your Last Name, please!');
		document.RegForm.LastName.focus();
		return false;
	}

	if(document.RegForm.address.value=="")
	{
		alert('Enter your address, please!');
		document.RegForm.address.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.address.value))
	{
		window.alert('Please enter a address with valid characters.');
		document.RegForm.address.focus();
		return false;
	}


	if(document.RegForm.city.value=="")
	{
		alert('Enter your city, please!');
		document.RegForm.city.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.city.value))
	{
		window.alert('Please enter a city with valid characters.');
		document.RegForm.city.focus();
		return false;
	}


	if(document.RegForm.state.value=="")
	{
		alert('Enter your state, please!');
		document.RegForm.state.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.state.value))
	{
		window.alert('Please enter a state with valid characters.');
		document.RegForm.state.focus();
		return false;
	}


/*
	if(document.RegForm.country.value=="")
	{
		alert('Select your country, please!');
		document.RegForm.country.focus();
		return false;
	}
*/


	if(document.RegForm.phone.value=="")
	{
		window.alert('Enter your Phone, please!');
		document.RegForm.phone.focus();
		return false;
	}




     // Check for correct phone number
     rePhoneNumber = new RegExp(/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/);
 
	if (!rePhoneNumber.test(document.RegForm.phone.value))
	{
          alert("Phone Number Must Be Entered As: (555) 555-1234");
	  document.RegForm.phone.focus();
          return false;
    	}

/* 

   	if (illegalCharsphone.test(document.RegForm.phone.value))
	{
		window.alert('Please enter a phone with valid characters.');
		document.RegForm.phone.focus();
		return false;
	}

*/


	
	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.email.value)))
	{
		alert("Invalid E-mail Address! Please re-enter.");
		document.RegForm.email.focus();
		return false;
	}

return true;
	
	
	
}

function CheckProfile() {

var illegalChars = /[()><=]/;
// sanitizes form input


	if(document.RegForm.p1.value=="")
	{
		window.alert('Enter your password, please!');
		document.RegForm.p1.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.p1.value))
	{
		window.alert('Please enter a password with valid characters.');
		document.RegForm.p1.focus();
		return false;
	}

	if(document.RegForm.p2.value=="")
	{
		window.alert('Confirm your password, please!');
		document.RegForm.p2.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.p2.value))
	{
		window.alert('Please enter a password with valid characters.');
		document.RegForm.p2.focus();
		return false;
	}

	if(document.RegForm.p1.value != "" && document.RegForm.p2.value != "" && document.RegForm.p1.value != document.RegForm.p2.value)
	{
		window.alert('Enter and confirm your password again!');
		document.RegForm.p1.value="";
		document.RegForm.p2.value="";
		document.RegForm.p1.focus();
		return false;
	}

	if(document.RegForm.FirstName.value=="")
	{
		window.alert('Enter your Company Name, please!');
		document.RegForm.FirstName.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.FirstName.value))
	{
		window.alert('Please enter a company name with valid characters.');
		document.RegForm.FirstName.focus();
		return false;
	}

	if(document.RegForm.LastName.value=="")
	{
		window.alert('Enter your Last Name, please!');
		document.RegForm.LastName.focus();
		return false;
	}

	if(document.RegForm.address.value=="")
	{
		alert('Enter your address, please!');
		document.RegForm.address.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.address.value))
	{
		window.alert('Please enter an address with valid characters.');
		document.RegForm.address.focus();
		return false;
	}

	if(document.RegForm.city.value=="")
	{
		alert('Enter your city, please!');
		document.RegForm.city.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.city.value))
	{
		window.alert('Please enter a city with valid characters.');
		document.RegForm.city.focus();
		return false;
	}

	if(document.RegForm.state.value=="")
	{
		alert('Enter your state, please!');
		document.RegForm.state.focus();
		return false;
	}

   	if (illegalChars.test(document.RegForm.state.value))
	{
		window.alert('Please enter a state with valid characters.');
		document.RegForm.state.focus();
		return false;
	}





	if(document.RegForm.phone.value=="")
	{
		window.alert('Enter your Phone, please!');
		document.RegForm.phone.focus();
		return false;
	}





     // Check for correct phone number
     rePhoneNumber = new RegExp(/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/);
 
	if (!rePhoneNumber.test(document.RegForm.phone.value))
	{
          alert("Phone Number Must Be Entered As: (555) 555-1234");
	  document.RegForm.phone.focus();
          return false;
    	}

/* 

   	if (illegalChars.test(document.RegForm.phone.value))
	{
		window.alert('Please enter a phone with valid characters.');
		document.RegForm.phone.focus();
		return false;
	}

*/



	if(!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.RegForm.email.value)))
	{
		alert("Invalid E-mail Address! Please re-enter.");
		document.RegForm.email.focus();
		return false;
	}







   	if (illegalChars.test(document.RegForm.website.value))
	{
		window.alert('Please enter a web site with valid characters.');
		document.RegForm.phone.focus();
		return false;
	}



   	if (illegalChars.test(document.RegForm.medical_school.value))
	{
		window.alert('Please enter hours with valid characters.');
		document.RegForm.phone.focus();
		return false;
	}


   	if (illegalChars.test(document.RegForm.Description.value))
	{
		window.alert('Please enter your description with valid characters.');
		document.RegForm.phone.focus();
		return false;
	}







return true;



}

function CheckTestimonial() {

	if(document.t1.testimonial_name.value=="")
	{
		alert('Enter your name, please!');
		document.t1.testimonial_name.focus();
		return false;
	}

	if(document.t1.testimonial_text.value=="")
	{
		alert('Enter your testimonial, please!');
		document.t1.testimonial_text.focus();
		return false;
	}

}