function validate_property(f1){
	if (!f1.propertyName.value.length) {
	   alert("You Must Enter Property Name");
	   f1.propertyName.focus();
	   return false;
	}
	if (f1.propertyType.options[f1.propertyType.selectedIndex].value == '') {
	   alert("Please select property type");
	   f1.propertyType.focus();
	   return false;
	}
	if (!f1.propertyLocation.value.length) {
	   alert("You Must Enter Property Location");
	   f1.propertyLocation.focus();
	   return false;
	}
	if (f1.city.options[f1.city.selectedIndex].value == '') {
	   alert("Please select your city");
	   f1.city.focus();
	   return false;
	}
	/*if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}
	if(f1.image.value==""){
		   alert("Please select Property Image");
		   f1.image.focus();
		   return false;  
	}*/
	if(f1.image.value!=""){
		var ext=f1.image.value
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
	   if(ext != 'jpg' && ext != 'gif') {
			alert('You selected a .'+ext+ ' file; please select a .jpg or .gif file instead!');
			return false;
	   }
	}
  return true;
}
function validate_member(f1){
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!f1.fname.value.length) {
	   alert("You Must Enter Your First Name");
	   f1.fname.focus();
	   return false;
	}
	if (!f1.lname.value.length) {
	   alert("You Must Enter Your Last Name");
	   f1.lname.focus();
	   return false;
	}
	var re2 = /^[0-9-\s]+$/;
	if (f1.phone1.value!="") {
		if (!re2.test(f1.phone1.value)) {
		   alert("Phone no. can be numeric or - only");
		   f1.phone1.focus();
		   return false;
		}
	}
	if (f1.phone2.value!="") {
		if (!re2.test(f1.phone2.value)) {
		   alert("Phone no. can be numeric or - only");
		   f1.phone2.focus();
		   return false;
		}
	}
	if (!f1.address.value.length) {
	   alert("You Must Enter Your Address");
	   f1.address.focus();
	   return false;
	}
	if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}
	if (!f1.email.value.length) {
	   alert("You Must Enter Your Email-id");
	   f1.email.focus();
	   return false;
	}
	if(f1.email.value.length){
		if (!re_mail.test(f1.email.value))	{
				alert( "Enter Your Email-id correctly" );
				f1.email.focus();
				return false;
		}
	}
	if (!f1.pwd.value.length) {
		   alert("Please Specify the Password");
		   f1.pwd.focus();
		   return false;
	}
	if (f1.pwd.value.length > 10 ||  f1.pwd.value.length < 5) {
      alert("Password should be 5 to 10 digits long.");
      f1.pwd.focus();
      return false;
    }
	if (!f1.rpwd.value.length) {
		   alert("Please Re-confirm Password");
		   f1.rpwd.focus();
		   return false;
	}
	
	if (f1.pwd.value != f1.rpwd.value) {
		  alert("Password and Re-entered passwords should be same");
		  f1.rpwd.focus();
		  return false;
	}
}
function validate_enquiry(f1){
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!f1.company.value.length) {
	   alert("You Must Enter Your Company Name");
	   f1.company.focus();
	   return false;
	}
	if(!f1.email.value.length){
	   alert("You Must Enter Your Email-id");
	   f1.email.focus();
	   return false;
	}
	if (!re_mail.test(f1.email.value))	{
				alert( "Enter Your Email-id correctly" );
				f1.email.focus();
				return false;
	}
	if(!f1.name.value.length || f1.name.value==" "){
	   alert("You Must Enter Your Name");
	   f1.name.focus();
	   return false;
	}
	if (!f1.address.value.length) {
	   alert("You Must Enter Your Address");
	   f1.address.focus();
	   return false;
	}
	if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}
	if (!f1.phone.value.length) {
	   alert("You Must Enter Your Phone No.");
	   f1.phone.focus();
	   return false;
	}
	var re2 = /^[0-9-\s]+$/;
	if (!re2.test(f1.phone.value)) {
	   alert("Phone no. can be numeric or - only");
	   f1.phone.focus();
	   return false;
	}	
	/*if (isNaN(f1.phone.value)) {
	   alert("Phone No. can be only Numeric");
	   f1.phone.focus();
	   return false;
	}
	if (!f1.requirement.value.length) {
	   alert("You Must Enter Your Requirement");
	   f1.requirement.focus();
	   return false;
	}*/
	return true;
}
function validate_banner(f1){
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if(!f1.fname.value.length){
	   alert("You Must Enter Your First Name");
	   f1.fname.focus();
	   return false;
	}
	if (!f1.phone.value.length) {
	   alert("You Must Enter Your Phone No.");
	   f1.phone.focus();
	   return false;
	}
	var re2 = /^[0-9-\s]+$/;
	if (!re2.test(f1.phone.value)) {
	   alert("Phone no. can be numeric or - only");
	   f1.phone.focus();
	   return false;
	}	
	if(!f1.email.value.length){
	   alert("You Must Enter Your Email-id");
	   f1.email.focus();
	   return false;
	}
	if(f1.email.value.length){
		if (!re_mail.test(f1.email.value))	{
				alert( "Enter Your Email-id correctly" );
				f1.email.focus();
				return false;
		}
	}
	if (!f1.address.value.length) {
	   alert("You Must Enter Your Address");
	   f1.address.focus();
	   return false;
	}
	if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}
	if(!f1.image.value!="" && !f1.prev_image.value!=""){
	   alert("You Must Select Banner Image");
	   f1.image.focus();
	   return false;
	}
	if(f1.image.value!=""){
		var ext=f1.image.value
		ext = ext.substring(ext.length-3,ext.length);
		ext = ext.toLowerCase();
	   if(ext != 'jpg' && ext != 'gif' && ext != 'jpeg' && ext != 'swf') {
			alert('You selected a .'+ext+ ' file; please select a .jpg or .gif or .swf file instead!');
			return false;
	   }
	}
	if (!f1.requirement.value.length) {
	   alert("You Must Enter Your Requirement");
	   f1.requirement.focus();
	   return false;
	}
}
function change_password(f1){
	if (!f1.opwd.value.length) {
		   alert("Please Specify Old Password");
		   f1.opwd.focus();
		   return false;
	}
	if (!f1.pwd.value.length) {
		   alert("Please Specify the New Password");
		   f1.pwd.focus();
		   return false;
	}
	if (!f1.rpwd.value.length) {
		   alert("Please Re-confirm New Password");
		   f1.rpwd.focus();
		   return false;
	}
	if (f1.pwd.value != f1.rpwd.value) {
		  alert("Password and Re-entered passwords should be same");
		  f1.rpwd.focus();
		  return false;
	}

}
function forgot_password(f1){
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!f1.email.value.length) {
		   alert("Please Specify Your Email-id");
		   f1.email.focus();
		   return false;
	}
	if(f1.email.value.length){
		if (!re_mail.test(f1.email.value))	{
				alert( "Enter Your Email-id correctly" );
				f1.email.focus();
				return false;
		}
	}
}
function CheckAll(){
		var frm=document.formn;
		var count = frm.elements.length;
		for (i=0; i < count; i++){
			if(frm.elements[i].type=="checkbox"){
				if(frm.elements[i].checked == 0){
					frm.elements[i].checked = 1;
				}else{
					frm.elements[i].checked = 0;
				}
			}
		}
}
		
	function chkactivate(){
		var frm=document.formn;
		count = frm.elements.length;
		var c=0;
		for (i=0; i < count; i++){
			if(frm.elements[i].checked == 1){
				c = 1;
			}
		}
		if(c == 0){
			alert('First select a record to activate.');
			return false;
		}
		if(c!=0){
			 return confirm('Are you sure you want to activate .....');
		}
	}
	function chkdeactivate(){
		var frm=document.formn;
		count = frm.elements.length;
		var c=0;
		for (i=0; i < count; i++){
			if(frm.elements[i].checked == 1){
				c = 1;
			}
		}
		if(c == 0){
			alert('First select a record to deactivate.');
			return false;
		}
		if(c!=0){
			 return confirm('Are you sure you want to deactivate .....');
		}
	}
	function chkdelete(){
		var frm=document.formn;
		count = frm.elements.length;
		var c=0;
		for (i=0; i < count; i++){
			if(frm.elements[i].checked == 1){
				c = 1;
			}
		}
		if(c == 0){
			alert('First select a record to delete.');
			return false;
		}
		if(c!=0){
			 return confirm('Are you sure you want to delete ....');
		}
	}