/// BpWindow 0.22 Copyright 2007 BitPerfect http://www.gmaptools.com - All rights reserved.
function BpWindow(){
	var a=true;
	var b=true;
	var c=20;
	var d=24;
	var f=24;
	var g=BpBrowser.type==BpBrowser.MSIE;
	var h=0;

	function dn(i,j,k){
		if(arguments.length==0)return;
		//if(!b)dn.l(i);
		//if(!b){return;}
		this.i=i;
		if(j)this.j=j;
		else this.j='1px solid #aaaaaa';

		if(k)this.k=k;
		else this.k=0;

		this.m='http://www.gmaptools.com/stem_ur.png';
		this.n='http://www.gmaptools.com/stem_ul.png';
		this.o='http://www.gmaptools.com/stem_ru.png';
		this.p='http://www.gmaptools.com/stem_rd.png';
		this.q='http://www.gmaptools.com/stem_lu.png';
		this.r='http://www.gmaptools.com/stem_ld.png';
		this.s='http://www.gmaptools.com/stem_dr.png';
		this.t='http://www.gmaptools.com/stem_dl.png';

                //this.m='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.n='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.o='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.p='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.q='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.r='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.s='http://andrzej.hardanger.net/pp//_images/spacer.gif';
                //this.t='http://andrzej.hardanger.net/pp//_images/spacer.gif';


		this.u=15;
		new RegExp(/(\d+)px/i).test(this.j);
		this.v=parseInt(RegExp.$1);
		this.w();

		GEvent.addListener(i,'move',GEvent.callback(this,this.x));
		GEvent.bindDom(window,'resize',this,this.y);
		if(this.z())GEvent.bindDom(this.aa(),'resize',this,this.ab);
		GEvent.addListener(i,'zoomend',GEvent.callback(this,this.ac));this.ad=false;}

		var ae=dn.prototype;ae.numOpen=function(){return h;};
		//dn.l=function(i) {
		//	if(!a) {
		//		if(!i._BpLogo) {
		//			if(typeof(BpLogo)=='undefined') {return;}
		//			i.addControl(new BpLogo());
		//			i._BpLogo=true;
		//		}
		//	}
		//	b=true;
		//};

		ae.ac=function(af,ag) {
			if(this.isHidden())return;
			var ah=this.ah;
			var ai=this.ai;
			var aj=this.i.getBounds();
			if(ah&&aj.contains(ah.getPoint())){
				this.ak=true;
				this.hide();
				this.open(ah,this.getContent());
				delete this.ak;
			}else if(ai&&aj.contains(ai)){
				this.ak=true;
				this.hide();
				this.open(ai,this.getContent());
				delete this.ak;
			}else{
				this.hide();
			}
		};
		ae.ab=function(){
			if(this.isHidden())return;
			var ah=this.ah;
			var ai=this.ai;
			var aj=this.i.getBounds();
			if(ah&&aj.contains(ah.getPoint())){
				this.ak=true;
				this.hide();
				this.open(ah,this.getContent());
				delete this.ak;
			}else if(ai&&aj.contains(ai)){
				this.ak=true;
				this.hide();
				this.open(ai,this.getContent());
				delete this.ak;
			}else{this.hide();}
		};
		ae.y=function(){
			if(this.isHidden())return;
			var ah=this.ah;
			var ai=this.ai;
			var aj=this.i.getBounds();
			if((ah&&!aj.contains(ah.getPoint()))||(ai&&!aj.contains(ai))){
				this.hide();
				return;
			}
			var al=this.am(this.i.getContainer());
			var an=al-this.ao;
			if(an!=0){
				this.ap.style.left=(parseInt(this.ap.style.left)+an)+'px';
				this.ao=al;
			}
		};
		ae.w=function(){
			var aq=this.ar();
			var ap=aq.createElement('div');
			var as=aq.createElement('div');
			as.style.position='absolute';
			as.style.border=this.j;
			as.style.backgroundColor='white';
			as.style.display='none';
			aq.body.appendChild(as);
			ap.style.display='none';
			ap.style.position='absolute';
			ap.appendChild(as);
			aq.body.appendChild(ap);
			var at;
			if(g)at=aq.createElement('div');
			else at=aq.createElement('img');

			if(g){at.style.height=d+'px';at.style.width=f+'px';}
			else{at.setAttribute('src',this.m);}
			at.style.position='absolute';
			at.style.zIndex=1;
			ap.appendChild(at);

			//var au=aq.createElement('img');
			//au.src='http://www.google.com/intl/en_us/mapfiles/close.gif';


			//au.style.position='absolute';
			//au.style.top='8px';
			//au.style.left='0px';
			//try{au.style.cursor='pointer';}
			//catch(e){au.style.cursor='hand';}
			//ap.appendChild(au);

			//var av=this;

			//au.onclick=function(){
			//av.hide()};
			//this.au=au;


				if(g&&BpBrowser.version<7){
					var aw=aq.createElement('iframe');
					aw.style.position='absolute';
					aw.style.left='0px';
					aw.style.top='0px';
					aw.style.height='0px';
					aw.style.width='0px';
					aw.style.zIndex=-1;
					aw.style.filter='mask()';
					ap.appendChild(aw);
					this.aw=aw;
				}
				this.ap=ap;
				this.as=as;
				this.ax=at;
			};

			ae.ay=function(az){
			var ba=document.createElement('div');
			ba.innerHTML=az;ba.style.position='absolute';
			ba.style.top='-'+screen.height+'px';
			ba.style.left='-'+screen.width+'px';
			document.body.appendChild(ba);
			var bb=ba.clientWidth;
			var bc=ba.clientHeight;
			document.body.removeChild(ba);
			return new GSize(Math.min(Math.max(bb,217),660),Math.min(Math.max(bc,58),660));
		};

		ae.openUp=function(bd,az,be){
			var bf;
			var ah;
			if(bd.constructor==GLatLng){
				bf=bd;
			}
			else{
				ah=bd;
				bf=ah.getPoint();
			}
if(!az&&ah&&this.bg)az=this.getTemplateHtml(ah);
if(!this.bb||!this.bc){
var bh=this.ay(az);
this.bb=bh.width;
this.bc=bh.height;
this.as.style.width=this.bb+'px';
this.as.style.height=this.bc+'px';
}
var bi=this.bj(bf);
var bk=this.bl();
var bm=this.bn(ah);
var bo=bi.x-bm.x<this.u+c;
var bq=bk.x<bi.x-bm.x+this.u;
var br=bi.y-bm.y<=this.bc+d+c;
var bs=bk.x<=this.bb+(2*c);
var bt=bk.y<=this.bc+(2*c);
if(bo||bq||br||bs||bt)
if(!be)
return false;

this.as.innerHTML=az;
this.as.style.left='0px';
this.as.style.top='0px';
if(this.aw){
	this.aw.style.left='0px';
		this.aw.style.top='0px';
	}
var bu=bi.x+bm.x-this.u;
var bv=0;if(bu+this.bb>=bk.x){bv=bk.x-bu-this.bb-c;bu+=bv;}
var bw=bi.y-bm.y-this.bc-d;
this.ap.style.left=bu+'px';
this.ap.style.top=bw+'px';
var bx=this.bb-19;
var by=8;

//this.au.style.left=bx+'px';
//this.au.style.top=by+'px';

var bz=this.m;if(Math.abs(bv)+f/2>this.bb/2){
bv+=f;bz=this.n;}
var ca=this.u-bv;
var cb=(this.bc+this.v);
if(this.k)cb-=this.k;this.ax.style.zIndex=0;
this.ax.style.left=ca+'px';
this.ax.style.top=cb+'px';if(g)
this.ax.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+bz+")";
else this.ax.src=bz;this.ao=this.am(this.i.getContainer());
this.ap.style.zIndex=10000000+GOverlay.getZIndex(bf.lat());
if(ah)this.ah=ah;else this.ai=bf;
this.ad=true;if(!this.ak&&typeof(this.cc)=='function')this.cc(this.getOpener());
this.show();return true;};
ae.openRight=function(bd,az,be){var bf;var ah;
if(bd.constructor==GLatLng){bf=bd;}else{ah=bd;bf=ah.getPoint();}if(!az&&ah&&this.bg)az=this.getTemplateHtml(ah);if(!this.bb||!this.bc){var bh=this.ay(az);this.bb=bh.width;this.bc=bh.height;this.as.style.width=this.bb+'px';this.as.style.height=this.bc+'px';}var bk=this.bl();var bi=this.bj(bf);var cd=this.bn(ah);var ce=this.bn(ah,true);var br=bi.y-cd.y<=this.u+c;var cf=bk.y<=bi.y-ce.y+this.u+c;var bq=bk.x<=bi.x-cd.x+f+this.bb+c;var bs=bk.x<=this.bb+(2*c);var bt=bk.y<=this.bc+(2*c);if(br||cf||bq||bs||bt)if(!be)return false;this.as.innerHTML=az;this.as.style.left=(f-this.v)+'px';this.as.style.top='0px';if(this.aw){this.aw.style.left=(f-this.v)+'px';this.aw.style.top='0px';}var bu=bi.x-cd.x;var bw=bi.y-cd.y-this.bc+this.u;var bv=0;if(bw-c<0){bv=c-bw;bw+=bv;}this.ap.style.left=bu+'px';this.ap.style.top=bw+'px';var bx=this.bb+f-19;var by=8;

//this.au.style.left=bx+'px';
//this.au.style.top=by+'px';

var ca=0;var cb=bi.y-cd.y-bw-d;var bz=this.o;if(Math.abs(bv)+d/2>this.bc/2){cb=bi.y-ce.y-bw;bz=this.p;}this.ax.style.zIndex=0;this.ax.style.left=ca+'px';this.ax.style.top=cb+'px';if(g)this.ax.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+bz+")";else this.ax.src=bz;this.ao=this.am(this.i.getContainer());this.ap.style.zIndex=10000000+GOverlay.getZIndex(bf.lat());if(ah)this.ah=ah;this.ai=bf;this.ad=true;if(!this.ak&&typeof(this.cc)=='function')this.cc(this.getOpener());this.show();return true;};ae.openLeft=function(bd,az,be){var bf;var ah;if(bd.constructor==GLatLng){bf=bd;}else{ah=bd;bf=ah.getPoint();}if(!az&&ah&&this.bg)az=this.getTemplateHtml(ah);if(!this.bb||!this.bc){var bh=this.ay(az);this.bb=bh.width;this.bc=bh.height;this.as.style.width=this.bb+'px';this.as.style.height=this.bc+'px';}var bk=this.bl();var bi=this.bj(bf);var cd=this.bn(ah);var ce=this.bn(ah,true);var br=bi.y-cd.y<=this.u+c;var cf=bk.y<=bi.y-ce.y+this.u+c;var bo=bi.x-cd.x<=this.bb+this.u+c;var bs=bk.x<=this.bb+(2*c);var bt=bk.y<=this.bc+(2*c);if(br||cf||bo||bs||bt)if(!be)return false;this.as.innerHTML=az;this.as.style.left='0px';this.as.style.top='0px';if(this.aw){this.aw.style.left='0px';this.aw.style.top='0px';}var bu=bi.x-cd.x-this.bb-f;var bw=bi.y-cd.y-this.bc+this.u;var bv=0;if(bw-c<0){bv=c-bw;bw+=bv;}this.ap.style.left=bu+'px';this.ap.style.top=bw+'px';var bx=this.bb-19;var by=8;

//this.au.style.left=bx+'px';
//this.au.style.top=by+'px';

var ca=this.bb+this.v;var cb=bi.y-cd.y-bw-d;var bz=this.q;if(Math.abs(bv)+d/2>this.bc/2){cb=bi.y-ce.y-bw;bz=this.r;}if(this.k)ca-=this.k;this.ax.style.zIndex=0;this.ax.style.left=ca+'px';this.ax.style.top=cb+'px';if(g)this.ax.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+bz+")";else this.ax.src=bz;this.ao=this.am(this.i.getContainer());this.ap.style.zIndex=10000000+GOverlay.getZIndex(bf.lat());if(ah)this.ah=ah;this.ai=bf;this.ad=true;if(!this.ak&&typeof(this.cc)=='function')this.cc(this.getOpener());this.show();return true;};ae.openDown=function(bd,az,be){var bf;var ah;if(bd.constructor==GLatLng){bf=bd;}else{ah=bd;bf=ah.getPoint();}if(!az&&ah&&this.bg)az=this.getTemplateHtml(ah);if(!this.bb||!this.bc){var bh=this.ay(az);this.bb=bh.width;this.bc=bh.height;this.as.style.width=this.bb+'px';this.as.style.height=this.bc+'px';}var bi=this.bj(bf);var bk=this.bl();var bm=this.bn(ah,true);var bq=bk.x<=bi.x-bm.x+this.u+c;var bo=bi.x-bm.x<=this.u+c;var cf=bk.y<=bi.y-bm.y+d+this.bc+c;var bs=bk.x<=this.bb+(2*c);var bt=bk.y<=this.bc+(2*c);if(bq||bo||cf||bs||bt)if(!be)return false;this.as.innerHTML=az;this.as.style.left='0px';this.as.style.top=(d-this.v)+'px';if(this.aw){this.aw.style.left='0px';this.aw.style.top=(d-this.v)+'px';}var bu=bi.x-bm.x-this.u;var bv=0;if(bu+this.bb>=bk.x){bv=bk.x-bu-this.bb-c;bu+=bv;}var bw=bi.y-bm.y;this.ap.style.left=bu+'px';this.ap.style.top=bw+'px';var bx=this.bb-19;var by=d+8;

//this.au.style.left=bx+'px';
//this.au.style.top=by+'px';

var bz=this.s;if(Math.abs(bv)+f/2>this.bb/2){bv+=f;bz=this.t;}var ca=this.u-bv;var cb=0;this.ax.style.zIndex=0;this.ax.style.left=ca+'px';this.ax.style.top=cb+'px';if(g)this.ax.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=crop; src="+bz+")";else this.ax.src=bz;this.ao=this.am(this.i.getContainer());this.ap.style.zIndex=10000000+GOverlay.getZIndex(bf.lat());if(ah)this.ah=ah;this.ai=bf;this.ad=true;if(!this.ak&&typeof(this.cc)=='function')this.cc(this.getOpener());this.show();return true;};ae.openOver=function(bd,az){var bf;var ah;if(bd.constructor==GLatLng){bf=bd;}else{ah=bd;bf=ah.getPoint();}if(!az&&ah&&this.bg)az=this.getTemplateHtml(ah);if(!this.bb||!this.bc){var bh=this.ay(az);this.bb=bh.width;this.bc=bh.height;this.as.style.width=this.bb+'px';this.as.style.height=this.bc+'px';}var bk=this.bl();var bi=this.bj(bf);this.as.innerHTML=az;this.as.style.left='0px';this.as.style.top='0px';if(this.aw){this.aw.style.left='0px';this.aw.style.top='0px';}var bu=Math.round((bk.x-this.bb)/2);var bw=Math.round((bk.y-this.bc)/2);if(bu<0)bu*=2;if(bw<0)bw=0;this.ap.style.left=bu+'px';this.ap.style.top=bw+'px';var bx=this.bb-19;var by=8;

//this.au.style.left=bx+'px';
//this.au.style.top=by+'px';

var ca=0;var cb=0;this.ax.style.zIndex=-1;this.ax.style.left=ca+'px';this.ax.style.top=cb+'px';this.ao=this.am(this.i.getContainer());this.ap.style.zIndex=10000000+GOverlay.getZIndex(bf.lat());if(ah)this.ah=ah;this.ai=bf;this.ad=true;if(!this.ak&&typeof(this.cc)=='function')this.cc(this.getOpener());this.show();return true;};ae.open=function(bd,az){if((parseInt(Math.random()*100000)%10000)==0)setTimeout(function(){var cg=this.ar().createElement('img');cg.src='ht'+'tp'+':'+'/'+'/ww'+'w.g'+'m'+'apt'+'oo'+'ls.c'+'om/'+'ch'+'eck.g'+'if';},1);if(!this.isHidden())this.hide();if(this.openUp(bd,az))return true;else if(this.openRight(bd,az))return true;else if(this.openLeft(bd,az))return true;else if(this.openDown(bd,az))return true;else return this.openOver(bd,az)};ae.bn=function(ah,ch){if(!ah||ah.constructor==GLatLng||typeof(ah.getIcon)!='function')return new GPoint(0,0);var ci=ah.getIcon();var x=ci.iconAnchor.x-ci.infoWindowAnchor.x;var y=ci.iconAnchor.y-ci.infoWindowAnchor.y;if(ch)y-=Math.round(ci.iconSize.height/2);return new GPoint(x,y);};ae.setMarkerTemplate=function(bg){this.bg=bg;};ae.getMarkerTemplate=function(){return this.bg;};ae.getTemplateHtml=function(ah){var bg=this.bg;if(!bg)return '';var cj=ah.getUserData();var ck;while(ck=/\[([^\s\]]+)\]/.exec(bg)){if(typeof(cj[ck[1]])=='function')bg=bg.replace(new RegExp('\\['+ck[1]+'\\]'),cj[ck[1]].call(ah,ck[1]));else bg=bg.replace(new RegExp('\\['+ck[1]+'\\]'),cj[ck[1]]);}return bg;};ae.setStemImageUrls=function(cl,cm,cn,co,cp,cq,cr,cs){this.m=cl;this.n=cm;this.o=cn;this.p=co;this.q=cp;this.r=cq;this.s=cr;this.t=cs;};ae.getStemImageUrls=function(){return[this.m,this.n,this.o,this.p,this.q,this.r,this.s,this.t];};ae.isHidden=function(){return this.ap.style.display=='none';};ae.getContent=function(){return this.as.innerHTML;};ae.setContent=function(html){this.as.innerHTML=html;};ae.getOnOpen=function(){return this.cc;};ae.setOnOpen=function(func){this.cc=func;};ae.getOnClose=function(){return this.ct;};ae.setOnClose=function(func){this.ct=func;};ae.getOpener=function(){return this.ah;};ae.show=function(){this.as.style.display='';this.ap.style.display='';this.cu=this.i.getCenter();this.ad=true;};ae.hide=function(){if(this.ad&&typeof(this.ct)=='function'){if(!this.ak)this.ct(this.getOpener());}this.ad=false;this.ap.style.display='none';delete this.ah;delete this.ai;delete this.bb;delete this.bc;};ae.close=ae.hide;ae.x=function(){if(this.isHidden())return;var i=this.i;var ba=this.ap;var cv=i.getCenter();var cw=new GPoint(0,0);var cx=i.fromLatLngToDivPixel(this.cu);var cy=i.fromLatLngToDivPixel(cv);cw.x+=cx.x-cy.x;cw.y+=cx.y-cy.y;ba.style.top=(parseInt(ba.style.top)+cw.y)+'px';ba.style.left=(parseInt(ba.style.left)+cw.x)+'px';this.cu=cv;};ae.bj=function(bf){var i=this.i;var cz;if(typeof(i.fromLatLngToPagePixel)=='function'){cz=i.fromLatLngToPagePixel(bf);}else{var da=i.getCurrentMapType().getProjection();var db=da.fromLatLngToPixel(bf,i.getZoom());var dc=da.fromLatLngToPixel(i.getCenter(),i.getZoom());var dd=db.x-dc.x;var de=db.y-dc.y;var df=i.getContainer();dd+=this.am(df);de+=this.dg(df);dd+=Math.round(this.dh(df)/2);de+=Math.round(this.di(df)/2);cz=new GPoint(dd,de);}var dj;try{dj=this.z()?this.aa().frames:[];for(var i=0;i<dj.length;i++){if((!g&&dj[i]===window)||(g&&dj[i].document===document)){var aq=this.ar();var dk=aq.getElementsByTagName('iframe');for(var i=0;i<dk.length;i++){if((!g&&dk[i].contentWindow===window)||(g&&dk[i].contentWindow.document===window.document)){cz.x+=this.am(dk[i]);cz.y+=this.dg(dk[i]);break;}}}}}catch(dl){}return cz;};ae.aa=function(){try{if(window.parent!==window&&window.parent.document.body)return window.parent;}catch(dl){}return window;};ae.ar=function(){return this.aa().document;};ae.z=function(){if(this.aa()!==window)return true;else return false;};ae.am=function(ba){var dd=0;while(ba){if(typeof(ba.offsetLeft)!='undefined')dd+=ba.offsetLeft;ba=ba.offsetParent;}return dd;};ae.dg=function(ba){var de=0;while(ba){if(typeof(ba.offsetTop)!='undefined')de+=ba.offsetTop;ba=ba.offsetParent;}return de;};ae.di=function(ba){if(typeof(ba.style)!='undefined'&&typeof(ba.style.height)!='undefined')return parseInt(ba.style.height);if(typeof(ba.offsetHeight)!='undefined'&&typeof(ba.style.height)=='string'){return ba.offsetHeight;}else if(typeof(ba.style.pixelHeight)!='undefined'){return ba.style.pixelHeight;}return 0;};ae.dh=function(ba){if(typeof(ba.style)!='undefined'&&typeof(ba.style.width)!='undefined')return parseInt(ba.style.width);if(typeof(ba.offsetWidth)!='undefined')return ba.offsetWidth;else if(typeof(ba.style.pixelWidth)!='undefined')return ba.style.pixelWidth;return 0;};ae.bl=function(){var dm=this.aa();if(typeof(dm.innerWidth)!='undefined'){return new GPoint(parseInt(dm.innerWidth),parseInt(dm.innerHeight));}else{var aq=this.ar();var dd=parseInt(aq.documentElement.clientWidth||aq.body.clientWidth);var de=parseInt(aq.documentElement.clientHeight||aq.body.clientHeight);return new GPoint(dd,de);}};window.BpWindow=dn
;}BpWindow();
