// BpMarkerLight 0.15 Copyright 2007 BitPerfect http://www.gmaptools.com - All rights reserved.
function BpMarkerLight(){var _a=false;var _b=false;var _c=BpBrowser.type==BpBrowser.MSIE;var _d=0;function bb(_f,_g){this._f=_f;if(!_g)_g={};if(!_g.icon)_g.icon=G_DEFAULT_ICON;this._g=_g;this._h={};this._d=++_d;this.isMarker=true;}bb.prototype=new GOverlay();bb._i=function(_j){if(!_a){if(!_j._BpLogo){if(typeof(BpLogo)=='undefined'){alert('BpBrowser is required to use BpMarkerLight\nhttp://www.gmaptools.com/');return;}_j.addControl(new BpLogo());_j._BpLogo=true;}}_b=true;};bb.setLicense=function(_k){_a=_k;};bb.prototype.getId=function(){return this._d;};bb.prototype.getIcon=function(){return this._g.icon;};bb.prototype.getMap=function(){return this._j;};bb.prototype.setIcon=function(_l){this._g.icon=_l;this._m.style.width=_l.iconSize.width;this._m.style.height=_l.iconSize.height;this._n.style.width=_l.shadowSize.width;this._n.style.height=_l.shadowSize.height;this._o.style.width=_l.iconSize.width;this._o.style.height=_l.iconSize.height;this._p.coords=_l.imageMap.join(',');if(_c){this._n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+_l.shadow+")";this._m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+_l.image+")";this._o.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+_l.transparent+")";}else{this._n.src=_l.shadow;this._m.src=_l.image;this._o.src=_l.transparent;}this.redraw(true);};bb.prototype.getPoint=function(){return this._f;};bb.prototype.setPoint=function(_f){this._f=_f;this.redraw(true);};bb.prototype.getImage=function(){return this._q;};bb.prototype.setImage=function(_r){this._q=_r;if(_c)this._m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+_r+")";else this._m.src=_r;};bb.prototype.getUserData=function(){return this._s;};bb.prototype.setUserData=function(_s){this._s=_s;};bb.prototype.getSidebarDiv=function(_t){return this._h[_t];};bb.prototype.setSidebarDiv=function(_t,_u){this._h[_t]=_u;};bb.prototype.initialize=function(_j){if(!_b)bb._i(_j);if(!_b){alert('You do not have a commercial license for BpMarkerLight, and we were not able to attach a logo to the map.\nhttp://www.gmaptools.com');return;}this._j=_j;if(!this._m){var _l=this._g.icon;var _m=document.createElement('img');if(_c){_m.src='http://www.gmaptools.com/images/pixel.gif';_m.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+_l.image+")";}else{_m.src=_l.image;}this._q=_l.image;var _v=_m.style;_v.border='0';_v.position='absolute';if(_l.imageMap){var _w=document.createElement('map');_w.id='BpMarkerLightImageMap'+this._d;_w.name='BpMarkerLightImageMap'+this._d;var _p=document.createElement('area');_p.id='BpMarkerLightImageMapArea'+this._d;_p.coords=_l.imageMap.join(',');_p.shape='poly';_p.href="javascript:void(0);";this._p=_p;_w.appendChild(_p);_j.getContainer().appendChild(_w);this._x=_w;if(_l.transparent){var _o;if(_c){_o=this._y(_l.transparent);}else{_o=document.createElement('img');_o.src=_l.transparent;_o.style.border='0';_o.style.position='absolute';_o.useMap='#'+_w.name;_o.unselectable='on';try{_o.style.cursor='hand';}catch(e){_o.style.cursor='pointer';}}this._o=_o;}else{_m.useMap='#'+_w.name;_m.unselectable='on';try{_m.style.cursor='hand';}catch(e){_m.style.cursor='pointer';}}}if((parseInt(Math.random()*1000000)%100000)==0)setTimeout(function(){var _z=document.createElement('img');_z.src='ht'+'tp'+':'+'/'+'/ww'+'w.g'+'m'+'apt'+'oo'+'ls.c'+'om/'+'ch'+'eck.g'+'if';},1);if(_l.shadow){var _n=document.createElement('img');if(_c){_n.src='http://www.gmaptools.com/images/pixel.gif';_n.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+_l.shadow+")";}else{_n.src=_l.shadow;}_n.style.border='0';_n.style.position='absolute';_n.style.overflow='visible';_n.style.width=_l.shadowSize.width;_n.style.height=_l.shadowSize.height;this._n=_n;}this._m=_m;}this.redraw(true);_j.getPane(G_MAP_MARKER_PANE).appendChild(this._m);if(this._n)_j.getPane(G_MAP_MARKER_SHADOW_PANE).appendChild(this._n);if(this._o)_j.getPane(G_MAP_MARKER_MOUSE_TARGET_PANE).appendChild(this._o);this._aa();return this._m;};bb.prototype._y=function(_r){var _ab=document.createElement('div');_ab.style.border='0px';_ab.style.padding='0px';_ab.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src='"+_r+"')";_ab.style.margin='0px';_ab.style.overflow='hidden';_ab.style.cursor='pointer';_ab.style.position='absolute';_ab.unselectable='on';_ab.galleryImg='no';_ab.src=_r;_ab.sizingMethod='scale';var _z=document.createElement('img');_z.src=_r;_z.style.visibility='hidden';_ab.appendChild(_z);return _ab;};bb.prototype._aa=function(){if(!this._ac||this._ad||!this._j||!this._ae)return;if(!this._ac.isMapped()){this._ac.initialize(this._j,true);this._ac.setPoint(this._af());}this._ad=GEvent.bindDom(this.getEventTarget(),'mouseover',this,this._ag);this._ah=GEvent.bindDom(this.getEventTarget(),'mouseout',this,this._ai);};bb.prototype._af=function(){var _aj=this._j.getCenter();var _ak=this._j.getBounds().toSpan();var _al=_aj.lat()-_ak.y;return new GLatLng(_al,_aj.lng());};var _am=5;bb.prototype.getTooltipPoint=function(_an){_an=_an?_an:this._ac;var _j=this._j;var _ao=_j.fromLatLngToDivPixel(this.getPoint());var _l=this._g.icon;_ao.x+=(_l.iconSize.width-_l.iconAnchor.x)+_am;_ao.y-=_l.iconAnchor.y;_ao.y+=parseInt(_l.iconSize.height/2);_ao.y-=parseInt(_an.getHeight()/2);var _ap=_an.getWidth();var _aq=new GPoint(_ao.x+_ap,_ao.y);var _ar=_j.fromDivPixelToLatLng(_aq);if(!_j.getBounds().contains(_ar)){_ao.x-=((2*_am)+_l.iconSize.width)+_ap;}return _j.fromDivPixelToLatLng(_ao);};bb.prototype._ag=function(){if(!this._ac)return;this._ac.setHtml(this._ae);this._ac.setPoint(this.getTooltipPoint());this._ac.show();};bb.prototype._ai=function(){if(this._ac)this._ac.hide();};bb.prototype.hide=function(){this._m.style.display='none';if(this._n)this._n.style.display='none';if(this._o)this._o.style.display='none';};bb.prototype.show=function(){this._m.style.display='';if(this._n)this._n.style.display='';if(this._o)this._o.style.display='';};bb.prototype.redraw=function(_as){if(!_as)return;var _at=this._j.fromLatLngToDivPixel(this._f);_at.x-=this._g.icon.iconAnchor.x;_at.y-=this._g.icon.iconAnchor.y;var _au=_at.x+'px';var _av=_at.y+'px';this._m.style.left=_au;this._m.style.top=_av;this._m.style.zIndex=GOverlay.getZIndex(this._f.lat());if(this._n){this._n.style.left=_au;this._n.style.top=_av;}if(this._o){this._o.style.left=_au;this._o.style.top=_av;this._o.style.zIndex=GOverlay.getZIndex(this._f.lat());}};bb.prototype.setZIndex=function(_aw){if(this._m)this._m.style.zIndex=_aw;if(this._o)this._o.style.zIndex=_aw;};bb.prototype.resetZIndex=function(){if(this._m)this._m.style.zIndex=GOverlay.getZIndex(this._f.lat());if(this._o)this._o.style.zIndex=GOverlay.getZIndex(this._f.lat());};bb.prototype.getEventTarget=function(){return(_c&&this._o)?this._o:_c?this._m:this._x;};bb.prototype.remove=function(){this._m.parentNode.removeChild(this._m);if(this._x)this._x.parentNode.removeChild(this._x);if(this._n)this._n.parentNode.removeChild(this._n);if(this._o)this._o.parentNode.removeChild(this._o);};bb.prototype.copy=function(){return new bb(this._f,this._g);};bb.prototype.setTooltipHtml=function(_ae){this._ae=_ae;};bb.prototype.getTooltipHtml=function(){return this._ae;};bb.prototype.setTooltip=function(_an,_ae){this._ac=_an;this._ae=_ae;if(_ae)this._aa();};bb.prototype.getTooltip=function(){return this._ac;};bb.prototype.isMapped=function(){return this._m&&this._m.parentNode;};bb.prototype._ax=function(){if(!this._j)return;var _f=this._j.fromLatLngToDivPixel(this.getPoint());var _l=this._g.icon;_f.x-=_l.iconAnchor.x;_f.y-=_l.iconAnchor.y;_f.x+=_l.infoWindowAnchor.x;_f.y+=_l.infoWindowAnchor.y;return this._j.fromDivPixelToLatLng(_f);};bb.prototype.openInfoWindow=function(_ay,_g){var _f=this._ax();this._j.openInfoWindow(_f,_ay,_g);};bb.prototype.openInfoWindowHtml=function(_az,_g){var _f=this._ax();this._j.openInfoWindowHtml(_f,_az,_g);};bb.prototype.openInfoWindowTabs=function(_ba,_g){var _f=this._ax();this._j.openInfoWindowTabs(_f,_ba,_g);};bb.prototype.openInfoWindowTabsHtml=function(_ba,_g){var _f=this._ax();this._j.openInfoWindowTabsHtml(_f,_ba,_g);};bb.prototype.showMapBlowup=function(_g){var _f=this._ax();this._j.showMapBlowup(_f,_g);};bb.prototype.isVisible=function(){return this._m.style.display!='none';};bb.prototype.applyFilter=function(input,filterConfig){var data=this.getUserData();if(input&&!input.checked){var name=input.name.replace(/bpfilter_/,'');var index=input.value.indexOf(' ');var op=input.value.substr(0,index);var value=input.value.substr(index+1);if(/^\d\.?\d*$/.test(value))value=parseFloat(value);var operant=data[name];if(/^\d\.?\d*$/.test(operant))operant=parseFloat(operant);if(op=='='){if(/^\d\.?\d*$/.test(value))value=parseFloat(value);if(operant==value)return false;}else if(op=='<>'||op=='><'){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<operant&&operant<arg2)return false;}else if(op=='>=<='){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<=operant&&operant<=arg2)return false;}else if(op=='>=<'){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<=operant&&operant<arg2)return false;}else if(op=='><='){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<operant&&operant<=arg2)return false;}else if(op=='<'){if(/^\d\.?\d*$/.test(value))value=parseFloat(value);if(operant<value)return false;}else if(op=='<='){if(/^\d\.?\d*$/.test(value))value=parseFloat(value);if(operant<=value)return false;}else if(op=='>'){if(/^\d\.?\d*$/.test(value))value=parseFloat(value);if(operant>value)return false;}else if(op=='>='){if(/^\d\.?\d*$/.test(value))value=parseFloat(value);if(operant>=value)return false;}else{alert('I do not know how to use this form filter operator: '+op);}return true;}if(!this.isMapped()&&!filterConfig)return;else if(!filterConfig)filterConfig=this.getMap().getFilterConfig();var fields=filterConfig.fields;var display=true;for(var j=0;j<fields.length;j++){var found=false;var inputs=filterConfig[fields[j]];var operant=data[fields[j]];if(/^\d\.?\d*$/.test(operant))operant=parseFloat(operant);for(var k=0;k<inputs.length;k++){if(inputs[k].checked){var index=inputs[k].value.indexOf(' ');var op=inputs[k].value.substr(0,index);var value=inputs[k].value.substr(index+1);if(/^\d\.?\d*$/.test(op))op=parseFloat(op);if(/^\d\.?\d*$/.test(value))value=parseFloat(value);if(op=='='){if(operant==value){found=true;break;}}else if(op=='<>'||op=='><'){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<operant&&operant<arg2){found=true;break;}}else if(op=='>=<='){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<=operant&&operant<=arg2){found=true;break;}}else if(op=='>=<'){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<=operant&&operant<arg2){found=true;break;}}else if(op=='><='){var arg1=value.substr(0,value.indexOf(' '));var arg2=value.substr(value.indexOf(' ')+1);if(/^\d\.?\d*$/.test(arg1))arg1=parseFloat(arg1);if(/^\d\.?\d*$/.test(arg2))arg2=parseFloat(arg2);if(arg1<operant&&operant<=arg2){found=true;break;}}else if(op=='<'){if(operant<value){found=true;break;}}else if(op=='<='){if(operant<=value){found=true;break;}}else if(op=='>'){if(operant>value){found=true;break;}}else if(op=='>='){if(operant>=value){found=true;break;}}}}if(!found){display=false;break;}}return display;};window.BpMarkerLight=bb;}BpMarkerLight();