//Login Box Validation Str
function login()
{
	var msg='';
	if(document.frm.username.value=="")
	{
		msg+="Email Id / User Id"+"\n";
	}
		if(document.frm.username.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm.username.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Email-ID'+"\n";
		}
	}
		if(document.frm.pwd.value=="")
	{
		msg+="Password "+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Login Box Validation End
//Login Box Validation Str
function login1()
{
	var msg='';

	if(document.frm.username.value=="")
	{
		msg+="Email Id / User Id"+"\n";
	}
		if(document.frm.username.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm.username.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Email-ID'+"\n";
		}
	}
		if(document.frm.pwd.value=="")
	{
		msg+="Password "+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Login Box Validation End
//Password validation//
function forgotPassword()
{
	var msg='';

	if(document.forgot.eid.value=="")
	{
		msg+="Enter your email address"+"\n";
	}
		if(document.forgot.eid.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.forgot.eid.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid email address'+"\n";
		}
	}
		if(document.forgot.reeid.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.forgot.reeid.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Re-Type email address'+"\n";
		}
	}
	var mailid1='';
	var mailid2='';
	mailid1=document.forgot.eid.value;
	mailid2=document.forgot.reeid.value;
	if(mailid1!=mailid2)
	{
		msg+="Your E-Mail and Re-type E-Mail must be same"+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}


//Password validation

//Contact Form Str
function contactFrm(){
var msg='';

	if(document.cntfrm.cnt_name.value=="")
	{
		msg+="Your Name"+"\n";
	}
	if(document.cntfrm.cnt_name.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.cntfrm.cnt_name.value.indexOf(".")==0) || (document.cntfrm.cnt_name.value.indexOf(" ")==0)) 
		{
		alert("First character of Your Name should be alphabet character");
		}
		else if(regnext.test(document.cntfrm.cnt_name.value) == false)
		{	
		alert("Your Name should be alphabet character");
		return false
		}
   }
		if(document.cntfrm.cnt_no.value=="")
	{
		msg+="Contact No"+"\n";
	}
		if(document.cntfrm.cnt_email.value=="")
	{
		msg+="Email ID"+"\n";
	}
	if(document.cntfrm.cnt_email.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.cntfrm.cnt_email.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Email-ID'+"\n";
		}
	}
		if(document.cntfrm.comments.value=="")
	{
		msg+="Comments"+"\n";
	}
			if(document.cntfrm.STI_imgString.value=="")
	{
		msg+="Type the letters shown"+"\n";
	}
	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
	}
//Contact Form End

//Property Sale Contact Str
function adcontactFrm(){
var msg='';
		if(document.frm4.urname.value=="")
	{
		msg+="Your Name"+"\n";
	}
		if(document.frm4.urname.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.frm4.urname.value.indexOf(".")==0) || (document.frm4.urname.value.indexOf(" ")==0)) 
		{
		alert("First character of Your Name should be alphabet character");
		}
		else if(regnext.test(document.frm4.urname.value) == false)
		{	
		alert("Your Name should be alphabet character");
		return false
		}
   }
			if(document.frm4.cnt_no.value=="")
	{
		msg+="Contact No"+"\n";
	}
			if(document.frm4.email.value=="")
	{
		msg+="Your E-Mail ID"+"\n";
	}
	if(document.frm4.email.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm4.email.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Email-ID'+"\n";
		}
	}
			if(document.frm4.message.value=="")
	{
		msg+="Message"+"\n";
	}
	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Property Sale Contact End

//Property Rent Contact Str
function rentContact(){
var msg='';
		if(document.rentcntfrm.yourname.value=="")
	{
		msg+="Your Name"+"\n";
	}
		if(document.rentcntfrm.yourname.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.rentcntfrm.yourname.value.indexOf(".")==0) || (document.rentcntfrm.yourname.value.indexOf(" ")==0)) 
		{
		alert("First character of Your Name should be alphabet character");
		}
		else if(regnext.test(document.rentcntfrm.yourname.value) == false)
		{	
		alert("Your Name should be alphabet character");
		return false
		}
   }
			if(document.rentcntfrm.cnt_no.value=="")
	{
		msg+="Contact No"+"\n";
	}
			if(document.rentcntfrm.email.value=="")
	{
		msg+="Your E-Mail ID"+"\n";
	}
	if(document.rentcntfrm.email.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.rentcntfrm.email.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Email-ID'+"\n";
		}
	}
			if(document.rentcntfrm.message.value=="")
	{
		msg+="Message"+"\n";
	}
	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Property Rent Contact End

//Registration

function regist(va){
var msg='';

	if(document.frm2.pasW.value=="")
	{
		msg+="Password "+"\n";
	}
		if((document.frm2.pasW.value!="") && (document.frm2.pasW.value.length<6))
	{
			msg+="Password should be minimum 6 characters"+"\n";
	}
	if((document.frm2.pasW.value!="") && (document.frm2.pasW.value.length>16))
	{
		message+="Password should be maximum sixteen characters"+"\n";
	}
	var pass1='';
	var pass2='';
	pass1=document.frm2.pasW.value;
	pass2=document.frm2.cnfpasW.value;
	if(pass1!=pass2)
	{
		msg+="Password and Confirm Password must be same"+"\n";
	}
	if(document.frm2.appt_no.value==""){
	msg+='Apartment No'+"\n";
	}
	if(document.frm2.salute.value==""){
	msg+='Salute of your Name'+"\n";
	}
		if(document.frm2.uname.value=="")
	{
		msg+="Your Name"+"\n";
	}
		if(document.frm2.uname.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.frm2.uname.value.indexOf(".")==0) || (document.frm2.uname.value.indexOf(" ")==0)) 
		{
		msg+="First character of Your Name should be alphabet character"+"\n";
		}
		else if(regnext.test(document.frm2.uname.value) == false)
		{	
		msg+="Your Name should be alphabet character"+"\n";
		}
   }
		if(document.frm2.address1.value=="")
	{
		msg+="Address "+"\n";
	}
		if(document.frm2.mobile11.value=="")
	{
		msg+="Mobile "+"\n";
	}
		if(document.frm2.mobile11.value.length<10)
	{
		msg+="Mobile Number should be greater than 10 "+"\n";
	}
			if(document.frm2.altemail.value!="")
	{
		//***** included on 26-03-09   $2018
		 var reg = /^([A-Za-z0-9_\-])+([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		 var address = document.frm2.altemail.value;
		 if(reg.test(address) == false) 
		 {
			  msg+="Enter valid Alternate E-Mail Id"+"\n";
		  }
		  //***** included on 26-03-09   $2018

		/*var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm2.altemail.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Alternate E-Mail Id'+"\n";
		}*/
	}

	var mailid1='';
	var altmailid1='';
	mailid1=document.frm2.emailid.value;
	altmailid1=document.frm2.altemail.value;
	if(document.frm2.altemail.value!="")
	{
	if(mailid1==altmailid1)
	{
		msg+="E-Mail ID and Alternate E-Mail ID must not be same"+"\n";
	}
	}
		 if(document.frm2.busemail.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm2.busemail.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Business E-Mail Id'+"\n";
		}
	}

	//owner validation

    if(document.frm2.memphoto.value!="")
	{
		 var ima1=document.frm2.memphoto.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n";
		 		 }					 
		 }  
	}   

	//member2 validation
	if(document.frm2.member2.value!=""){
	 if(document.frm2.relation2.value==""){
	 msg+='Relationship for Member2'+"\n";
	 }
    if(document.frm2.memphoto2.value!="")
	{
		 var ima1=document.frm2.memphoto2.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}

	//member3 validation
	if(document.frm2.member3.value!=""){
	 if(document.frm2.relation3.value==""){
	 msg+='Relationship for Member3'+"\n";
	 }
    if(document.frm2.memphoto3.value!="")
	{
		 var ima1=document.frm2.memphoto3.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member4 validation
	if(document.frm2.member4.value!=""){
	 if(document.frm2.relation4.value==""){
	 msg+='Relationship for Member4'+"\n";
	 }
    if(document.frm2.memphoto4.value!="")
	{
		 var ima1=document.frm2.memphoto4.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member5 validation
	if(document.frm2.member5.value!=""){
	 if(document.frm2.relation5.value==""){
	 msg+='Relationship for Member5'+"\n";
	 }
    if(document.frm2.memphoto5.value!="")
	{
		 var ima1=document.frm2.memphoto5.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member6 validation
	if(document.frm2.member6.value!=""){
	 if(document.frm2.relation6.value==""){
	 msg+='Relationship for Member6'+"\n";
	 }
    if(document.frm2.memphoto6.value!="")
	{
		 var ima1=document.frm2.memphoto6.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member7 validation
	if(document.frm2.member7.value!=""){
	 if(document.frm2.relation7.value==""){
	 msg+='Relationship for Member7'+"\n";
	 }
    if(document.frm2.memphoto7.value!="")
	{
		 var ima1=document.frm2.memphoto7.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member8 validation
	if(document.frm2.member8.value!=""){
	 if(document.frm2.relation8.value==""){
	 msg+='Relationship for Member8'+"\n";
	 }
    if(document.frm2.memphoto8.value!="")
	{
		 var ima1=document.frm2.memphoto8.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member9 validation
	if(document.frm2.member9.value!=""){
	 if(document.frm2.relation9.value==""){
	 msg+='Relationship for Member9'+"\n";
	 }
    if(document.frm2.memphoto9.value!="")
	{
		 var ima1=document.frm2.memphoto9.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member10 validation
	if(document.frm2.member10.value!=""){
	 if(document.frm2.relation10.value==""){
	 msg+='Relationship for Member10'+"\n";
	 }
    if(document.frm2.memphoto10.value!="")
	{
		 var ima1=document.frm2.memphoto10.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	if(document.frm2.STI_imgString.value=="")
	{
		msg+="Type the letters shown "+"\n";
	}

	if(!document.frm2.ter.checked)
	{
		msg+="Terms Of Use "+"\n";
	}

	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}else{
		if(va=="e"){return true;}
		else{
			NewWindow('register_popup.php','name','400','160','yes');
			return false;
		}
			
	}
}

//Registration

//Edit Owner Details
function registEdit(va){
var msg='';

	if(document.frm2.salute.value==""){
	msg+='Salute of your Name'+"\n";
	}
		if(document.frm2.uname.value=="")
	{
		msg+="Your Name"+"\n";
	}
		if(document.frm2.uname.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.frm2.uname.value.indexOf(".")==0) || (document.frm2.uname.value.indexOf(" ")==0)) 
		{
		msg+="First character of Your Name should be alphabet character"+"\n";
		}
		else if(regnext.test(document.frm2.uname.value) == false)
		{	
		msg+="Your Name should be alphabet character"+"\n";
		}
   }
		if(document.frm2.address1.value=="")
	{
		msg+="Address "+"\n";
	}
		if(document.frm2.mobile11.value=="")
	{
		msg+="Mobile "+"\n";
	}
		if(document.frm2.mobile11.value.length<10)
	{
		msg+="Mobile Number should be greater than 10 "+"\n";
	}
			if(document.frm2.altemail.value!="")
	{
		//***** included on 26-03-09   $2018
		 var reg = /^([A-Za-z0-9_\-])+([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		 var address = document.frm2.altemail.value;
		 if(reg.test(address) == false) 
		 {
			  msg+="Enter valid Alternate E-Mail Id"+"\n";
		  }
		  //***** included on 26-03-09   $2018

		/*var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm2.altemail.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Alternate E-Mail Id'+"\n";
		}*/
	}

	var mailid1='';
	var altmailid1='';
	mailid1=document.frm2.emailid.value;
	altmailid1=document.frm2.altemail.value;
	if(document.frm2.altemail.value!="")
	{
	if(mailid1==altmailid1)
	{
		msg+="E-Mail ID and Alternate E-Mail ID must not be same"+"\n";
	}
	}
		 if(document.frm2.busemail.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm2.busemail.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Business E-Mail Id'+"\n";
		}
	}

	//owner validation
    if(document.frm2.memphoto.value!="")
	{
		 var ima1=document.frm2.memphoto.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n";
		 		 }					 
		 }  
	}   

	//member2 validation
	if(document.frm2.member2.value!=""){
	 if(document.frm2.relation2.value==""){
	 msg+='Relationship for Member2'+"\n";
	 }
    if(document.frm2.memphoto2.value!="")
	{
		 var ima1=document.frm2.memphoto2.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}

	//member3 validation
	if(document.frm2.member3.value!=""){
	 if(document.frm2.relation3.value==""){
	 msg+='Relationship for Member3'+"\n";
	 }
    if(document.frm2.memphoto3.value!="")
	{
		 var ima1=document.frm2.memphoto3.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member4 validation
	if(document.frm2.member4.value!=""){
	 if(document.frm2.relation4.value==""){
	 msg+='Relationship for Member4'+"\n";
	 }
    if(document.frm2.memphoto4.value!="")
	{
		 var ima1=document.frm2.memphoto4.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member5 validation
	if(document.frm2.member5.value!=""){
	 if(document.frm2.relation5.value==""){
	 msg+='Relationship for Member5'+"\n";
	 }
    if(document.frm2.memphoto5.value!="")
	{
		 var ima1=document.frm2.memphoto5.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member6 validation
	if(document.frm2.member6.value!=""){
	 if(document.frm2.relation6.value==""){
	 msg+='Relationship for Member6'+"\n";
	 }
    if(document.frm2.memphoto6.value!="")
	{
		 var ima1=document.frm2.memphoto6.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member7 validation
	if(document.frm2.member7.value!=""){
	 if(document.frm2.relation7.value==""){
	 msg+='Relationship for Member7'+"\n";
	 }
    if(document.frm2.memphoto7.value!="")
	{
		 var ima1=document.frm2.memphoto7.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member8 validation
	if(document.frm2.member8.value!=""){
	 if(document.frm2.relation8.value==""){
	 msg+='Relationship for Member8'+"\n";
	 }
    if(document.frm2.memphoto8.value!="")
	{
		 var ima1=document.frm2.memphoto8.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member9 validation
	if(document.frm2.member9.value!=""){
	 if(document.frm2.relation9.value==""){
	 msg+='Relationship for Member9'+"\n";
	 }
    if(document.frm2.memphoto9.value!="")
	{
		 var ima1=document.frm2.memphoto9.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	//member10 validation
	if(document.frm2.member10.value!=""){
	 if(document.frm2.relation10.value==""){
	 msg+='Relationship for Member10'+"\n";
	 }
    if(document.frm2.memphoto10.value!="")
	{
		 var ima1=document.frm2.memphoto10.value;
		 var ext=ima1.substring(ima1.lastIndexOf(".")+1,ima1.length).toLowerCase();
		 if (ext!=""){	
		 if((ext!='jpg')&&(ext!='JPG')&&(ext!='gif')&&(ext!='GIF') &&(ext!='png')&&(ext!='PNG')&&(ext!='bmp')&&(ext!='BMP'))
			 {
		 msg+='Attached Photo is invalid format.\n You may only upload the .jpg, .gif, .png, .bmp types of files'+"\n ";
		 		 }					 
		 }
	}
	}	 

	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}else{
		if(va=="e"){return true;}
		else{
			NewWindow('register_popup.php','name','400','160','yes');
			return false;
		}
			
	}
}
//Edit Owner Details

//Registration Tanent Login Str
function registerTenant(){
var msg='';
var p="";
	if(document.frm3.tenant_eid.value=="")
	{
		msg+="Tenant E-Mail ID"+"\n";
	}
				if(document.frm3.tenant_eid.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.frm3.tenant_eid.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid E-Mail ID'+"\n";
		}
	}
	
	if(!document.getElementById('prv1').checked && !document.getElementById('prv2').checked && !document.getElementById('prv3').checked)
	{
			msg+="Tenant Privileges"+"\n";
	}
	  
	if(document.frm3.STI_imgString.value=="")
	{
		msg+="Type the letters shown"+"\n";
	}
		if(!document.frm3.ter.checked)
	{
		msg+="Terms Of Use "+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}

//Registration Tanent Login End

//Registration Sale Property Str
function registerSale(){
var msg='';
	if(document.frm4.area.value==""){
	msg+='Built-Up Areas  '+"\n";
	}
	if(document.frm4.bedroom.value==""){
	msg+='No of Bedrooms'+"\n";
	}
		if(document.frm4.bathroom.value==""){
	msg+='No of Bathrooms'+"\n";
	}
		if(document.frm4.parking.value==""){
	msg+='No of Car Parking'+"\n";
	}
		if(document.frm4.flooring.value==""){
	msg+='Flooring '+"\n";
	}
			
	if(document.frm4.STI_imgString.value=="")
	{
		msg+="Type the letters shown"+"\n";
	}
		if(!document.frm4.ter.checked)
	{
		msg+="Terms Of Use "+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}

//Registration Sale Property End

//Registration Rent Property Str
function registerRent(){
var msg='';
	if(document.frm5.area.value==""){
	msg+='Built-Up Areas'+"\n";
	}
	if(document.frm5.bedroom.value==""){
	msg+='No of Bedrooms'+"\n";
	}
	if(document.frm5.bathroom.value==""){
	msg+='No of Bathrooms'+"\n";
	}
	if(document.frm5.parking.value==""){
	msg+='No of Car Parking'+"\n";
	}
	if(document.frm5.flooring.value==""){
	msg+='Flooring'+"\n";
	}
	if(document.frm5.STI_imgString.value=="")
	{
		msg+="Type the letters shown"+"\n";
	}
		if(!document.frm5.ter.checked)
	{
		msg+="Terms Of Use "+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}

//Registration Rent Property End

//Post Tickets Str
function postTicket(){
var msg='';
	if(document.postticketfrm.cnt_person.value=="")
	{
		msg+="Contact Person"+"\n";
	}
		if(document.postticketfrm.appt_no.value=="")
	{
		msg+='Apartment No'+"\n";
	}
		if(document.postticketfrm.landline.value=="")
	{
		msg+="Land Line"+"\n";
	}
		if(document.postticketfrm.work_type.value=="")
	{
		msg+='Type of work'+"\n";
	}
		if(document.postticketfrm.desc.value=="")
	{
		msg+="Work Description "+"\n";
	}
		if(document.postticketfrm.cnt_time.value=="")
	{
		msg+="Contact Timings"+"\n";
	}
		if(document.postticketfrm.STI_imgString.value=="")
	{
		msg+="Type the letters shown"+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}

//Post Tickets End
//Edit Tickets Validation Start
function editTicket(){
var msg='';
	if(document.editticketfrm.cnt_person.value=="")
	{
		msg+="Contact Person"+"\n";
	}
		if(document.editticketfrm.appt_no.value=="")
	{
		msg+='Apartment No'+"\n";
	}
		if(document.editticketfrm.landline.value=="")
	{
		msg+="Land Line"+"\n";
	}
		if(document.editticketfrm.work_type.value=="")
	{
		msg+='Type of work'+"\n";
	}
		if(document.editticketfrm.desc.value=="")
	{
		msg+="Work Description "+"\n";
	}
		if(document.editticketfrm.cnt_time.value=="")
	{
		msg+="Contact Timings"+"\n";
	}
		if(document.editticketfrm.work_status.value=="")
	{
		msg+="Work Staus"+"\n";
	}
		if(document.editticketfrm.STI_imgString.value=="")
	{
		msg+="Type the letters shown"+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Edit Tickets Validation End
//Send email to Owner/Tenant Start
function sendEmailTo(){
var msg='';
		if(document.popupown.sub.value=="")
	{
		msg+="Subject"+"\n";
	}
		if(document.popupown.msg.value=="")
	{
		msg+="Message"+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Send email to Owner/Tenant End

//Raise Ticket Validation Start
function raiseTicketVal(){
var msg='';
	if(document.raiseTicket.selectopt.value=="")
	{
		msg+="Raise Ticket for"+"\n";
	}
	if(document.raiseTicket.selectopt.value=="apartno")
	{
		if(document.raiseTicket.apptno.value=="")
		{
			msg+="Apartment No"+"\n";
		}
	}
	if(document.raiseTicket.selectopt.value=="comarea")
	{
		if(document.raiseTicket.areacode.value=="")
		{
			msg+="Common Area Location Code"+"\n";
		}
	}
	if(document.raiseTicket.category.value=="")
	{
		msg+="Ticket Category "+"\n";
	}
	if(document.raiseTicket.prob_desc.value=="")
	{
		msg+="Problem Description"+"\n";
	}
	if(document.raiseTicket.cont_no.value=="")
	{
		msg+="Alternate Contact No"+"\n";
	}
	if(document.raiseTicket.avail_time.value=="")
	{
		msg+="Time of Availability"+"\n";
	}
		if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
//Raise Ticket Validation End
//======================================Enter Chars Only===========================================//

function characteronly(e)
	{
	var unicode=e.charCode? e.charCode : e.keyCode
		if(unicode!=9 && unicode!=13 && unicode!=37 && unicode!=38 && unicode!=39 && unicode!=40 && unicode!=46
		&& unicode!=94)
		{
		//if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
		if ((unicode<=64||unicode>122)&&(unicode!=32)&&(unicode!=8))
		{ //if not a number 
		
		alert("Please enter only the characters and space.");
		return false; //disable key press
		}
	}	
}

//====================================Enter Chars Only============================================//

//==================================Enter Numbers Only============================================//
	function numbersonly(e){
	var unicode=e.charCode? e.charCode : e.keyCode
	//alert(unicode);
	if (unicode==8||unicode==9){ }
	else{//if the key isn't the backspace key (which we should allow)
	if(unicode!=9 && unicode!=13 && unicode!=37 && unicode!=38 && unicode!=40 && unicode!=43 && unicode!=36 && unicode!=35 && unicode!=46){
	if (unicode<48||unicode>57){ //if not a number
	alert("Please enter only the Numbers.");
	return false //disable key press
	}
	}
	}
	}

	function numbersonly1(e){
	var unicode=e.charCode? e.charCode : e.keyCode
	//alert(unicode);
	if (unicode==8||unicode==9){ }
	else{//if the key isn't the backspace key (which we should allow)
	if(unicode!=9 && unicode!=13 && unicode!=32 && unicode!=45 && unicode!=37 && unicode!=38 && unicode!=40 && unicode!=43 && unicode!=36 && unicode!=35 && unicode!=46){
	if (unicode<48||unicode>57){ //if not a number
	alert("Please enter only the Numbers.");
	return false //disable key press
	}
	}
	}
	}
//==================================Enter Numbers Only=============================================//


//=======================================Popup Window===============================================//
function NewWindow(mypage,myname,w,h,scroll)
{
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings ='scrollbars=yes,resizable=no,height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition; 
	win = window.open(mypage,myname,settings);
}
function submitme()
{
if(document.frm2.resi[0].checked==true)
{
document.frm2.submit();
}else if(document.frm2.resi[1].checked==true)
{
passcheck('rented');
document.getElementById('prev').style.display='none'
}else if(document.frm2.resi[2].checked==true)
{
passcheck('sale');
}else if(document.frm2.resi[3].checked==true)
{
passcheck('rent');
}
}
function  checkforpass()
{
if(document.frm2.resi[3].checked==true)
{
NewWindow('popup_preview2.php','name','450','400','yes'); 
						return false;
}
else{
NewWindow('popup_preview1.php','name','450','400','yes'); 
						return false;
						}
}

//Book Club house Str on 08-0409
function bookClub(){
var msg='';
	if(document.bookclubfrm.yourName.value=="")
	{
		msg+="Your Name"+"\n";
	}
	if(document.bookclubfrm.yourName.value!=""){
		var regnext= /^[A-Za-z]+[A-Za-z\s\.]+$/;
		if((document.bookclubfrm.yourName.value.indexOf(".")==0) || (document.bookclubfrm.yourName.value.indexOf(" ")==0)) 
		{
		alert("First character of Your Name should be alphabet character");
		return false
		}
		else if(regnext.test(document.bookclubfrm.yourName.value) == false)
		{	
		alert("Your Name should be alphabet character");
		return false
		}
   }
		if(document.bookclubfrm.email.value=="")
	{
		msg+="Email ID"+"\n";
	}
	if(document.bookclubfrm.email.value!="")
	{
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		var address =document.bookclubfrm.email.value;
		if(reg.test(address) == false) 
		{
		  msg+='Enter valid Email-ID'+"\n";
		}
	}
		if(document.bookclubfrm.show_date.value=="")
	{
		msg+="Event Date"+"\n";
	}
   if(document.bookclubfrm.fromtime.value=="" || document.bookclubfrm.frommer.value=="" || document.bookclubfrm.fromhrs.value=="" || document.bookclubfrm.totime.value=="" || document.bookclubfrm.tohrs.value=="" || document.bookclubfrm.tomer.value=="")
	{ 
	 msg+='Event Time'+"\n";
	}
   if(document.bookclubfrm.cms_content.value=="")
	{
      msg+='Description'+"\n";
    }
	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
	}

//Book Club house end on 08-0409

//==========================================Popup Window===============================================//

//Change Password
function changepwd(){
	//alert("sdf");
	var msg="";
	var oldpas=document.pwd.oldpas.value;
	var newpas=document.pwd.newpas.value;
	var conpas=document.pwd.conpas.value;
	var newpaslen=document.pwd.newpas.value.length;
	
	if(document.pwd.oldpas.value=="")msg+="Old Password\n";//Old Password
	if(document.pwd.newpas.value=="")msg+="New Password\n";//New Password
	if(document.pwd.conpas.value=="")msg+="Confirm New Password\n";//Confirm New Password
	//Length must be between 6 - 16

	if(newpas!=''){	
		if(newpaslen < 6)msg+="New Password must be Minimum 6 letters\n";
		if(newpaslen > 16)msg+="New Password must be maximum 16 letters\n";
		if(oldpas==newpas) msg+="Old Password and New Password should not be same \n";

	}
	// New Password and Confirm New Password must be same
	if((newpas!='')&&(conpas!='')){
		if(newpas!=conpas)msg+="New Password and Confirm New Password must be same\n";
	}
	if(msg!=''){
		alert("Please enter the require mandatory fields\n"+msg);
	}
	if(msg!=0)return false;else return true;//For Return value	
}



//Temporary Password validation//
function temPassword()
{
	var msg='';

	if(document.tempass.newpass.value=="")
	{
		msg+="New Password"+"\n";
	}
	if((document.tempass.newpass.value!="") && (document.tempass.newpass.value.length<6))
	{
			msg+="New Password should be minimum 6 characters"+"\n";
	}
	if((document.tempass.newpass.value!="") && (document.tempass.newpass.value.length>16))
	{
		message+="New Password should be maximum sixteen characters"+"\n";
	}
	if(document.tempass.newpass.value!=document.tempass.confpass.value)
	{
		msg+="New Password and Confirm Password does not match"+"\n";
	}

	if(msg!="")
	{
		alert("kindly fill the following field(s)\n\n"+msg);
		return false;
	}
}
