
function setSearchMenuTab2(ulid,tabid){
	var ulobj=getObject(ulid);
	var lis=ulobj.getElementsByTagName("li");
	for(var i = 0; i < lis.length; i++) {
    	if(undefined != lis[i].id && lis[i].id==tabid){setClassName(lis[i],'tab current');}
    	else{setClassName(lis[i],'tab');}
	}
}
function freeListing(){
	//show free listing window
	return centerPop('freelisting','_template=5');
	}
function changeCity(){
	return centerPop('changeCity','');
	}
function contactUs(){
	//show free listing window
	return centerPop('contact','_template=5');
	}
function privacyPolicy(){
	//show free listing window
	return centerPop('privacypolicy','_template=5');
	}
function bookAppointment(cid){
	//show free listing window
	return centerPop('bookAppointment','contact_id='+cid,700);
	}
function viewReviews(cid){
	//show free listing window
	return centerPop('viewReviews','contact_id='+cid,700);
	}
function quickReview(cid){
	//show free listing window
	return centerPop('quickReview','contact_id='+cid,500);
	}
function centerFade(t){
	setTimeout("fadeId('centerpop',1)",t);
	}
function addReview(cid){
	//show free listing window
	return centerPop('addReview','contact_id='+cid);
	}
function mapLoad(lat,lon,active,zoom){
	if(undefined==active){active=0;}
	if(undefined==zoom){zoom=11;}
	var myLatlng = new google.maps.LatLng(lat,lon);
	var myOptions = {
		zoom: zoom,
		center: myLatlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
		}
    map = new google.maps.Map(document.getElementById("googlemap_canvas"), myOptions);
    //add a listener to redraw when the map is moved
    google.maps.event.addListener(map, 'dragend', function() {
    	var LatLon=map.getCenter();
    	var lat=LatLon.lat();
    	var lon=LatLon.lng();
    	mapMove(lat,lon,active);
    	});
	}
function mapMove(lat,lon,active){
	//show free listing window
	if(undefined == active){active=0;}
	ajaxGet('/movemap','null','lat='+lat+'&lon='+lon+'&active='+active);
	}
function mapMarker(lat,lon,mtitle,mlink,img){
	//http://blog.mridey.com/2010/03/using-markerimage-in-maps-javascript.html
 	var myLatlng = new google.maps.LatLng(lat,lon);
 	if(undefined != img){
		//use a custom image as a marker
		var image = new google.maps.MarkerImage(img,
      		// This marker is 67 pixels wide by 80 pixels tall.
      		new google.maps.Size(67, 80),
      		// The origin for this image is 0,0.
      		new google.maps.Point(0,0),
      		// The anchor for this image is the base of the flagpole at 0,32.
      		new google.maps.Point(33, 75));
		var marker = new google.maps.Marker({
	 		position: myLatlng,
	 		map: map,
	 		icon: image,
	 		//shadow: icon,
	 		title:mtitle
			});
		}
	else{
		var marker = new google.maps.Marker({
	 		position: myLatlng,
	 		map: map,
	 		title:mtitle
			});
        	}
	google.maps.event.addListener(marker, "click", function() {
      	window.location=mlink;
    	});
    return true;
	}
function centerPop(page,opts,pwidth){
	if(undefined == pwidth){pwidth=400;}
	ajaxGet('/'+page,'centerpop',opts);
	return false;
	//ajaxPopup('/'+page,opts,{id:"centerpop",width:pwidth,drag:1,notop:1,nobot:1,noborder:1,nobackground:1,bodystyle:"padding:0px;border:0px;background:none;"});
	//return false;
	}
/* AJAX Star Rating : v1.0.3 : 2008/05/06 */
/* http://www.nofunc.com/AJAX_Star_Rating/ */

function c(v,o) { return((typeof(o)=='object'?o:document).getElementById(v)); }
function $S(o) { return((typeof(o)=='object'?o:c(o)).style); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function abPos(o) { var o=(typeof(o)=='object'?o:c(o)), z={X:0,Y:0}; while(o!=null) { z.X+=o.offsetLeft; z.Y+=o.offsetTop; o=o.offsetParent; }; return(z); }
function XY(e,v) { var o=agent('msie')?{'X':event.clientX+document.body.scrollLeft,'Y':event.clientY+document.body.scrollTop}:{'X':e.pageX,'Y':e.pageY}; return(v?o[v]:o); }
star={};
star.mouse=function(e,o) { if(star.stop || isNaN(star.stop)) { 
	star.stop=0;
	document.onmousemove=function(e) {
		var n=star.num;
		var p=abPos(c('star'+n)), x=XY(e), oX=x.X-p.X, oY=x.Y-p.Y; 
		star.num=o.id.substr(4);
		if(oX<1 || oX>84 || oY<0 || oY>19) { star.stop=1; star.revert(); }
		else{
			$S('starCur'+n).width=oX+'px';
			$S('starUser'+n).color='#111';
			c('starUser'+n).innerHTML=Math.round(oX/84*100)+'%';
			}
		};
	} };
star.update=function(e,o) {
	var n=star.num, v=parseInt(c('starUser'+n).innerHTML);
	n=o.id.substr(4);
	c('starCur'+n).title=v;
	var vote=+(v/100);
	ajaxGet('/starvote','null','vote='+vote);
	//req=new XMLHttpRequest(); req.open('GET','/starvote?vote='+(v/100),false); req.send(null);
	};
star.setfld=function(e,o,setfld) {
	var n=star.num, v=parseInt(c('starUser'+n).innerHTML);
	n=o.id.substr(4);
	c('starCur'+n).title=v;
	var vote=+(v/100);
	setfld.value=vote;
	};
star.revert=function() {
	var n=star.num, v=parseInt(c('starCur'+n).title);
	$S('starCur'+n).width=Math.round(v*84/100)+'px';
	c('starUser'+n).innerHTML=(v>0?Math.round(v)+'%':'');
	c('starUser'+n).style.color='#888';
	document.onmousemove='';
	};

star.num=0;
