
function LiteMarker(point,icon,hoverText,json){this.point=point;this.icon=icon;this.hoverText=hoverText;this.zIndex=1000;this.json=json;this.opacity=.7;var agent=navigator.userAgent.toLowerCase();if((agent.indexOf("msie")>-1)&&(agent.indexOf("opera")<1)){this.ie=true}else{this.ie=false}}
LiteMarker.prototype=new GOverlay();LiteMarker.prototype.initialize=function(map){var div=document.createElement("div");div.style.position="absolute";div.style.zIndex=this.zIndex;map.getPane(G_MAP_MARKER_PANE).appendChild(div);this.map_=map;this.div_=div;if(isDefined(this.secondIcon)){var secondDiv=document.createElement("div");secondDiv.style.position="absolute";secondDiv.style.zIndex=this.zIndex-10;this.secondDiv_=secondDiv;map.getPane(G_MAP_MARKER_PANE).appendChild(secondDiv);}
if(this.hoverText!=null){this._mouseoverhandle=GEvent.bindDom(this.div_,"mouseover",this,this.onMouseOver);this._mouseouthandle=GEvent.bindDom(this.div_,"mouseout",this,this.onMouseOut);}
this._clickhandle=GEvent.bindDom(this.div_,"click",this,this.onClick);if(mapApp.useGlobalMapHandler){GEvent.bindDom(this.div_,"mousedown",this,this.onMouseDown);GEvent.bindDom(this.div_,"mouseup",this,this.onMouseUp);}}
LiteMarker.prototype.onMouseOver=function(t){this.div_.style.cursor='pointer';this.showTooltip();}
LiteMarker.prototype.changeIcon=function(newimage){this.icon.image=newimage;this.redraw(true)}
LiteMarker.prototype.showTooltip=function(){if(!this.tooltipObject){this.tooltipObject=document.createElement("div");this.tooltipObject.style.display="none";this.tooltipObject.style.position="absolute";this.tooltipObject.style.background="#fff";this.tooltipObject.style.padding="0";this.tooltipObject.style.margin="0";this.tooltipObject.style.MozOpacity=this.opacity;this.tooltipObject.style.filter="alpha(opacity="+this.opacity*100+")";this.tooltipObject.style.opacity=this.opacity;this.tooltipObject.style.zIndex=50000;this.tooltipObject.innerHTML="<div class=\"markerTooltip\">"+this.hoverText+"</div>";this.map_.getPane(G_MAP_MARKER_PANE).appendChild(this.tooltipObject);}
var c=this.map_.fromLatLngToDivPixel(this.point);try{this.tooltipObject.style.top=c.y-(this.icon.iconAnchor.y+5)+"px";this.tooltipObject.style.left=c.x+(this.icon.iconSize.width-this.icon.iconAnchor.x+5)+"px";this.tooltipObject.style.display="block";}catch(e){alert(e);}}
LiteMarker.prototype.onMouseOut=function(){this.div_.style.cursor='auto';if(this.tooltipObject){this.tooltipObject.style.display="none";}}
LiteMarker.prototype.onClick=function(e){GEvent.trigger(this,"click");}
LiteMarker.prototype.remove=function(){try{this.div_.parentNode.removeChild(this.div_);if(isDefined(this.secondDiv_)){this.secondDiv_.parentNode.removeChild(this.secondDiv_);}
if(this.hoverText!=null){GEvent.removeListener(this._mouseoverhandle);GEvent.removeListener(this._mouseouthandle);}
GEvent.removeListener(this._clickhandle);}catch(e){}}
LiteMarker.prototype.setSecondaryIcon=function(secondIcon,secondIconOffset)
{this.secondIcon=secondIcon;this.secondIconOffset=secondIconOffset;}
LiteMarker.prototype.redraw=function(force){if(force){var centerdiv=this.map_.fromLatLngToDivPixel(this.point);this._divpixelcenter=centerdiv;var w=(this.icon.iconSize.width);var h=(this.icon.iconSize.height);this.div_.style.left=(centerdiv.x)-w/2+"px";this.div_.style.top=(centerdiv.y)-h/2+"px";w=w+'px';h=h+'px';var isPNG=this.png;if(this.ie&&isPNG){var loader="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.icon.image+"', sizingMethod='scale');";var innerHTML='<div style="height:'+h+'; width:'+w+'; '+loader+'" ></div>';this.div_.innerHTML=innerHTML;}else{this.div_.innerHTML='<img src="'+this.icon.image+'"  width='+w+' height='+h+' >';}
if(isDefined(this.secondIcon)){var w2=(this.secondIcon.iconSize.width);var h2=(this.secondIcon.iconSize.height);this.secondDiv_.style.left=this.secondIconOffset.width-w2/2+(centerdiv.x)+"px";this.secondDiv_.style.top=this.secondIconOffset.height-h2/2+(centerdiv.y)+"px";w2=w2+'px';h2=h2+'px';if(this.ie&&isPNG){var loader="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+this.secondIcon.image+"', sizingMethod='scale');";var innerHTML='<div style="height:'+h2+'; width:'+w2+'; '+loader+'" ></div>';this.secondDiv_.innerHTML=innerHTML;}else{this.secondDiv_.innerHTML='<img src="'+this.secondIcon.image+'"  width='+w2+' height='+h2+' >';}}}}
LiteMarker.prototype.show=function(){this.div_.style.display="";if(isDefined(this.secondDiv_)){this.secondDiv_.style.display="";}}
LiteMarker.prototype.hide=function(){this.div_.style.display="none";if(isDefined(this.secondDiv_)){this.secondDiv_.style.display="none";}}
LiteMarker.prototype.getZIndex=function(lat){return this.zIndex;}
LiteMarker.prototype.touches=function(markerB){var me=this._divpixelcenter;var it=markerB._divpixelcenter;return(Math.abs(me.x-it.x)<23&&Math.abs(me.y-it.y)<27);}
LiteMarker.prototype.onMouseDown=function(e){if(navigator.userAgent.toLowerCase().indexOf("msie")!=-1&&document.all)
{window.event.cancelBubble=true;window.event.returnValue=false}
else{e.preventDefault();e.stopPropagation()}}
LiteMarker.prototype.onMouseUp=function(e){GEvent.trigger(this,"mouseup",this)}