function searchfrm()
{
	if(document.frm2.name.value=='')
	{
		alert("Please Enter Search Keyword!");
		document.frm2.name.focus();
		return false;
	}
}
function searchCity()
{
	if(document.city.location.value=='')
	{
		alert('Please Select City!');
		document.city.location.focus();
		return false;
	}
}
function searchAdvance()
{
	if(document.advanceSearch.name.value=='')
	{
		alert('Please Enter Name!');
		document.advanceSearch.name.focus();
		return false;
	}
}
function guestLogin()
{
	if(document.guest.email.value=='')
	{ 
		alert('Please Enter Login(Email) Id!');
		document.guest.email.focus();
		return false;
	}
	var checkEmail="@.";var checkStr=document.guest.email.value;var EmailValid=false;0000000000
	var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
	{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
	{if(ch==checkEmail.charAt(j)&&ch=="@")
	EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
	EmailPeriod=true;if(EmailAt&&EmailPeriod)
	break;if(j==checkEmail.length)
	break;}
	if(EmailAt&&EmailPeriod)
	{EmailValid=true
	break;}}
	if(!EmailValid)
	{alert("Invalid email ID ! Please enter your valid email ID.");document.guest.email.focus();document.guest.email.value='';return(false);}
}
function toggleOption(spanChk)
{var xState=spanChk.checked;var theBox=spanChk;elm=theBox.form.elements;for(i=0;i<elm.length;i++)
{if(elm[i].type=="checkbox"&&elm[i].id!=theBox.id)
{if(xState==false)
elm[i].checked=false;else
elm[i].checked=true;}}}
function implodearr($idarr)
{if(count($idarr)>0)
{if(is_array($idarr))
{$id=implode(',',$idarr);}
return $id;}
else
{$_SESSION['message']="Please  Select at least one Option.";header("location:$_SERVER[HTTP_REFERER]");exit;}}
function forgotpassword()
{if(document.frmf.email.value=="")
{alert("Please enter a value for the \"Email\" field.");document.frmf.email.focus();return(false);}
var checkEmail="@.";var checkStr=document.frmf.email.value;var EmailValid=false;0000000000
var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
{if(ch==checkEmail.charAt(j)&&ch=="@")
EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
EmailPeriod=true;if(EmailAt&&EmailPeriod)
break;if(j==checkEmail.length)
break;}
if(EmailAt&&EmailPeriod)
{EmailValid=true
break;}}
if(!EmailValid)
{alert("Invalid email ID ! Please enter your valid email ID.");document.frmf.email.focus();return(false);}
return true;}

function deleteImage(imageName,type)
{var Del=window.confirm("Are you sure to delete image?");if(Del)
{window.location="process.php?photo="+imageName+"&field="+type+"&DELETEIMAGE=DELETEIMAGE";return true;}
else
{return false;}}
function delmsg(id)
{var m=window.confirm("Are you sure to delete message?");if(m)
{window.location="process.php?message_id="+id+"&DELETEMSG=DELETEMSG";return true;}
else
{return false;}}
function deleteMember(member_id)
{var m=window.confirm("Are you sure to delete member?");if(m)
{window.location="process.php?member_id="+member_id+"&DELETEMEMBER=DELETEMEMBER";return true;}
else
{return false;}}
function deleteUser()
{var m=window.confirm("Are you sure to delete your profile?");if(m)
{window.location="process.php?DELETEPROFILE=DELETEPROFILE";return true;}
else
{return false;}}
function checkfile1()
{if(document.frm1.file.value=="")
{alert("Please Select File to upload.");document.frm1.file.focus();return false;}
return true;}
function checkfile2()
{if(document.frm2.file.value=="")
{alert("Please Select File to upload.");document.frm2.file.focus();return false;}
return true;}
function checkfile3()
{if(document.frm3.file.value=="")
{alert("Please Select File to upload.");document.frm3.file.focus();return false;}
return true;}
function checkfile4()
{if(document.frm4.file.value=="")
{alert("Please Select File to upload.");document.frm4.file.focus();return false;}
return true;}
function checkfile5()
{if(document.frm5.file.value=="")
{alert("Please Select File to upload.");document.frm5.file.focus();return false;}
return true;}
function checkfile6()
{if(document.frm6.file.value=="")
{alert("Please Select File to upload.");document.frm6.file.focus();return false;}
return true;}
function checkfile7()
{if(document.frm7.file.value=="")
{alert("Please Select File to upload.");document.frm7.file.focus();return false;}
return true;}
function checkfile8()
{if(document.frm8.file.value=="")
{alert("Please Select File to upload.");document.frm8.file.focus();return false;}
return true;}
function checkfile9()
{if(document.frm9.file.value=="")
{alert("Please Select File to upload.");document.frm9.file.focus();return false;}
return true;}
function checkfile10()
{if(document.frm10.file.value=="")
{alert("Please Select File to upload.");document.frm10.file.focus();return false;}
return true;}
function checkform()
{if(document.frm1.email.value=="")
{alert("Please Enter login(Email) Id!");document.frm1.email.focus();return(false);}
var checkEmail="@.";var checkStr=document.frm1.email.value;var EmailValid=false;0000000000
var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
{if(ch==checkEmail.charAt(j)&&ch=="@")
EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
EmailPeriod=true;if(EmailAt&&EmailPeriod)
break;if(j==checkEmail.length)
break;}
if(EmailAt&&EmailPeriod)
{EmailValid=true
break;}}
if(!EmailValid)
{alert("Invalid email ID ! Please enter your valid email ID.");document.frm1.email.focus();document.frm1.email.value='';return(false);}
if(document.frm1.password.value=="")
{alert("Please Enter Password");document.frm1.password.focus();return false;}
return true;}
function checkformleft()
{if(document.frm2.email.value=="")
{alert("Please enter a value for the \"Email\" field.");document.frm2.email.focus();return(false);}
var checkEmail="@.";var checkStr=document.frm2.email.value;var EmailValid=false;0000000000
var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
{if(ch==checkEmail.charAt(j)&&ch=="@")
EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
EmailPeriod=true;if(EmailAt&&EmailPeriod)
break;if(j==checkEmail.length)
break;}
if(EmailAt&&EmailPeriod)
{EmailValid=true
break;}}
if(!EmailValid)
{alert("Invalid email ID ! Please enter your valid email ID.");document.frm2.email.focus();return(false);}
if(document.frm2.password.value=="")
{alert("Please Enter Password");document.frm2.password.focus();return false;}
return true;}
function contactUs()
{if(document.contact.name_fld.value=='')
{alert("Please Enter Name.");document.contact.name_fld.focus();return false;}
if(document.contact.email_fld.value=='')
{alert("Please Enter Email.");document.contact.email_fld.focus();return false;}
var checkEmail="@.";var checkStr=document.contact.email_fld.value;var EmailValid=false;0000000000
var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
{if(ch==checkEmail.charAt(j)&&ch=="@")
EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
EmailPeriod=true;if(EmailAt&&EmailPeriod)
break;if(j==checkEmail.length)
break;}
if(EmailAt&&EmailPeriod)
{EmailValid=true
break;}}
if(!EmailValid)
{alert("Invalid email ID ! Please enter your valid email ID.");document.contact.email_fld.focus();document.contact.email_fld.value='';return(false);}
if(document.contact.phone_fld.value=='')
{alert("Please Enter Phone No.");document.contact.phone_fld.focus();return false;}
var y=document.contact.phone_fld.value;if(isNaN(y)||y.indexOf(" ")!=-1)
{alert("Enter Phone no in numeric value");document.contact.phone_fld.value="";document.contact.phone_fld.focus();return false;}
if(document.contact.message.value=='')
{alert("Please Enter message.");document.contact.message.focus();return false;}}
function report()
{if(document.reporting.subject.value=='')
{alert("Please Enter Subject.");document.reporting.subject.focus();return false;}
if(document.reporting.top.value=='')
{alert("Please Enter Value from Select Box.");document.reporting.top.focus();return false;}
if(document.reporting.message.value=='')
{alert("Please Enter Messages.");document.reporting.message.focus();return false;}}
function userRegValidation()
{if(document.frm3.usertype.selectedIndex==0)
{alert("Please select your type.");document.frm3.usertype.focus();return(false);}
if(document.frm3.username.value=="")
{alert("User Name must not be blank");document.frm3.username.focus();return false;}
if(document.frm3.password.value.length<5)
{alert("Password must be 5 characters long");document.frm3.password.focus();return false;}
if(document.frm3.password.value!=document.frm3.repassword.value)
{alert("Password does not match");document.frm3.password.focus();return false;}
if(document.frm3.name.value=="")
{alert("Please enter Name.");document.frm3.name.focus();return(false);}
if(document.frm3.email.value=="")
{alert("Please enter a value for the \"Email\" field.");document.frm3.email.focus();return(false);}
var checkEmail="@.";var checkStr=document.frm3.email.value;var EmailValid=false;0000000000
var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
{if(ch==checkEmail.charAt(j)&&ch=="@")
EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
EmailPeriod=true;if(EmailAt&&EmailPeriod)
break;if(j==checkEmail.length)
break;}
if(EmailAt&&EmailPeriod)
{EmailValid=true
break;}}
if(!EmailValid)
{alert("Invalid email ID ! Please enter your valid email ID.");document.frm3.email.focus();return(false);}
if(document.frm.state_id.selectedIndex==0)
{alert("Please select your state.");document.frm.state_id.focus();return(false);}
var checkAddr=Trim(document.frm.address1.value);document.frm.address1.value=checkAddr;if(document.frm.address1.value==""&&document.frm.address2.value=="")
{alert("Please provide your address");document.frm.address1.focus();return false;}
if(document.frm.mobile.value=="")
{alert("Please provide your mobile number");document.frm.mobile.focus();return false;}
var y=document.frm.mobile.value;if(isNaN(y)||y.indexOf(" ")!=-1)
{alert("Enter Mobile no in numeric value");document.frm.mobile.value="";document.frm.mobile.focus();return false;}
if(y.length>10||y.length<=9)
{alert("Enter Mobile no in 10 digits.");document.frm.mobile.focus();return false;}
return true;}
function userRegValidationRight()
{if(document.frm4.usertype.selectedIndex==0)
{alert("Please select your type.");document.frm4.usertype.focus();return(false);}
if(document.frm4.username.value=="")
{alert("User Name must not be blank");document.frm4.username.focus();return false;}
if(document.frm4.password.value.length<5)
{alert("Password must be 5 characters long");document.frm4.password.focus();return false;}
if(document.frm4.password.value!=document.frm4.repassword.value)
{alert("Password does not match");document.frm4.password.focus();return false;}
if(document.frm4.membershiptype.selectedIndex==0)
{alert("Please select Membership.");document.frm4.membershiptype.focus();return(false);}
if(document.frm4.name.value=="")
{alert("Please enter Name.");document.frm4.name.focus();return(false);}
if(document.frm4.email.value=="")
{alert("Please enter a value for the \"Email\" field.");document.frm4.email.focus();return(false);}
var checkEmail="@.";var checkStr=document.frm4.email.value;var EmailValid=false;0000000000
var EmailAt=false;var EmailPeriod=false;for(i=0;i<checkStr.length;i++)
{ch=checkStr.charAt(i);for(j=0;j<checkEmail.length;j++)
{if(ch==checkEmail.charAt(j)&&ch=="@")
EmailAt=true;if(ch==checkEmail.charAt(j)&&ch==".")
EmailPeriod=true;if(EmailAt&&EmailPeriod)
break;if(j==checkEmail.length)
break;}
if(EmailAt&&EmailPeriod)
{EmailValid=true
break;}}
if(!EmailValid)
{alert("Invalid email ID ! Please enter your valid email ID.");document.frm4.email.focus();return(false);}
if(document.frm4.location.value=="")
{alert("Please enter your location.");document.frm4.location.focus();return(false);}
if(document.frm4.country_code.selectedIndex==0)
{alert("Please select your country.");document.frm4.country_code.focus();return(false);}
if(document.frm4.contact.value=="")
{alert("Contact Number must not be blank");document.frm4.contact.focus();return false;}
if(document.frm4.certify.checked==false)
{alert("Pls. select the box  to accept the Terms and Conditions of Services provided .");document.frm4.certify.focus();return(false);}
var checkAddr=Trim(document.frm.address1.value);document.frm.address1.value=checkAddr;if(document.frm.address1.value==""&&document.frm.address2.value=="")
{alert("Please provide your address");document.frm.address1.focus();return false;}
if(document.frm.mobile.value=="")
{alert("Please provide your mobile number");document.frm.mobile.focus();return false;}
var y=document.frm.mobile.value;if(isNaN(y)||y.indexOf(" ")!=-1)
{alert("Enter Mobile no in numeric value");document.frm.mobile.value="";document.frm.mobile.focus();return false;}
if(y.length>10||y.length<=9)
{alert("Enter Mobile no in 10 digits.");document.frm.mobile.focus();return false;}
return true;}
function valDelHistory(theForm)
{var filledIn=false;for(var counter=0;counter<theForm.del.length;counter++)
if(theForm.del[counter].checked==true){filledIn=true;if(theForm.del.checked==true){filledIn=true;}}

if(filledIn==false){alert('Please select a listing to delete!');return(false);}
return(true);}

