// JavaScript Document

	function address_validation(frm){
		var frm;
		if(frm.validate_address.checked == true){
			var property_country  = frm.lst_property_country.value;
			var property_state    = frm.txt_property_state.value;
			var property_city     = frm.txt_property_city.value;
			var property_area     = frm.txt_property_area.value;
			var property_addresss = frm.txt_property_address.value;
			var property_zipcode  =  frm.txt_property_zipcode.value;
			
			frm.lst_contact_country.value = property_country;
			frm.txt_contact_state.value   = property_state;
			frm.txt_contact_city.value    = property_city;
			frm.txt_contact_area.value    = property_area;
			frm.txt_contact_address.value = property_addresss;
			frm.txt_contact_zipcode.value = property_zipcode;
		}else{
			frm.lst_contact_country.value = "";
			frm.txt_contact_state.value   = "";
			frm.txt_contact_city.value    = "";
			frm.txt_contact_area.value    = "";
			frm.txt_contact_address.value = "";
			frm.txt_contact_zipcode.value = "";
			
		}
	}
	
	
	function property_address_validation(frm){
		var frm;
		if(frm.validate_property_address.checked == true){
			var contact_country  = frm.lst_contact_country.value;
			var contact_state    = frm.txt_contact_state.value;
			var contact_city     = frm.txt_contact_city.value;
			var contact_area     = frm.txt_contact_area.value;
			var contact_addresss = frm.txt_contact_address.value;
			var contact_zipcode  = frm.txt_contact_zipcode.value;
			
			frm.lst_property_country.value = contact_country;
			frm.txt_property_state.value   = contact_state;
			frm.txt_property_city.value    = contact_city;
			frm.txt_property_area.value    = contact_area;
			frm.txt_property_address.value = contact_addresss;
			frm.txt_property_zipcode.value = contact_zipcode;
			
		}else{
			frm.lst_property_country.value = "";
			frm.txt_property_state.value   = "";
			frm.txt_property_city.value    = "";
			frm.txt_property_area.value    = "";
			frm.txt_property_address.value = "";
			frm.txt_property_zipcode.value = "";
			
		}
	}
	
	
	function addMoreKeyFeature(myDiv,textBox1,textBox2,style,textBox_style){
		
		var ni 	   = document.getElementById(myDiv);
		var numi   = document.getElementById(textBox2);
		var num    = (document.getElementById(textBox2).value -1)+ 2;
		numi.value = num;
		
		
		var newdiv = document.createElement('div');
		var divIdName = 'myDiv'+textBox2+num;
		
		
		newdiv.setAttribute('id',divIdName);
		onclickvalue = "removeKeyFeatures('"+divIdName+"','','')";
		a ='<span class="gridbodytext">Name:</span><input name="title['+textBox1+']['+num+']" type="text" id="title['+textBox1+']['+num+']" class="'+textBox_style+'" onKeyUp="javascript: txtLength(this,100);"/>&nbsp;&nbsp;<span class="gridbodytext"> Distance:</span><input name="km['+textBox1+']['+num+']" type="text" id="km['+textBox1+']['+num+']" class="'+textBox_style+'" onKeyUp="javascript: txtLength(this,5);isNumeric(this);"/><span class="msgtext">Km</span>&nbsp;&nbsp;<a style="cursor:pointer" onClick="'+onclickvalue+'" class="'+style+'"/>&nbsp;Remove&nbsp;</a>';
		//alert(a);		
		newdiv.innerHTML = a;
		ni.appendChild(newdiv);
	
	}
	
	function removeKeyFeatures(divIdName,noImage,keyFeatureId,textname,value,frm){
		
		if(keyFeatureId){
			process = "Delete Property Key Features";
			get_details(process,'',keyFeatureId);
		}
		
		if(noImage != ""){
			var noi    = (document.getElementById(noImage).value-1);
			document.getElementById(noImage).value = noi;
		}
		
		document.getElementById(divIdName).innerHTML = "";
	}
	
	function addMoreImage(myDiv,textBox1,textBox2,noImage,buttonStyle,labelStyle){
		
		var ni 	   = document.getElementById(myDiv);
		var numi   = document.getElementById(textBox2);
		var num    = (document.getElementById(textBox2).value -1)+ 2;
		var noi    = (document.getElementById(noImage).value-1)+ 2;
		
		if(!buttonStyle){
			buttonStyle = "formbutton";
		}
		
		if(!labelStyle){
			labelStyle = "gridlabel";
		}
		
		if(document.getElementById(noImage).value < 6){
			numi.value = num;
			document.getElementById(noImage).value = noi;
			var newdiv = document.createElement('div');
			var divIdName = textBox2+num;
			
			newdiv.setAttribute('id',divIdName);
			onclickvalue = "removeKeyFeatures('"+divIdName+"','"+noImage+"')";
			a ='<table width=100%><tr><td width="130" class="'+labelStyle+'">Image :</td><td><input type="file" name="file_property_image[image]['+num+']"></td><td><a style="cursor:pointer" onClick="'+onclickvalue+'" class="'+buttonStyle+'"/>Remove</a></td></tr></table>';
					
			newdiv.innerHTML = a;
			ni.appendChild(newdiv);
		}else{
			alert("Plz Don't try, U have fecilites to upload only six images...");
		}
	}
	
	function addMoreGenImage(myDiv,textBox1,textBox2,noImage,buttonStyle,labelStyle){
		
		var ni 	   = document.getElementById(myDiv);
		var numi   = document.getElementById(textBox2);
		var num    = (document.getElementById(textBox2).value -1)+ 2;
		var noi    = (document.getElementById(noImage).value-1)+ 2;
		
		if(!buttonStyle){
			buttonStyle = "formbutton";
		}
		
		if(!labelStyle){
			labelStyle = "gridlabel";
		}
		
		if(document.getElementById(noImage).value < 6){
			numi.value = num;
			document.getElementById(noImage).value = noi;
			var newdiv = document.createElement('div');
			var divIdName = textBox2+num;
			
			newdiv.setAttribute('id',divIdName);
			onclickvalue = "removeKeyFeatures('"+divIdName+"','"+noImage+"')";
			a ='<table width=100%><tr><td width="130" class="'+labelStyle+'">Image :</td><td><input type="file" name="file_image[image]['+num+']"></td><td><a style="cursor:pointer" onClick="'+onclickvalue+'" class="'+buttonStyle+'"/>Remove</a></td></tr></table>';
					
			newdiv.innerHTML = a;
			ni.appendChild(newdiv);
		}else{
			alert("Plz Don't try, U have fecilites to upload only six images...");
		}
	}
	
	function link_creation_validation(){
		
		var where_to= confirm("Do you really want to cretate search links??");
  		 if (where_to== true)
 		  {
   		   window.location="admin_search_link.php";
 		  }
 		else
		 {
  			//window.location="http://www.barbie.com";
 		 }
	   }
		
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
function formValidation(frm,frmName){
var emailchecking=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	
		if(frm.txtTitle.value  ==""){
			alert('Enter the title and proceed');
			frm.txtTitle.focus();
			return false;
		}
		if(frm.txtName.value ==""){
			alert('please enter your name and proceed');
			frm.txtName.focus();
			return false;
		}
		if(frm.txtEmail.value ==""){
			alert('please enter your mail id and proceed');
			frm.txtEmail.focus();
			return false;
		}
		if (emailchecking.test(frm.txtEmail.value)==0){
			alert("Please input a valid email address!");
			frm.txtEmail.focus();
			return false;
		}
		/*if (frm.txtPhone.value==""){
			alert("Please enter your phone number!");
			frm.txtPhone.focus();
			return false;
		}*/
		if(frm.lstCountry.value ==""){
			alert('select country');
			frm.lstCountry.focus();
			return false;
		}
	if(frmName =='donners')
	 {
		if(frm.txtState_donner.value =="")
		{
			alert('Enter the state');
			frm.txtState_donner.focus();
			return false;
		}
		if(frm.txtCity_donner.value ==""){
			alert('Enter the city');
			frm.txtCity_donner.focus();
			return false;
		}
		/*if(frm.txtzip_donner.value ==""){
			alert('Enter the zipcode');
			frm.txtCity_donner.focus();
			return false;
		 }*/
	}
	
	if(frmName == 'referencekey'){
		
		if(frm.auto_key.value ==""){
			alert('Enter the Reference key');
			frm.auto_key.focus();
			return false;
		}
		
		
	}
	if(frmName =='seeker')
	{
		if(frm.txtState_seeker.value ==""){
			alert('Enter the state');
			frm.txtState_seeker.focus();
			return false;
		}
		if(frm.txtCity_seeker.value ==""){
			alert('Enter the city');
			frm.txtCity_seeker.focus();
			return false;
		}
		/*if(frm.txtzip_seeker.value ==""){
			alert('Enter the zipcode');
			frm.txtzip_seeker.focus();
			return false;
		}*/
	}
	
	/*if(frmName =='ngo')
	{
		if(frm.txtState_ngo.value ==""){
			alert('Enter the state');
			frm.txtState_ngo.focus();
			return false;
		}
		if(frm.txtCity_ngo.value ==""){
			alert('Enter the city');
			frm.txtCity_ngo.focus();
			return false;
		}
		if(frm.txtzip_ngo.value ==""){
			alert('Enter the zipcode');
			frm.txtzip_ngo.focus();
			return false;
		}
	}*/
	 	/*if(frm.txtAddress.value ==""){
			alert('Enter the address');
			frm.txtAddress.focus();
			return false;
		}
		if(frm.txtDescription.value ==""){
			alert('please write your description');
			frm.txtDescription.focus();
			return false;
		}*/

		
		
		
		






		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////		
		 if(frmName == 'addkeyword'){
			if(frm.category_name.value ==""){
				alert("Dont leave Category as null");
				return false;
			}
			
			if(frm.txtkeyword.value ==""){
				alert("Dont leave Keyword as null");
				return false;
		     }
		 }
		 
		 if(frmName == "rentalrequest"){
			if(frm.txtTitle.value ==""){
				alert("Dont leave title as null");
				frm.txtTitle.focus();
				return false;
		     }
			 
			 if(frm.txtName.value ==""){
				alert("Dont leave name as null");
				frm.txtName.focus();
				return false;
		     }
			 
			 if(frm.txtEmail.value ==""){
				alert("Dont leave email as null");
				frm.txtEmail.focus();
				return false;
		     }
			 
			 if(frm.txtPhone.value ==""){
				alert("Dont leave phone as null");
				frm.txtPhone.focus();
				return false;
		     }
			 
			 if(frm.lstCountry.value ==""){
				alert("Dont leave country as null");
				frm.lstCountry.focus();
				return false;
		     }
			 
			 if(frm.txtState.value ==""){
				alert("Dont leave state as null");
				frm.txtState.focus();
				return false;
		     }
			 
			 if(frm.txtCity.value ==""){
				alert("Dont leave city as null");
				frm.txtCity.focus();
				return false;
		     }
			 
			  if(frm.txtDescription.value ==""){
				alert("Dont leave description as null");
				frm.txtDescription.focus();
				return false;
		     }
			 
		 }
		 
		 if(frmName == "productsale"){
			 
			 if(frm.txtName.value ==""){
				alert("Dont leave name as null");
				frm.txtName.focus();
				return false;
		     }
			 
			 if(frm.txtEmail.value ==""){
				alert("Dont leave email as null");
				frm.txtEmail.focus();
				return false;
		     }
			 
			 if(frm.lstCountry.value ==""){
				alert("Dont leave country as null");
				frm.lstCountry.focus();
				return false;
		     }
			 
			 if(frm.txtState.value ==""){
				alert("Dont leave state as null");
				frm.txtState.focus();
				return false;
		     }
			 
			 if(frm.txtCity.value ==""){
				alert("Dont leave city as null");
				frm.txtCity.focus();
				return false;
		     }
			 
			 if(frm.txtTitle.value ==""){
				alert("Dont leave title as null");
				frm.txtTitle.focus();
				return false;
		     }
			 
			  if(frm.txtDescription.value ==""){
				alert("Dont leave description as null");
				frm.txtDescription.focus();
				return false;
		     }
			 
		 }
		 
		 
		
		if(frmName == 'catagory_details'){
			if(frm.title.value == ""){
				alert("Don't leave a null value in Title"); 
				return false;
			}
		}
		
		if(frmName == 'myprofile'){
			if(frm.txtfirstName.value ==""){
				alert("You Leaving First name as null please fill and proceed");
				return false;
			}
			if(frm.txtlastName.value ==""){
				alert("You Leaving Last name as null Please fill and proceed");
				return false;
			}
			if(frm.txtEmailId.value ==""){
				alert("You Leaving E-mail ID  as null Please fill and proceed");
				return false;
			}
			if(frm.txtFax.value ==""){
				alert("You Leaving Fax number  as null Please fill and proceed");
				return false;
			}
			if(frm.txtphone.value ==""){
				alert("You Leaving Phone number  as null Please fill and proceed");
				return false;
			}
			if(frm.txtcity.value ==""){
				alert("You Leaving City  as null Please fill and proceed");
				return false;
			}
			if(frm.txtstate.value ==""){
				alert("You Leaving State  as null Please fill and proceed");
				return false;
			}
			if(frm.lst_contact_country.value ==""){
				alert("You Leaving Country  as null Please Select it  and proceed");
				return false;
			}
			if(frm.txtzipcode.value ==""){
				alert("You Leaving Zip code  as null Please Please it  and proceed");
				return false;
			}
			if(frm.txtaddress.value ==""){
				alert("You Leaving address as null Please Please it  and proceed");
				return false;
			}
		}
		
		
		if(frmName == 'myprofile_edit'){
			if(frm.txtfirstName.value ==""){
				alert("You Leaving First name as null please fill and proceed");
				return false;
			}
			if(frm.txtlastName.value ==""){
				alert("You Leaving Last name as null Please fill and proceed");
				return false;
			}
			if(frm.txtEmailId.value ==""){
				alert("You Leaving E-mail ID  as null Please fill and proceed");
				return false;
			}
			if(frm.txtFax.value ==""){
				alert("You Leaving Fax number  as null Please fill and proceed");
				return false;
			}
			if(frm.txtphone.value ==""){
				alert("You Leaving Phone number  as null Please fill and proceed");
				return false;
			}
			if(frm.txtcity.value ==""){
				alert("You Leaving City  as null Please fill and proceed");
				return false;
			}
			if(frm.txtstate.value ==""){
				alert("You Leaving State  as null Please fill and proceed");
				return false;
			}
			if(frm.lst_contact_country.value ==""){
				alert("You Leaving Country  as null Please Select it  and proceed");
				return false;
			}
			if(frm.txtzipcode.value ==""){
				alert("You Leaving Zip code  as null Please Please it  and proceed");
				return false;
			}
			if(frm.txtaddress.value ==""){
				alert("You Leaving address as null Please Please it  and proceed");
				return false;
			}
		}
		
		
		if(frmName == 'chnagepwd'){
			if(frm.email_id.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
               alert("Your Primary User Name Email Must be Valid");
                return false;
            }
			if(frm.oldpassword.value ==""){
				alert("You leaving Old password as null please fill it and proceed");
				return false;
			}
			if(frm.newpassword.value ==""){
				alert("You leaving new password as null please fill it and proceed");
				return false;
			}
			if (frm.newpassword.value != frm.conform_password.value ){
				alert("New password and the old Password is not same");
				return false;
			}
			
			
		}
		
		if(frmName == 'master_feature'){
			if(frm.master_feature.value ==""){
				alert("You are trying to leave master feature as a null, Please fill it out...");
				document.frm.master_feature.focus();
				return false;
			}
			if(frm.lst_priority.value ==""){
				alert("You are trying to leave priority as a null, Please select it...");
				return false;
			}
			if(frm.lst_feature_type.value ==""){
				alert("You are trying to leave feature type as a null, Please select it...");
				return false;
			}
		}
		
		if(frmName == 'manage_industry'){
			if(frm.industry_service.value ==""){
				alert("You are trying to leave Industry as a null, Please fill it out...");
				return false;
			}
		}
		if(frmName == 'search_validation'){
			if(frm.city.value == "")
			{
				alert("Enter the Search Data...");
				frm.city.focus();
 			    return false;
 			}
		}
		if(frmName =='search_vali'){
			frm.city_name.focus();
			city = frm.city.value;
			var minb = frm.Min_budget.value;
			var maxb = frm.Max_budget.value;
		   // frm.city_name.focus();
			if(city == ""){
				//alert("You are trying to search without city selection, Plz choose a city first...");
				frm.city_name.focus();
				return false;
			}else{
				var val_city = "";
				for (var i=0; i < frm.city.length; i++)
				   {
				   if (frm.city[i].checked)
					  {
					  val_city = frm.city[i].value;
					  }
				   }
				
				if(val_city == ""){
					if(frm.city.checked){
						val_city = frm.city.value;
					}
				}
				
				 if(val_city == ""){
					// alert("You are trying to search without city selection, Plz choose a city first...");
					 frm.city_name.focus();
					 return false;
				 }else{
					 if(parseInt(minb) != null || parseInt(maxb) != null){
						 if(parseInt(minb) < 0){
							 
							 alert("Plz try to give positive value for minimum budget...");
					 		 frm.Min_budget.focus();
						 	 return false;
							 
						 }
						 
						 if(parseInt(maxb) < 0){
							 
							 alert("Plz try to give positive value for maximum budget...");
					 		 frm.Max_budget.focus();
						 	 return false;
							 
						 }
						 
						 if(parseInt(minb) != "" && parseInt(maxb) != "")
						 {						 
							 if(parseInt(minb) > parseInt(maxb))
							 {
								 
								 alert("Plz try to give maximum budget to more than minimum budget ...");
								 frm.Max_budget.focus();
								 return false;
								 
							 }
						 }
						 
						 return true;
						 
					 }else{				 
					 					 
					 	return true;
						
					 }
				 	
				 }
			}
		}
		
		if(frmName =='admin_manage_child'){
			if(frm.feature.value ==""){
				alert("You are tyring to leave feature as null Please fill it out...");
				return false;
			}
			if(frm.master_feature.value ==""){
				alert("You are trying to leave Master Feature as null, Please select it Out...");
				return false;
			}
			if(frm.lst_priority.value ==""){
				alert("You are trying to leave Priority as null ,please select priority...");
				return false;
			}
		}
		
		
		if(frmName =='user_login'){
			
			if (frm.email_id.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
               alert("Your Primary User Name Email Must be Valid");
                return false;
                }
			 
			if(frm.password.value ==""){
				alert("You are tyring to login with out giving password Please fill it out...");
				return false;
			}
		}
		
		if(frmName =='user_post_property'){

			IndividualDivId  = document.getElementById('divIndividualData');
			ColloectionDivId = document.getElementById('divColloectionData');
			
			if(IndividualDivId.style.display == "block"){
				
				if(document.getElementById('login_email_id') != null)
				{
					if (frm.email_id.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
				  	  alert("Your  User Name Email Must be Valid");
					  frm.email_id.focus();
					  return false;
					}
					
					if(frm.Password.value==""){
						frm.Password.focus();
						alert("You are leaving password as null,Please fill it out and proceed...");
						return false;
					}
					
				}
				
				if(trim(frm.property_title.value)==""){
					frm.property_title.focus();
					alert("You are leaving Property title as null,Please fill it out and proceed...");
					return false;
				}
				
				if(trim(frm.property_rate.value) ==""){
					frm.property_rate.focus();
					alert("You are leaving property rent as null, Please fill it out and proceed...");
					return false;
				} 
				if(trim(frm.lst_property_country.value) ==""){
					frm.lst_property_country.focus();
					alert("You are leaving property Country as null, Please Select it and proceed...");
					return false;
				}
				if(trim(frm.txt_property_state.value) ==""){
					frm.txt_property_state.focus();
					alert("You are leaving property State as null, Please fill it out and proceed...");
					return false;
				}
				if(trim(frm.txt_property_city.value) ==""){
					frm.txt_property_city.focus();
					alert("You are leaving property City as null, Please fill it out and proceed...");
					return false;
				}
				
				if(trim(frm.txt_property_city.value.length) < 3){
					frm.txt_property_city.focus();
					alert("property City should have atleast 3 letters");
					return false;
				}
				if(trim(frm.txt_property_city.value) ==""){
					frm.txt_property_city.focus();
					alert("You are leaving property City as null, Please fill it out and proceed...");
					return false;
				}
				/*if(frm.txt_property_suburab_city.value ==""){
					frm.txt_property_suburab_city.focus();
					alert("You are leaving property suburab_city as null, Please fill it out and proceed...");
					return false;
				}*/
				
				if(trim(frm.txt_property_area.value) ==""){
					frm.txt_property_area.focus();
					alert("You are leaving property Area/ Locality/ Colony as null, Please fill it out and proceed...");
					return false;
				}
				if(trim(frm.txt_property_address.value) ==""){
					frm.txt_property_address.focus();
					alert("You are leaving property Address as null, Please fill it out and proceed...");
					return false;
				}
				
				
				
				if(trim(frm.txt_property_city.value) == trim(frm.txt_property_suburab_city.value)){
					frm.txt_property_suburab_city.focus();
					alert("You are leaving property City and Suburab_city as Same, Please Check it and proceed...");
					return false;
				}
				
				if(trim(frm.txt_property_zipcode.value) ==""){
					frm.txt_property_zipcode.focus();
					alert("You are leaving zipcode as null, Please fill it out and proceed...");
					return false;
				}
				
				if(trim(frm.property_coverd_area.value) ==""){
					frm.property_coverd_area.focus();
					alert("You are leaving property coverd area as null, Please fill it out and proceed...");
					return false;
				}
			/*	if(trim(frm.property_plot_land_area.value) ==""){
					frm.property_plot_land_area.focus();
					alert("You are leaving plot/land_area as null, Please fill it out and proceed...");
					return false;
				} */
				if(trim(frm.post_by.value) ==""){
					frm.post_by.focus();
					alert("You are leaving your post by as null, Please fill it out and proceed...");
					return false;
				}
				
				if(trim(frm.post_by.value) == 2){
					
					if(trim(frm.txt_contact_company_name.value) ==""){
						frm.txt_contact_company_name.focus();
						alert("You are leaving your company name by as null, Please fill it out and proceed...");
						return false;
					}
					
				}
				 
				
				if(trim(frm.txt_contact_name.value) ==""){
					frm.txt_contact_name.focus();
					alert("You are leaving your contact name as null, Please fill it out and proceed...");
					return false;
				}
				
				if(trim(frm.txt_contact_phone1.value) ==""){
					if(trim(frm.txt_contact_phone2.value) ==""){
						if(trim(frm.txt_contact_phone3.value) ==""){
						   frm.txt_contact_phone1.focus();
					       alert("You are leaving your contact phone number as null, Please fill it out and proceed...");
					       return false;
						}
					}
				}
			}
			
			if(ColloectionDivId.style.display == "block"){
				if(trim(frm.property_description.value) ==""){
					frm.property_description.focus();
					alert("You are leaving property Description as null, Please fill it out...");
					 
					return false;
				}
			}
			
		}
		//*******************Validation for Newuserpage*****************//
			if(frmName =='signin'){
				if (frm.email_id.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
                alert("Your Primary User Name Email Must be Valid");
                return false;
                }
				/*if(frm.email_id.value==""){
					alert("You are leaving email_id as null,Please fill it out and proceed...");
					return false;
				}*/
				if(frm.password.value==""){
					alert("You are leaving Passwords as null,Please fill it out and proceed...");
					return false;
				}
				if(frm.conform_password.value==""){
					alert("You are leaving conform password as null,Please fill it out and proceed...");
					return false;
				}
				 if(frm.password.value!=frm.conform_password.value){
					alert("password and confirm password are not same..");
					return false;
				} 
		}
		//************************************************************************//
		
		if(frmName == 'contact_us'){
			if(frm.txtName.value ==""){
				alert("You are trying to leave name as a null, Please fill it out...");
				document.frm.txtName.focus();
				return false;
			}
			if(frm.txtEmailId.value ==""){
				document.frm.txtEmailId.focus();
				alert("You are trying to leave EmailID as a null, Please select it...");
				return false;
			}
			if(frm.txtSubject.value ==""){
				document.frm.txtSubject.focus();
				alert("You are trying to leave subject as a null, Please select it...");
				return false;
			}
			if(frm.txtMessage.value ==""){
				document.frm.txtMessage.focus();
				alert("You are trying to leave Message as a null, Please select it...");
				return false;
			}
		}
		//*******************Validation for Forgetpassword*****************//
			if(frmName =='forgetpwd'){
				/*if(frm.forgetpwdemail_id.value==""){
					alert("You are leaving email_id as null,Please fill it out and proceed...");
					return false;
				}*/
				if (frm.forgetpwdemail_id.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1){
               alert("Your Primary User Name Email Must be Valid");
                return false;
                }
				if(frm.forgetpwdpassword.value==""){
					alert("You are leaving Passwords as null,Please fill it out and proceed...");
					return false;
				}
				if(frm.forgetpwdconform_password.value==""){
					alert("You are leaving conform password as null,Please fill it out and proceed...");
					return false;
				}
				 if(frm.forgetpwdpassword.value!=frm.forgetpwdconform_password.value){
					alert("password and confirm password are not same..");
					return false;
				} 
				
		     
		}
		//************************************************************************//
		
		if(frmName =='user_edit_property'){
			if(frm.property_title.value==""){
					frm.property_title.focus();
					alert("You are leaving Property title as null,Please fill it out and proceed...");
					return false;
				}
				if(frm.property_coverd_area.value ==""){
					frm.property_coverd_area.focus();
					alert("You are leaving property coverd area as null, Please fill it out and proceed...");
					return false;
				}
				if(frm.property_rate.value ==""){
					frm.property_rate.focus();
					alert("You are leaving property rent as null, Please fill it out and proceed...");
					return false;
				} 
				/*if(frm.property_plot_land_area.value ==""){
					frm.property_plot_land_area.focus();
					alert("You are leaving plot/land_area as null, Please fill it out and proceed...");
					return false;
				} */
				if(frm.lst_property_country.value ==""){
					frm.lst_property_country.focus();
					alert("You are leaving property Country as null, Please Select it and proceed...");
					return false;
				}
				if(frm.txt_property_state.value ==""){
					frm.txt_property_state.focus();
					alert("You are leaving property State as null, Please fill it out and proceed...");
					return false;
				}
				if(frm.txt_property_city.value ==""){
					frm.txt_property_city.focus();
					alert("You are leaving property City as null, Please fill it out and proceed...");
					return false;
				}
				if(frm.txt_property_city.value ==""){
					frm.txt_property_city.focus();
					alert("You are leaving property City as null, Please fill it out and proceed...");
					return false;
				}
				/*if(frm.txt_property_suburab_city.value ==""){
					frm.txt_property_suburab_city.focus();
					alert("You are leaving property suburab_city as null, Please fill it out and proceed...");
					return false;
				}*/
				
				if(frm.txt_property_area.value ==""){
					frm.txt_property_area.focus();
					alert("You are leaving property Area/ Locality/ Colony as null, Please fill it out and proceed...");
					return false;
				}
				if(frm.txt_property_address.value ==""){
					frm.txt_property_address.focus();
					alert("You are leaving property Address as null, Please fill it out and proceed...");
					return false;
				}
				
				if(frm.txt_property_city.value == frm.txt_property_suburab_city.value){
					frm.txt_property_city.focus();
					alert("You are leaving property City and Suburab_city as Same, Please Check it and proceed...");
					return false;
				}
				
				if(frm.txt_property_zipcode.value ==""){
					frm.txt_property_zipcode.focus();
					alert("You are leaving zipcode as null, Please fill it out and proceed...");
					return false;
				}
				
				if(frm.post_by.value ==""){
					frm.post_by.focus();
					alert("You are leaving your post by as null, Please fill it out and proceed...");
					return false;
				}
				
				if(frm.post_by.value == 2){
					
					if(frm.txt_contact_company_name.value ==""){
						frm.txt_contact_company_name.focus();
						alert("You are leaving your company name by as null, Please fill it out and proceed...");
						return false;
					}
					
				}
				
				
				if(frm.txt_contact_name.value ==""){
					frm.txt_contact_name.focus();
					alert("You are leaving your contact name as null, Please fill it out and proceed...");
					return false;
				}
				if(frm.txt_contact_phone1.value ==""){
					if(frm.txt_contact_phone2.value ==""){
						if(frm.txt_contact_phone3.value ==""){
						   frm.txt_contact_phone1.focus();
					       alert("You are leaving your contact phone number as null, Please fill it out and proceed...");
					       return false;
						}
					}
				}
					
		}
		
		return true;
	}
	
	function confirm_city_choose(frm){
		var city = frm.city.value;
		
		if(city == ""){
			alert("You are trying to search without city selection, Plz choose a city first...");
			frm.city_name.focus();
		}else{
			var val_city = "";
			for (var i=0; i < frm.city.length; i++)
			   {
			   if (frm.city[i].checked)
				  {
				  val_city = frm.city[i].value;
				  }
			   }
			 
			if(val_city == ""){
				if(frm.city.checked){
					val_city = frm.city.value;
				}
			}
			  
			 if(val_city == ""){
				 alert("You are trying to search without city selection, Plz choose a city first...");
				 frm.city_name.focus();
			 }
		}
	}
	
	function confirmDelete(){
		result = confirm("Yor Are Trying To Lose The Data, Are You Sure?");
		if(result == true){
			return true;
		}else{
			return false;
		}
	}
	
	function popUpWindow(pageName,process,value1,divName,windowWidth,windowHeight){
		if(process == "Add Catagory"){
			qstr = 'p=' + escape(process) + '&parent_id=' + escape(value1);  // NOTE: no '?' before querystring
			url  = pageName + '?' + qstr;
			window.open(url,'','location=0,scrollbars=0,width='+windowWidth+',height='+windowHeight+',toolbar=no,menubar=no,status=no,titlebar=no,directories=no');
			//get_details('Display Sub Catagory',divName,value1);
		}else{
			
			qstr = 'process=' + escape(process) + '&id=' + escape(value1);  // NOTE: no '?' before querystring
			url  = pageName + '?' + qstr;
			window.open(url,'','location=0,scrollbars=1,width='+windowWidth+',height='+windowHeight+',toolbar=no,menubar=no,status=no,titlebar=no,directories=no');
		}
	}
	
	function newWindow(pageName,process,value1,value2,windowWidth,windowHeight){
		var newwindow;
		qstr = 'process=' + escape(process) + '&id=' + escape(value1) + '&mother_property_id=' + escape(value2);  // NOTE: no '?' before querystring
		url  = pageName + '?' + qstr;
		window.open(url);		
		//if (window.focus) {newwindow.focus()}
	}
	
	function manageDiv(showDiv,hideDiv){
		if(hideDiv != ""){
			divId =document.getElementById(hideDiv);
			divId.style.display="none";
		}		
		if(showDiv != ""){
			 divId =document.getElementById(showDiv);
			 divId.style.display="block";
		}
		
	}
	
	function manageDisableTD(showTD,hideTD){
		 
		if(hideTD != ""){
			
			TDId     = document.getElementById(hideTD);
			
			TDId.style.display="none";		
		}		
		if(showTD != ""){
			
			TDId    = document.getElementById(showTD);
			
			if (document.all)
			{
				TDId.style.display="block";
			}
			else
			{
				TDId.style.display="table-cell";
			}
		}
	}
	
	function divControl(mainDiv,titleDiv,controlDiv,passContant,displayContant,currentValue,passValue,buttonStyle){
		var displayCont = unescape(displayContant);
		var passCont    = unescape(passContant);
		if(!buttonStyle){
			buttonStyle = "formbutton";
		}
		//alert(buttonStyle);
		if(currentValue == 0){
			/*manageDiv(titleDiv,'');
			manageDiv(mainDiv,'');*/
			if(mainDiv == "divPCAddress" || mainDiv == "divRoommatesPCAddress" || mainDiv == "divCommercialPCAddress" || mainDiv == "divImage"){
				Effect.toggle(mainDiv,'appear');
			}else{
				Effect.toggle(mainDiv,'slide');
			}	
		}else{
			if(mainDiv == "divPCAddress"  || mainDiv == "divRoommatesPCAddress" || mainDiv == "divCommercialPCAddress" || mainDiv == "divImage"){
				Effect.toggle(mainDiv,'appear');
			}else{
				Effect.toggle(mainDiv,'slide');
				//Effect.toggle(titleDiv,'blind');
			}
			/*manageDiv('',titleDiv);
			manageDiv('',mainDiv);*/
		}
		
				
		var divContant  = "<a style='cursor:pointer'  class='"+buttonStyle+"' onClick=javascript:divControl('"+ mainDiv +"','"+titleDiv+"','"+ controlDiv +"','"+ escape(displayCont) +"','"+ escape(passCont) +"','"+passValue+"','"+currentValue+"','"+buttonStyle+"') title='Click To "+ displayCont + "'>"+displayCont+"</a>";
		divId           = document.getElementById(controlDiv);
		divId.innerHTML = "";
		divId.innerHTML = divContant;
	}
	
	function divEmailControl(mainDiv,id,pos){
		
		txtName     = 'txtName'+pos+id;
		Effect.toggle(mainDiv,'slide');
		document.getElementById(mainDiv).focus();
	}
	
	function divFavorateControl(id){
		//alert(id);
		labelDiv = "divFavorateLabel" + id;
		textDiv  = "divFavorateText" + id;
		
		Effect.toggle(labelDiv,'blind');
		Effect.toggle(textDiv,'slide');
		
	}
	
	
	
	function hiddenValue(inputID,value1){
		var InputID = document.getElementById(inputID);
		InputID.value = value1;
	}
	
	function display_menu(MENU_ITEMS,MENU_POS,IE_MENU_POS){
		if(document.all){
			new menu (MENU_ITEMS, IE_MENU_POS);
		}else{
			new menu (MENU_ITEMS, MENU_POS);
		}	
	}
	
	function google_ads(position){
		if(position == "right"){
		<!--
			google_ad_client = "pub-2693900044858181";
			google_ad_width = 160;
			google_ad_height = 600;
			google_ad_format = "160x600_as";
			google_ad_type = "text";
			google_ad_channel = "";
		//-->
		}
		
		if(position == "200x200"){
	
			google_ad_client = "pub-2693900044858181";
			google_ad_width = 200;
			google_ad_height = 200;
			google_ad_format = "200x200_as";
			google_ad_type = "image";
			google_ad_channel = "";
	
		}
		
		
		if(position == "index"){
			google_ad_client = "pub-2693900044858181";
			google_ad_width = 300;
			google_ad_height = 250;
			google_ad_format = "300x250_as";
			google_ad_type = "text";
		 
			google_ad_channel = "";
		
		}
		
		if(position == "top"){
		<!--
			/*google_ad_client = "pub-2693900044858181";
			google_ad_width = 728;
			google_ad_height = 90;
			google_ad_format = "728x90_as";
			google_ad_type = "text_image";
			google_ad_channel = "";*/
			google_ad_client = "pub-2693900044858181";
			google_ad_width = 728 ;
			google_ad_height = 90;
			google_ad_format = "728x90_as";
			 google_ad_type = "image";
			//google_ad_type = "text";
			google_ad_channel = "";
		//-->
		}
		
		if(position == "headerlarge"){
		<!--
			google_ad_client = "pub-2693900044858181";
			google_ad_width = 728;
			google_ad_height = 90;
			google_ad_format = "728x90_as";
			google_ad_type = "image";
			google_ad_channel = "";
		//-->
		}
	}
	
	function controlArrowDiv(catagory_id){
		if(catagory_id == 1){
			tableID  = document.getElementById('tblSearch');
			trID     = document.getElementById('searchTR');
			sLine    = document.getElementById('search_line');
			//searchDividerTR
			//tableID.style.backgroundColor='#1E5285';
			tableID.style.borderTop='solid 5px';
			tableID.style.borderTopColor='#1E5285';
			tableID.style.borderRight='solid 2px';
			tableID.style.borderRightColor='#1E5285';
			tableID.style.borderLeft='solid 2px';
			tableID.style.borderLeftColor='#1E5285';
			tableID.style.borderBottom='solid 2px';
			tableID.style.borderBottomColor='#1E5285';
			trID.style.backgroundColor='#1E5285';
			sLine.style.backgroundColor='#1E5285';
			manageDiv('divArrow1','');
			manageDiv('','divArrow2');
			manageDiv('','divArrow3');
		}
		if(catagory_id == 2){
			tableID = document.getElementById('tblSearch');
			trID    = document.getElementById('searchTR');
			sLine   = document.getElementById('search_line');
			tableID.style.borderTop='solid 5px';
			tableID.style.borderTopColor='#FF8700';
			tableID.style.borderRight='solid 2px';
			tableID.style.borderRightColor='#FF8700';
			tableID.style.borderLeft='solid 2px';
			tableID.style.borderLeftColor='#FF8700';
			tableID.style.borderBottom='solid 2px';
			tableID.style.borderBottomColor='#FF8700';
			trID.style.backgroundColor='#FF8700';
			sLine.style.backgroundColor='#FF8700';
			//tableID.style.backgroundColor='#FF8700';
			manageDiv('','divArrow1');
			manageDiv('divArrow2','');
			manageDiv('','divArrow3');			
		}
		if(catagory_id == 3){
			tableID = document.getElementById('tblSearch');
			trID    = document.getElementById('searchTR');
			sLine   = document.getElementById('search_line');
			tableID.style.borderTop='solid 5px';
			tableID.style.borderTopColor='#66A552';
			tableID.style.borderRight='solid 2px';
			tableID.style.borderRightColor='#66A552';
			tableID.style.borderLeft='solid 2px';
			tableID.style.borderLeftColor='#66A552';
			tableID.style.borderBottom='solid 2px';
			tableID.style.borderBottomColor='#66A552';
			trID.style.backgroundColor='#66A552';
			sLine.style.backgroundColor='#66A552';
			//tableID.style.backgroundColor='#66A552';
			manageDiv('','divArrow1');
			manageDiv('','divArrow2');
			manageDiv('divArrow3','');
			
		}
		
	}
	
	function controlPostPropertyArrowDiv(catagory_id){
		if(catagory_id == 1){
			manageDiv('divArrow1','');
			manageDiv('','divArrow2');
			manageDiv('','divArrow3');
		}
		if(catagory_id == 2){
			manageDiv('','divArrow1');
			manageDiv('divArrow2','');
			manageDiv('','divArrow3');			
		}
		if(catagory_id == 3){
			manageDiv('','divArrow1');
			manageDiv('','divArrow2');
			manageDiv('divArrow3','');
			
		}
		
	}
	
	function currencyDiv(country_id){
		qstr = 'p=' + escape('Get Currency Details') + '&country_id=' + escape(country_id);  // NOTE: no '?' before querystring
		xmlhttpPostCurrency('common_ajax.php',qstr);
	}
	
	function activeSearch(manageTd,buttonName){
		manageDisableTD('tdSimpleSearchButton','');
		manageDisableTD(manageTd,'');
		document.getElementById('txtMinbudget').disabled=false;
		document.getElementById('txtMaxbudget').disabled=false;
		document.getElementById(buttonName).disabled=false;
		document.getElementById('simple_search_button').disabled=false;
		document.getElementById('txtMinbudget').style.backgroundColor="white";
		document.getElementById('txtMaxbudget').style.backgroundColor="white";
		document.getElementById('txtMinbudget').value="";
		document.getElementById('txtMaxbudget').value="";
		

	}
	
	function clearSearchData(manageTd,buttonName){
		manageDisableTD('','tdSimpleSearchButton');
		manageDisableTD('',manageTd);
		document.getElementById('txtMinbudget').disabled=true;
		document.getElementById('txtMaxbudget').disabled=true;
		document.getElementById(buttonName).disabled=true;
		document.getElementById('simple_search_button').disabled=true;
		document.getElementById('txtMinbudget').style.backgroundColor="silver";
		document.getElementById('txtMaxbudget').style.backgroundColor="silver";
		document.getElementById('txtMinbudget').value="Choose a city fisrt";
		document.getElementById('txtMaxbudget').value="Choose a city fisrt";
		document.getElementById('divMinbudgetCurrency').innerHTML="";
		document.getElementById('divMaxbudgetCurrency').innerHTML="";
		document.getElementById('divDisplayCityDetails').innerHTML="";
		document.getElementById('divDisplayCityDetails').innerHTML='<input type="hidden" name="city" value="">';
	}
	
	function trim(a){
		var tmp=new Array();
		for(j=0;j<a.length;j++)
			if(a[j]!='')
				tmp[tmp.length]=a[j];
		a.length=tmp.length;
		for(j=0;j<tmp.length;j++)
			a[j]=tmp[j];
		return a;
	}
	
function isNumeric(sText)

   {
   var ValidChars  = "0123456789.";
   var txtValue    = sText.value;
   var IsNumber    = true;
   var numericValue = "";
   var Char;

 
   for (i = 0; i < txtValue.length && IsNumber == true; i++) 
      { 
      Char = txtValue.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
			 IsNumber = false;
			 sText.value = numericValue;
			 sText.focus();
			 alert("Plz try to give only numeric values");
			 return false;
		 }
	  if(Char == ".")
	  	{
		 ValidChars  = "0123456789";
	    }
	  numericValue = numericValue + Char;	
      }
	  sText.value  = numericValue;
	  
  }
  
  function isPhone(sText)

   {
   var ValidChars  = "0123456789+ ";
   var txtValue    = sText.value;
   var IsNumber    = true;
   var numericValue = "";
   var Char;

 
   for (i = 0; i < txtValue.length && IsNumber == true; i++) 
      { 
      Char = txtValue.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
			 IsNumber = false;
			 sText.value = numericValue;
			 sText.focus();
			 alert("Sorry for this message! Plz try to give as a phono#");
			 return false;
		 }
	  if(Char == "+")
	  	{
		 ValidChars  = "0123456789";
	    }
	  numericValue = numericValue + Char;	
      }
	  sText.value  = numericValue;
	  
  }
  
  function txtLength(sText,len){
	   var txtValue     = sText.value;
	   var txtLen       = len-1;
	   var numericValue = "";
       var Char;
	   	      
	   if(txtValue.length > txtLen){
		   for (i = 0; i < txtValue.length; i++){
               Char = txtValue.charAt(i); 
			   if(i > txtLen){
				   sText.focus();
				   sText.value  = numericValue;
				   alert("Sorry for this message! Length of this field is " + len + " only...");
				   return false
				}
				numericValue = numericValue + Char;	
		   }		   
	   }	   
   }
   
  function searchCheck(process,frm)
	{
		
		
	if(frm){
		var fmobj=document.forms[0];
	}else{
		var fmobj=document.forms[frm];
	}
	 
	 for (var i=0;i<fmobj.elements.length;i++)
	 {
		var e = fmobj.elements[i];
		
		if ((e.type=='checkbox') && (!e.disabled) )
		{
			
			if(e.name.indexOf("chktags")>-1)
			{				
				e.checked=(process=="1")?true:false;
			}
		}
	  }
	}
	
	function manageCheck()
	{
	 var fmobj=document.forms[0];
	 for (var i=0;i<fmobj.elements.length;i++) {
		var e = fmobj.elements[i];
		if ((e.type=='checkbox') && (!e.disabled) )
		{
			if(document.getElementById('checkAll').checked == true){
				e.checked =true;
			}else{
				e.checked = false;
			}
			//e.checked = (e.checked==true)?false:true;
			//e.checked =true;
		}
	  }
	}
	
	function manageContactDisplay(postBy,frm,companyDivId){
		
		if(!companyDivId){
			companyDivId = "company_name_id";
		}
		divId =document.getElementById(companyDivId);
		
		if(postBy == "2"){
			frm.txt_contact_company_name.value = "";
			divId.style.display="block";
			
		}else{
			divId.style.display="none";
		}
	}
	
	function managePropertyDiv(mainDiv,value1){
		active_property = document.getElementById('active_property_div').value;
		//alert(active_property);
		//alert(mainDiv);
		if(active_property == 1){
			//Effect.toggle('residential_property','appear');
			document.getElementById('residential_property_div').style.display="none";
		}
		
		if(active_property == 2){
			//Effect.toggle('commercial_property','appear');
			document.getElementById('commercial_property_div').style.display="none";
		}
		
		if(active_property == 3){
			//Effect.toggle('roommates_property','appear');
			document.getElementById('roommates_property_div').style.display="none";
		}
		document.getElementById('active_property_div').value = value1;	
		//document.getElementById(mainDiv).style.display="block";
		Effect.toggle(mainDiv,'appear');
			
		
	}
	
	function searchDivControl(mainDiv,divAction){
		var simpleSearch = document.getElementById('hidSimpleSearch').value;
		var refineSearch = document.getElementById('hidRefineSearch').value;

		if(divAction == "divRefineSearch"){
			if(refineSearch == 0){
				document.getElementById('divRefineSearch1').style.display="block";
				document.getElementById('divDisplaySubCatagory').style.display="block";
				document.getElementById('divRefineSearch3').style.display="block";
				document.getElementById('hidRefineSearch').value = 1;			 		  
			}
			if(simpleSearch == 0){
				document.getElementById('hidSimpleSearch').value = 1;
				Effect.toggle(mainDiv,'slide');
			}
		}
		
		if(divAction == "divSimpleSearch"){
			searchCheck(0);
			document.getElementById('divRefineSearch1').style.display="none";
			document.getElementById('divDisplaySubCatagory').style.display="none";
			document.getElementById('divRefineSearch3').style.display="none";
			document.getElementById('hidRefineSearch').value = 0;					
			if(simpleSearch == 0){
				document.getElementById('hidSimpleSearch').value = 1;
				Effect.toggle(mainDiv,'slide');
			}				
		}
		
		if(divAction == "divSearchClose"){
			document.getElementById('divRefineSearch1').style.display="none";
			document.getElementById('divDisplaySubCatagory').style.display="none";
			document.getElementById('divRefineSearch3').style.display="none";
			document.getElementById('hidRefineSearch').value = 0;	
			if(simpleSearch == 1){
				document.getElementById('hidSimpleSearch').value = 0;
				searchCheck(0);
				Effect.toggle(mainDiv,'slide');
			}				
		}
	}
	/*function searchDivControl(mainDiv){
			 Effect.toggle(mainDiv,'slide');
	}*/
	
	
	function refineSearchDivControl(mainDiv,divSimpleSearch){
		  var simpleSearch = document.getElementById('hidSimpleSearch').value;
		  var refineSearch = document.getElementById('hidRefineSearch').value;
		  alert("simpleSearch " + simpleSearch);
		  alert("refineSearch " + refineSearch);
		  if(simpleSearch == 1){
			  alert(divSimpleSearch);
			  Effect.toggle(divSimpleSearch,'appear');
			  document.getElementById('hidSimpleSearch').value = 0;
		  }
		  Effect.toggle(mainDiv,'appear');
		  if(refineSearch == 0){
		  	document.getElementById('hidRefineSearch').value = 1;
		  }else{
            document.getElementById('hidRefineSearch').value = 0;
		  }
	}
	
	
	
	// Removes leading whitespaces
	function LTrim( value ) {
		
		var re = /\s*((\S+\s*)*)/;
		return value.replace(re, "$1");
		
	}
	
	// Removes ending whitespaces
	function RTrim( value ) {
		
		var re = /((\s*\S+)*)\s*/;
		return value.replace(re, "$1");
		
	}
	
	// Removes lesearchDivControlding and ending whitespaces
	function trsearchDivControlim( value ) {
		
		return LTrim(RTrim(value));
		
	}
	
	function pageSubmit(){
		frm = document.forms[0];
		frm.action = "login.php";
		frm.submit();
	}
	
	function getPropertyEmailInfo(id,pos){
		var output;
		var divID = "divPropertyEmail";
		output = '<table width="70%" border="0" cellpadding="0" cellspacing="2">';
		output += '<tr><td class="gridlabel" width="130"><span class="required">*</span>Name :</td>';
		output += '<td><input type="text" name="txtName" value="" maxlength="100" size="30"></td></tr>';
		output += '<tr><td class="gridlabel" width="130"><span class="required">*</span>Email-ID :</td>';
		output += '<td><input type="text" name="txtEmailId" value="" maxlength="100" size="30"></td>';
		output += '</tr><tr><td class="gridlabel" width="130"><span class="required">*</span>Subject :</td>';
		output += '<td><input type="text" name="txtSubject" value="" maxlength="100" size="30"></td></tr>';
		output += '<tr><td class="gridlabel" width="130" valign="top"><span class="required">*</span>Message :</td>';
		output += '<td><textarea name="txtMessage" rows="6" cols="34"></textarea></td></tr>';
		output += '<tr><td colspan="2" align="right"><input type="submit" name="btnSubmit" value="Send" class="formmainbutton"></td></tr>'
	  	output += '</table>';
		divID  = divID + pos + id;
		document.getElementById(divID).innerHTML="";
		document.getElementById(divID).innerHTML=output;
	}
	
	function propertyConform(){
		frm = document.forms[0];
		frm.action = "user_post_property_conform.php";
		frm.submit();
	}
	
	function propertyChangeDetails(){
		frm = document.forms[0];
		frm.action = "user_post_property.php";
		frm.submit();
	}
	
	
	function displayImageDivControl(mainDiv) {
    	/*window.scrollBy(0,500); // horizontal and vertical scroll increments
    	scrolldelay = setTimeout('pageScroll()',100); 
		// scrolls every 100 milliseconds*/
		 	 Effect.toggle(mainDiv,'slide');
			 
		   }
		
		
		function pageScroll(){
			 var divID ='focus';
			 
			 window.scrollBy(0,1000);
			  // document.window.focus();
			  
			 //window.focus();
			   scrolldelay = setTimeout('pageScroll()',100);

              
			  
			  
			  
			// scrolldelay = setTimeout('pageScroll()',0);
			  
			  
			   document.getElementById(divID).focus();
			  clearTimeout(scrolldelay);
			}
		
		
function stopscroll()
{
	    //clearTimeout(scrolldelay);
}

/*function city_letter(textname)
{
	 
	 value1 = trim(document.getElementById(textname).value);	
		 
		 if(value1.length<3)
		 {
			 alert("City name should be in minimum three letters"); 
			 document.getElementById(textname).focus();
			 return false;
		 }
}*/


  function open_window(val,disp){
	  //alert(disp);
  	 var result = window.open(disp,'newwindow','width=300,height=250,left=572,top=259,screenX=1000,screenY=0,scrollbars=yes');
	 result.focus();
	 if(val =="2"){ 	 
	  result.close(); 
	  
	  
	  
	 }
	  //return false;
  }
  
  function copyto_text_state(val,hideDiv,value){
	  
	  if(value == 1){
			 var field     =  'txtState_donner';
			 var field_foc =  'txtCity_donner';
		 }else
		 if(value == 2){
			 var field     = 'txtState_seeker';
			 var field_foc =  'txtCity_seeker';
		 }else
	    if(value == 3){
			 var field     = 'txtState_ngo';
			 var field_foc =  'txtCity_ngo';
		}
	 // alert(val);
	  val = val.replace(/^\s+/g,'');
 	  document.getElementById(field).value = trim(val);	
	   manageDiv('',hideDiv)
	   document.getElementById(field_foc).focus();
  }


function div_control(divname,val){
	alert(divname);
	alert(val);
	if(val == 1){
		Effect.toggle(divname,'slide');
	}else{
		Effect.toggle(divname,'appear');
	}
}
function copyto_text_city(val,hideDiv,value){
	  
	  if(value == 1){
			 var field     =  'txtCity_donner';
			 var field_foc =  'txtzip_donner';
		 }else
		 if(value == 2){
			 var field     = 'txtCity_seeker';
			 var field_foc =  'txtzip_seeker';
		 }else
	    if(value == 3){
			 var field     = 'txtCity_ngo';
			 var field_foc =  'txtzip_ngo';
		}
	 // alert(val);
	  val = val.replace(/^\s+/g,'');
 	  document.getElementById(field).value = trim(val);	
	   manageDiv('',hideDiv)
	   document.getElementById(field_foc).focus();
  }
  
//Email Validation

		function checkemail(value1){
			
			var str=document.getElementById(value1).value;
			
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			
			if (filter.test(str)){
				
				return true;
			
			}else{
			
				alert("Please Enter valid email address");	
				document.getElementById(value1).value="";					 
				return false;
			}
		
		}
		
		function emailValidation(value1){
		 
			if (document.getElementById(value1).value!="")
			return checkemail(value1)
			else
			return true
		}
		
 //End Email Validation
 
 //is_numeric
function IsNumeric(value1)
{
	 
   var sText = document.getElementById(value1).value;

   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
		 
         }
      }
	  
   if(IsNumber==false){
	  
	   alert('Enter only Numeric Value');
	   document.getElementById(value1).value="";
   }
   
}//End IsNumeric



