function Login(){
	if(document.frmSignup.userid.value==''){
		alert("Please enter a proper userid to login");
		document.frmSignup.userid.focus();
		return false;
	}
	if(	document.frmSignup.password.value.search(/\S/)==-1) {
		alert('Please enter password');
		document.frmSignup.password.focus();
		return false;
	}
	document.frmSignup.hidaction.value="login";
	document.frmSignup.submit();
}
function checkform(){
		if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmSignup.email_add.value)==null){
		alert("Please enter a proper email");
		document.frmSignup.email_add.focus();
		return false;
	}

	if(document.frmSignup.userid.value.search(/\S/)==-1){
		alert("Please enter your user id.");
		document.frmSignup.userid.focus();
		return false;
	}
    if(document.frmSignup.fname.value.search(/\S/)==-1){
		alert("Please enter your first name.");
		document.frmSignup.fname.focus();
		return false;
	}
	if(document.frmSignup.lname.value.search(/\S/)==-1){
		alert("Please enter your last name.");
		document.frmSignup.lname.focus();
		return false;
	}
	if(document.frmSignup.address_1.value.search(/\S/)==-1){
		alert("Please enter your address in the first address field.");
		document.frmSignup.address_1.focus();
		return false;
	}
	if(document.frmSignup.password.value.search(/\S/)==-1){
		alert("Please enter a password.");
		document.frmSignup.password.focus();
		return false;
	}
	if(document.frmSignup.password_confirm.value.search(/\S/)==-1){
		alert("Please confirm password.");
		document.frmSignup.password_confirm.focus();
		return false;
	}	
	if(document.frmSignup.password.value != document.frmSignup.password_confirm.value ){
		alert("Please enter same password.");
		document.frmSignup.password_confirm.focus();
		return false;
	}
	var pass=document.frmSignup.password.value
	if(pass.length<=5){
		alert("Password should be minimum 6 characters");
		document.frmSignup.password.focus();
		return false;
	}
	if(document.frmSignup.listed_by.value==""){
		alert("Please select Listed by.");
		document.frmSignup.listed_by.focus();
		return false;
	}
}
function checkformEdit(){
	if(document.frmSignup.userid.value.search(/\S/)==-1){
		alert("Please enter your user id.");
		document.frmSignup.userid.focus();
		return false;
	}
	if(document.frmSignup.password.value!="" || document.frmSignup.password_confirm.value!="" ){
		if(document.frmSignup.password.value != document.frmSignup.password_confirm.value ){
			alert("Please enter same password.");
			document.frmSignup.password_confirm.focus();
			return false;
		}
		var pass=document.frmSignup.password.value
		if(pass.length<=5){
		alert("Password should be minimum 6 characters");
		document.frmSignup.password.focus();
		return false;
	}

	}
    if(document.frmSignup.fname.value.search(/\S/)==-1){
		alert("Please enter your first name.");
		document.frmSignup.fname.focus();
		return false;
	}
	if(document.frmSignup.lname.value.search(/\S/)==-1){
		alert("Please enter your last name.");
		document.frmSignup.lname.focus();
		return false;
	}
	
	if(document.frmSignup.address_1.value.search(/\S/)==-1){
		alert("Please enter your address in the first address field.");
		document.frmSignup.address_1.focus();
		return false;
	}
	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmSignup.email_add.value)==null){
		alert("Please enter a proper email");
		document.frmSignup.email_add.focus();
		return false;
	}
	if(document.frmSignup.listed_by.value==""){
		alert("Please select Listed by.");
		document.frmSignup.listed_by.focus();
		return false;
	}

}
function checkformP(Frm){

    if(document.frmAddEdit.caption.value==""){
		alert("Please enter Property Caption.");
		document.frmAddEdit.caption.focus();
		return false;
	}		
    if(document.frmAddEdit.type.value==""){
		alert("Please select Property Type.");
		document.frmAddEdit.type.focus();
		return false;
	}	
    if(document.frmAddEdit.property_for.value==""){
		alert("Please select Property For Sale or Rent.");
		document.frmAddEdit.property_for.focus();
		return false;
	}		
   /* if(document.frmAddEdit.price.value==""){
		alert("Please enter Price.");
		document.frmAddEdit.price.focus();
		return false;
	}		*/
    if(document.frmAddEdit.description.value==""){
		alert("Please enter Description.");
		document.frmAddEdit.description.focus();
		return false;
	}		
    if(document.frmAddEdit.street.value==""){
		alert("Please enter Street/H.No.");
		document.frmAddEdit.street.focus();
		return false;
	}
    if(document.frmAddEdit.city.value==""){
		alert("Please enter a city.");
		document.frmAddEdit.city.focus();
		return false;
	}
    if(document.frmAddEdit.state.value==""){
		alert("Please enter a State.");
		document.frmAddEdit.state.focus();
		return false;
	}
    if(document.frmAddEdit.state.value==""){
		alert("Please enter Address.");
		document.frmAddEdit.state.focus();
		return false;
	}
	if(document.frmAddEdit.square_feet.value==""){
		alert("Please enter Area in square feet.");
		document.frmAddEdit.square_feet.focus();
		return false;
	}
	if(document.frmAddEdit.features.value==""){
		alert("Please enter Property Features.");
		document.frmAddEdit.features.focus();
		return false;
	}
return true;
}
function checkformPropAdmin(){
    if(document.frmProp.caption.value==""){
		alert("Please enter Property Caption.");
		document.frmProp.caption.focus();
		return false;
	}		
    if(document.frmProp.type.value==""){
		alert("Please select Property Type.");
		document.frmProp.type.focus();
		return false;
	}	
    if(document.frmProp.property_for.value==""){
		alert("Please select Property For Sale or Rent.");
		document.frmProp.property_for.focus();
		return false;
	}		
    /*if(document.frmProp.price.value==""){
		alert("Please enter Price.");
		document.frmProp.price.focus();
		return false;
	}	*/	
    if(document.frmProp.description.value==""){
		alert("Please enter Description.");
		document.frmProp.description.focus();
		return false;
	}		
    if(document.frmProp.street.value==""){
		alert("Please enter Street/H.No.");
		document.frmProp.street.focus();
		return false;
	}
    if(document.frmProp.city.value==""){
		alert("Please enter a city.");
		document.frmProp.city.focus();
		return false;
	}
    if(document.frmProp.state.value==""){
		alert("Please enter a State.");
		document.frmProp.state.focus();
		return false;
	}
	if(document.frmProp.area.value==""){
		alert("Please enter Area in square feet.");
		document.frmProp.area.focus();
		return false;
	}
	if(document.frmProp.features.value==""){
		alert("Please enter Property Features.");
		document.frmProp.features.focus();
		return false;
	}
	if(document.frmProp.owner.value==""){
			alert("Please enter Property Owner.");
			document.frmProp.owner.focus();
			return false;
		}
	if(document.frmProp.status.value==""){
		alert("Please enter Property Status.");
		document.frmProp.status.focus();
		return false;
	}
return true;
}
function openWindow(obj,wd,ht){

	features = "width="+wd+",height="+ht;      
	features += ",left=10,top=10,screenX=0,screenY=0,location=no,toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no";
	webwindow=window.open(obj, 'webwindow1', features);
	if (parseInt(navigator.appVersion) >= 4) { 
		webwindow.window.focus(); 
	}
}
function my_message() { 
var flg=confirm('Are you sure you want to delete this totally?\n'); 
if (flg) {return true}; 
return false;
} 
function sendMail(id){
	window.open('sendMail.php?property_id='+id,'Sendmail','toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=420,width=565,top=10,left=10');
}
function callBrochure(id){
	window.open('brochure.php?property_id='+id,'Brochure','toolbar=0,scrollbars=1,location=no,statusbar=0,menubar=0,resizable=1,height=630,width=565,top=10,left=10');
}
function change_image(pic){
document.getElementById("slide").src = pic;
}

function checkformFriend(){
	if(	document.frmMail.your_name.value.search(/\S/)==-1) {
		alert('Please provide your name');
		document.frmMail.your_name.focus();
		return false;
	}
	if(	document.frmMail.friend_name.value.search(/\S/)==-1) {
		alert('Please provide your friends name');
		document.frmMail.friend_name.focus();
		return false;
	}
	if(	document.frmMail.subject.value.search(/\S/)==-1) {
		alert('Please provide a subject');
		document.frmMail.subject.focus();
		return false;
	}
	if(	document.frmMail.message.value.search(/\S/)==-1) {
		alert('Please provide a message');
		document.frmMail.message.focus();
		return false;
	}
	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmMail.your_email.value)==null){
		alert("Please enter a proper email address");
		document.frmMail.your_email.focus();
		return false;
	}
	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmMail.friend_email.value)==null){
		alert("Please enter a proper email address for your friend");
		document.frmMail.friend_email.focus();
		return false;
	}

	document.frmMail.submit();
}
function FullScreen_go(){
    if (top.location == location) {
        top.location.href = "index.php?location=" + location;
    } 
}
function send(){
	if(	document.frmContact.fname.value.search(/\S/)==-1) {
		alert('Please provide your first name');
		document.frmContact.fname.focus();
		return false;
	}
	if(	document.frmContact.lname.value.search(/\S/)==-1) {
		alert('Please provide your last name');
		document.frmContact.lname.focus();
		return false;
	}
	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.frmContact.email.value)==null){
		alert("Please enter a proper email address");
		document.frmContact.email.focus();
		return false;
	}
return true;
}
function contact(){
	if(	document.form1.name.value.search(/\S/)==-1) {
		alert('Please provide your Name');
		document.form1.name.focus();
		return false;
	}
	if((/^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,5}$/).exec(document.form1.email.value)==null){
		alert("Please enter a proper email address");
		document.form1.email.focus();
		return false;
	}
	if(	document.form1.query.value.search(/\S/)==-1) {
		alert('Please enter your Query');
		document.form1.query.focus();
		return false;
	}
return true;
}