var host = window.location.host;
var slat=null;
var slon=null;

function searchdet(obj){
	
	var spath = "/searches/detail_sub_search/";
	//alert(host);
	//alert(BASEURL);
	var url ="http://"+host+spath+obj.value;
	//alert(url);
	//window.location='http://chennaiserver/findad-janakiraman/searches/detail_sub_search/'+obj.value;
	window.location = url;
}

function change_password(){
	if(document.getElementById('UserOldpassword').value==""){
		alert("Enter the old password");
		document.getElementById('UserOldpassword').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value==""){
		alert("Enter the new password");
		document.getElementById('UserPassword').focus();
		return false;
	}
	if(document.getElementById('UserCpassword').value==""){
		alert("Enter the confirm password");
		document.getElementById('UserCpassword').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value.length < 5){
		alert("The password length must be five characters");
		document.getElementById('UserPassword').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value!=document.getElementById('UserCpassword').value){
		alert("Check password and confirm password");
		document.getElementById('UserPassword').focus();
		return false;
	}
	return true;
}

function register_valid(){
	
	if(document.getElementById('UserEmailid').value==""){
		alert("Email id is empty");
		document.getElementById('UserEmailid').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value==""){
		alert("The Password field is empty");
		document.getElementById('UserPassword').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value.length < 5){
		alert("The Password length must be aleast five characters");
		document.getElementById('UserPassword').focus();
		return false;
	}
	if(document.getElementById('UserCpassword').value==""){
		alert("The Confirm password field is empty");
		document.getElementById('UserCpassword').focus();
		return false;
	}
	if(document.getElementById('UserCpassword').value.length < 5){
		alert("The Confirm password length must be aleast five characters");
		document.getElementById('UserCpassword').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value!=document.getElementById('UserCpassword').value){
		alert("The password and confirm password are not the same");
		document.getElementById('UserPassword').focus();
		return false;
	}
	if(echeck(document.getElementById('UserEmailid').value))
	return true;
	else{
		document.getElementById('UserEmailid').focus();
		return false;
	}
}

function login_valid(){
	if(document.getElementById('UserEmailid').value==""){
		alert("Email id is empty");
		document.getElementById('UserEmailid').focus();
		return false;
	}
	if(document.getElementById('UserPassword').value==""){
		alert("The password field is empty");
		document.getElementById('UserPassword').focus();
		return false;
	}
	return true;
}

function forgotpwd_valid(){
	if(document.getElementById('UserEmailid').value==""){
		alert("Email id is empty");
		document.getElementById('UserEmailid').focus();
		return false;
	}
}

/* Adding new property row edit */
function add_row_edit(r){
		var root = r.parentNode;
		var allrows = root.getElementsByTagName('tr');
		var tot1=(allrows.length+1);
		var tot=document.getElementById('PropertyRowCount').value;
		tot=parseInt(tot)+1;
		var nRow = allrows[1].cloneNode(true);
		var nInp = nRow.getElementsByTagName('input');
		for(var i=0; i<nInp.length;i++){
			nInp[i].setAttribute('name',nInp[i].getAttribute('id')+'_'+tot);
			if(i==0||i==1)
			nInp[i].setAttribute('value','');
		}
		nInp[3].removeAttribute('disabled');
		root.appendChild(nRow)-(allrows.length-1);
		document.getElementById('PropertyTotal').value=tot1;
		document.getElementById('PropertyRowCount').value=tot;
		
}
/* end of adding row */

/* Adding new property row for post */
function add_row_post(r){
		var root = r.parentNode;
		var allrows = root.getElementsByTagName('tr');
		var tot=(allrows.length+1);
		var nRow = allrows[1].cloneNode(true);
		var nInp = nRow.getElementsByTagName('input');
		for(var i=0; i<nInp.length;i++){
			nInp[i].setAttribute('name',nInp[i].getAttribute('id')+'_'+tot);
			if(i==0||i==1)
			nInp[i].setAttribute('value','');
		}
		nInp[3].removeAttribute('disabled');
		root.appendChild(nRow)-(allrows.length-1);
		document.getElementById('PropertyTotal').value=tot;
		
}
/* end of adding row */

/* deleting row */
	
function deleteRow1(r){
		var root = r.parentNode.parentNode.parentNode;
		var allrows = root.getElementsByTagName('tr');
		//alert(allrows.length);
		if(allrows.length>3){
			var nInp = allrows[allrows.length-2].getElementsByTagName('input');
			//alert(nInp.length);
			//var nInp = nRow.getElementsByTagName('input');
			nInp[3].removeAttribute('disabled');
		}
		var i=r.parentNode.parentNode.rowIndex;
		//var i=r.rowIndex;
		document.getElementById('id_tbl_property').deleteRow(i);		
}

function deleteRow(r){
		var i=r.parentNode.parentNode.rowIndex;
		document.getElementById('id_tbl_property').deleteRow(i);
		var tot=document.getElementById('PropertyTotal').value;
		tot=tot-1;
		document.getElementById('PropertyTotal').value=tot;
		
}
/* delete row */

/* Google maps functionalities */

var map1;
function loadMap(lat,lon,method) {
	if (GBrowserIsCompatible()) {
	
	map1 = new GMap2(document.getElementById("map"));//document.getElementById
   //alert(method);
  var address=readCookie('cadd');
  //alert(address);
  if(address!=null && method=='post'){
  	//setTimeout('settingPostAddress("'+address+'")',100);
	settingPostAddress(address);
	window.setTimeout('',100);
	delay(100);
	
  }else{
  	  	
		  //map1.setCenter(new GLatLng(37.4419, -122.1419), 13);
		  	if(method=='edit'){
				lat = document.getElementById("AdLocationlat").value;
				lon = document.getElementById("AdLocationlon").value;
			}
			map1.clearOverlays();
		  	var icon = new GIcon();
			icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
			icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			icon.iconSize = new GSize(12, 20);
			icon.shadowSize = new GSize(22, 20);
			icon.iconAnchor = new GPoint(6, 20);
			icon.infoWindowAnchor = new GPoint(5, 1);
			map1.setCenter(new GLatLng(lat,lon),3);
		  	map1.addControl(new GMapTypeControl());
		 	map1.addControl(new GLargeMapControl());

/////Draggable markers

			var point = new GLatLng(lat,lon);
			var markerD = new GMarker(point, {icon:icon, draggable: true}); 
			map1.addOverlay(markerD);

			markerD.enableDragging();
			map1.checkResize();
			map1.panTo(new GLatLng(lat,lon));
			

			GEvent.addListener(markerD, "drag", function(){
			var temp=markerD.getPoint().toUrlValue();
			var latlong = temp.split(",");
			document.getElementById("AdLocationlat").value=parseFloat(latlong[0]);
			document.getElementById("AdLocationlon").value=parseFloat(latlong[1]);
			
			
			});
			
			GEvent.addListener(map1,"zoomend", function(oldLevel, newLevel) 
			{
				//alert('test');
				map1.panTo(new GLatLng(lat,lon));
			}); 
					
			map1.checkResize();
			map1.panTo(new GLatLng(lat,lon));
			
	  }
  }
	
}


function settingPostAddress(address){

	if(address!=null){
	var geocoder = new GClientGeocoder();
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " Home place not set");
			   return false;
			   } else {
				slat=point.lat();
				slon=point.lng();
				map1.clearOverlays();
				map1.setCenter(new GLatLng(slat,slon),5);
  //map1.setCenter(new GLatLng(37.4419, -122.1419), 13);
				map1.addControl(new GMapTypeControl());
				map1.addControl(new GLargeMapControl());
				var icon = new GIcon();
				icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
				icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
				icon.iconSize = new GSize(12, 20);
				icon.shadowSize = new GSize(22, 20);
				icon.iconAnchor = new GPoint(6, 20);
				icon.infoWindowAnchor = new GPoint(5, 1);
				
				
				
				/////Draggable markers
				
				
				var point = new GLatLng(slat,slon);
				var markerD = new GMarker(point, {icon:icon, draggable: true}); 
				map1.addOverlay(markerD);
				
				markerD.enableDragging();
			
				
				GEvent.addListener(markerD, "drag", function(){
				var temp=markerD.getPoint().toUrlValue();
				var latlong = temp.split(",");
				document.getElementById("AdLocationlat").value=parseFloat(latlong[0]);
				document.getElementById("AdLocationlon").value=parseFloat(latlong[1]);
			});
				
				
				
				
				map1.checkResize();
				map1.panTo(new GLatLng(slat,slon));
				
				
				//alert(slat);
				//alert(slon);
			}
          }
        ); 
		delay(100);
      }
	
	 }


}


function delay(gap){ /* gap is in millisecs */
//alert("test");
var then,now; then=new Date().getTime();
now=then;
while((now-then)<gap)
{now=new Date().getTime();}
}
	

function ad_map(lon,lat){
	if (GBrowserIsCompatible()) {
		map1 = new GMap2(document.getElementById("map"));
	  //map.enableScrollWheelZoom();
		map1.setCenter(new GLatLng(lon,lat), 10);
		var point = new GLatLng(lon,lat);
		map1.addOverlay(new GMarker(point));
		map1.addControl(new GSmallMapControl());
	}

}
/* end of the google maps */


/* Ads Validations */

function postads_valid(){
	if(document.getElementById('AdLocationlat').value==""){
		alert('Please move the red marker on the map to the ad location.');
		return false;
	}
	if(document.getElementById('AdLocationlon').value==""){
		alert('Please Select the place in the map');
		document.getElementById('AdLocationlon').focus();
		return false;
	}
	if(document.getElementById('AdName').value==""){
		alert('Please Enter the Ad name');
		document.getElementById('AdName').focus();
		return false;
	}
	if(document.getElementById('AdCategory').value==0){
		alert('Please select the Category name');
		document.getElementById('AdCategory').focus();
		return false;
	}
	if(document.getElementById('AdKeywords').value==""){
		alert('Please Enter the keyword');
		document.getElementById('AdKeywords').focus();
		return false;
	}
	if(document.getElementById('AdDescription').value==""){
		alert('Please Enter the Description');
		document.getElementById('AdDescription').focus();
		return false;
	}
	if(document.getElementById('AdAddress').value==""){
		alert('Please Enter the address');
		document.getElementById('AdAddress').focus();
		return false;
	}
	if(document.getElementById('AdZipcode').value==""){
		alert('Please Enter the Zipcode');
		document.getElementById('AdZipcode').focus();
		return false;
	}
	var files = document.getElementsByTagName("input");
	for (var i = 0; i < files.length; i++) {
		//alert(files[i].value);
	if (files[i].type == "file" && files[i].value!="" && files[i].value.indexOf(".jpg") == -1 && files[i].value.indexOf(".jpeg") == -1 && files[i].value.indexOf(".gif") == -1 && files[i].value.indexOf(".JPG") == -1 && files[i].value.indexOf(".GIF") == -1) {
		alert("Please select only jpeg,gif images");
		return false;
	}
	}
	if(document.getElementById('AdContactemail').value!=""){
	if(echeck(document.getElementById('AdContactemail').value)){
	//alert("process");
	process();
	return true;
	}
	else{
		document.getElementById('AdContactemail').focus();
		return false;
	}
	}
	
	if(document.getElementById('terms_policy').checked==false){
		alert('You should accept the Terms of Use & Privacy Policy to continue further');
		document.getElementById('terms_policy').focus();
		return false;
	}
	
	process();
	return true;
}

function bannerads_valid(){
	if(document.getElementById('AdName').value==""){
		alert('Please Enter the Ad name');
		document.getElementById('AdName').focus();
		return false;
	}
	if(document.getElementById('AdCategory').value==0){
		alert('Please select the Category name');
		document.getElementById('AdCategory').focus();
		return false;
	}
	if(document.getElementById('AdKeywords').value==""){
		alert('Please Enter the keyword');
		document.getElementById('AdKeywords').focus();
		return false;
	}
	if(document.getElementById('AdBannerad').value==""){
		alert('Please paste the banner script');
		document.getElementById('AdBannerad').focus();
		return false;
	}
	if(document.getElementById('terms_policy').checked==false){
		alert('You should accept the Terms of Use & Privacy Policy to continue further');
		document.getElementById('terms_policy').focus();
		return false;
	}
		
	return true;
}


/* End of the validations */

/* Loading image function */
function process()
{
document.getElementById('Layer1').style.display = 'block';
}
/* end of it */


 /* phone number validations numeric check*/ 
function check_numeric(e,validchars){
 var key='', keychar='';
 key = getKeyCode(e);
 if (key == null) return true;
 keychar = String.fromCharCode(key);
 keychar = keychar.toLowerCase();
 validchars = validchars.toLowerCase();
 if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
 return true;
 if (validchars.indexOf(keychar) != -1){
	return true;
 }else{
 	alert("Please enter numeric value");
	return false;
 }
 
}

function getKeyCode(e)
{
 if (window.event)
    return window.event.keyCode;
 else if (e)
    return e.which;
 else
    return null;
}

/* numeric check */


/* Bussiness profile validations */

function business_valid(){
	
	if(document.getElementById('BusinessName').value==""){
		alert('Please enter the business name');
		document.getElementById('BusinessName').focus();
		return false;
	}
	if(document.getElementById('BusinessFirstname').value==""){
		alert('Please enter the first name');
		document.getElementById('BusinessName').focus();
		return false;
	}
	if(document.getElementById('BusinessLastname').value==""){
		alert('Please enter the last name');
		return false;
	}
	
	if(echeck(document.getElementById('BusinessEmail').value))
	return true;
	else{
		document.getElementById('BusinessEmail').focus();
		return false;
	}
}

/* end of business */

/* User edit validations */

function user_valid(){
	if(document.getElementById('UserFirstname').value==""){
		alert('Please enter the First name');
		document.getElementById('UserFirstname').focus();
		return false;
	}
	if(document.getElementById('UserLastname').value==""){
		alert('Please enter the Last name');
		document.getElementById('UserLastname').focus();
		return false;
	}
	if(document.getElementById('UserLoginname').value==""){
		alert('Please enter the Login name');
		document.getElementById('UserLoginname').focus();
		return false;
	}
	
	return true;
	

}

/* end of user validations */

/* Email check */
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		 return true;
}

/* end of email check */


function search_sort(pval){

		
	var spath = "/searches/detail_result/";
	var url ="http://"+host+spath;
		
	var paginationPage;

	var paginationShow;
	
	if(pval!=-1){
		
		paginationPage = pval;
	
	} else {
	
		paginationPage = document.getElementById('paginationPage').value;
	
	}

	paginationShow = document.getElementById('paginationShow').value;
	
	sortby = document.getElementById('SearchSortby').value;
	
	window.location= url+"?sortby="+sortby+"&page="+paginationPage+"&show="+paginationShow;
}




/* promotional code */
function pcode_check(){
	if(document.getElementById('PusercodePcode').value==""){
		alert("Enter the Promotional code");
		return false;
	}
	return true;
}


function package_validation(){
	
	len = document.getElementsByTagName("input");

	//alert(len.length);
	for(i=0;i<len.length;i++){
	//alert(len[i].id);
	if(len[i].type=="radio" && len[i].checked==true){
		
			if(document.getElementById("PackageProcode").value!=""){
				alert("Please select package or use promotional code");
				return false;
			}else{
				return true;
			}
			
		}
	}
	if(document.getElementById("PackageProcode").value==""){
		alert("Please enter the promotional code to post free ads");
		document.getElementById("PackageProcode").focus();
		return false; 
	}
	return true ;
}


/* Edit subcat */

function editsubcat(obj,controller){
	
	var pid=obj.value;
	
	divid = "subcat";
	
	try{
	
		
	var spath = "";
	
	if(controller=="edit")
	
	spath = "/ads/editsubcat/";
	
	else
	
	spath = "/searches/searchsubcat/";
	
	if( pid == "Reset"){
		
	//alert(pid);
	
	divid = "maincat"; 
	
	spath = "/searches/maincat/";
	
	}
	
	
	var url ="http://"+host+spath+pid;
				
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: editshowResponse
			});
	}catch(e){
		//alert(e);
	}
}
function editshowResponse(originalRequest)
	{
		document.getElementById('clear').innerHTML="";
		document.getElementById('subcat').innerHTML="";
		document.getElementById('s_scat').innerHTML="";
		document.getElementById('ss_scat').innerHTML="";
		document.getElementById('sss_scat').innerHTML="";
		document.getElementById('ssss_scat').innerHTML="";
		document.getElementById('sssss_scat').innerHTML="";
		document.getElementById('ssssss_scat').innerHTML="";
		document.getElementById(divid).innerHTML="";
		document.getElementById(divid).innerHTML = originalRequest.responseText;
	}

/* end of edit subcat */

var divid;

/* Subcategory two */

function s_scat(obj,controller){
	
	var pid=obj.value;
	
	divid = "s_scat";
	
	
	try{
		
	var spath = "";
	
	if(controller!="search"){
	
	spath = "/ads/s_scat/";
	
	}else{
	
	spath = "/searches/s_scat/";
	
	}
	var url ="http://"+host+spath+pid;
		
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: showResponse
			});
	}catch(e){
		//alert(e);
	}
}
function showResponse(originalRequest)
	{
		document.getElementById(divid).innerHTML="";
		document.getElementById(divid).innerHTML = originalRequest.responseText;
	}



/* SubCategory three */


var divid1="";
function ss_scat(obj,div_id,controller){

	var spath = "/ads/ss_scat/";
	var spath1 = "/searches/ss_scat/";
	
	var pid=obj.value;
	divid1=div_id;
	if(controller=="post"){
	var url ="http://"+host+spath+pid;
	}else{
	
		var url ="http://"+host+spath1+pid;
	}
		
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: showResponse1
			});
		
}

function showResponse1(originalRequest)
	{
		document.getElementById(divid1).innerHTML="";
		document.getElementById(divid1).innerHTML = originalRequest.responseText;
	}

/* End of it */

/* SubCategory four */

var divid2="";
function sss_scat(obj,div_id,controller){
	
	var spath = "/ads/sss_scat/";
	var spath1 = "/searches/sss_scat/";
	
	
	var pid=obj.value;
	divid2=div_id;
	if(controller=="post"){
	var url ="http://"+host+spath+pid;	
	}else{
	var url ="http://"+host+spath1+pid;	
	}
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: showResponse2
			});
		
}


function showResponse2(originalRequest)
	{
		document.getElementById(divid2).innerHTML = originalRequest.responseText;
	}

/* End of it */

/* SubCategory five */

var divid3="";

function ssss_scat(obj,div_id,controller){
	
	var spath = "/ads/ssss_scat/";
	var spath1 = "/searches/ssss_scat/";
	var pid=obj.value;
	divid3=div_id;
	
	if(controller=="post"){
	var url ="http://"+host+spath+pid;
	}
	else{
	var url ="http://"+host+spath1+pid;
	}
	
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: showResponse3
			});
		
}

function showResponse3(originalRequest)
	{
		document.getElementById(divid3).innerHTML = originalRequest.responseText;
	}

/* End of it */




/* SubCategory six */

var divid4="";

function sssss_scat(obj,div_id,controller){

	var spath = "/ads/sssss_scat/";
	var spath1 = "/searches/sssss_scat/";
		
	var pid=obj.value;
	divid4=div_id;
	if(controller=="post"){
	var url ="http://"+host+spath+pid;
	}else{
	var url ="http://"+host+spath1+pid;
	}
		
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: showResponse4
			});
		
}

function showResponse4(originalRequest)
	{
		document.getElementById(divid4).innerHTML = originalRequest.responseText;
	}

/* End of it */

/* Book mark Add to favourites */

function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}	
/* end of favourties */


/* Text Area Max length checking */
function imposeMaxLength(e,Object, MaxLen)
{
  key = getKeyCode(e);
  if ( key==null || key==0 || key==8 || key==9 || key==13 || key==27 )
 return true;
 else{
  if(Object.value.length >= MaxLen){
  var msg = "Maximum "+ MaxLen +" characters";
  alert(msg);
  return false;
  }
  return true;
 }
}
/* Maximum length */

/* upgrade  functionality added on 21-11-2008 */

function upgrade_ad(up_down){

	var amt = document.getElementById('packamt').value;
	if(amt=="Free")
	amt=0;
	spath = "/ads/upgrade_ad/"+amt+"/"+up_down;
	var url ="http://"+host+spath;
	try{
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get',
				onComplete: upgradeResponse
			});
	}catch(e){
		//alert(e);
	}
}
function upgradeResponse(originalRequest)
{
	document.getElementById('upgrade').innerHTML="";
	document.getElementById('upgrade').innerHTML = originalRequest.responseText;
}

/* end of upgrade  21-11-08 */

/* cookie function from */

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
	
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function lock_homeaddress(){
	var name="locklatlonval";
	var country="";
	var city="";
	var newLat = document.getElementById("SearchHlat").value;
	var newLon = document.getElementById("SearchHlon").value;
	city = document.getElementById("SearchCity").value;
    country = document.getElementById("SearchCountry").value;
	var locklatlonval=newLat+","+newLon+","+city+","+country;
	createCookie(name,locklatlonval,30);
	alert("Your Home area has been saved!");
}

/* end of cookie functions */



/* validation for upgradation */

function package_upgradation(){
	
	var check=0;
	len = document.getElementsByTagName("input");
	for(i=0;i<len.length;i++){
		if(len[i].type=="radio" && len[i].checked==true){
				return true;
		}
	}
	alert("Please select package to upgrade ");
	return false;
	
}

/* end validation for upgradation */

/* premium ads */
function premiumadsUpdate(){
	var newLat = document.getElementById("SearchHlat").value;
	var newLon = document.getElementById("SearchHlon").value;
	var category = document.getElementById("categoryid").value ;
	spath = "/users/premiumadsupdate/"+newLat+"/"+newLon+"/"+category;
	var url ="http://"+host+spath;
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				onComplete: premiumResponse
			});
	
}

function premiumResponse(originalRequest)
{
	document.getElementById('premiumUpdate').innerHTML="";
	document.getElementById('premiumUpdate').innerHTML = originalRequest.responseText;
}
/* end of premium ads */


function setFocus(){
	document.getElementById('SearchCity').focus();
	document.getElementById('SearchCity').value+='';
}