function SiteGMaps(){
	this.siteControlsContainerWidth=187
	this.uniTitle
	this.locations=new Array()
	this.mapsLayerWritten=false
	this.sectionsOffset=2
	this.getOverPageRef=function(){
		try{
			document.getElementById("googleMapLayer").style
		}catch(e){
			var div1=document.createElement("div")
			div1.id="googleMapLayer"
			document.getElementsByTagName("body")[0].appendChild(div1)
		}
		return document.getElementById("googleMapLayer")
	}
	this.getMapsContainerRef=function(){
		if(!this.mapsLayerWritten){
			var mapsContainer=document.createElement("div")
			mapsContainer.id="mapsContainer"
			this.getOverPageRef().appendChild(mapsContainer)		
			var siteControlsContainer=document.createElement("div")
			siteControlsContainer.id="siteControlsContainer"
			
			var printA=document.createElement("a")
			printA.href="#"
			printA.onclick=function(){gMaps.printClick();return false}
			printA.id="printMapHref"
			var printImg=document.createElement("img")
			printImg.src="/modules/GMaps/layout/ico_druk_pl.gif"
			printA.appendChild(printImg)
			siteControlsContainer.appendChild(printA)
			
			var closeHref=document.createElement("a")
			closeHref.id="closeHref"
			closeHref.href="javascript:gMaps.showHide(false)"
			siteControlsContainer.appendChild(closeHref)
			var closeImg=document.createElement("img")
			closeImg.src="/modules/GMaps/layout/ico_close_pl.gif"
			closeHref.appendChild(closeImg)
			
			var siteText=document.createElement("div")
			siteText.id="siteText"

			siteControlsContainer.appendChild(siteText)
			
			this.getOverPageRef().appendChild(siteControlsContainer)
			this.mapsLayerWritten=true
		}
		return document.getElementById("mapsContainer")
	}
	this.showHideOverPage=function(b){
		document.getElementsByTagName("body")[0].style.overflow=document.getElementsByTagName("html")[0].style.overflow=b?"hidden":"auto"
		this.getOverPageRef().style.display=b?"block":"none"
		if(b){
			window.onresize=this.scaleToFull;
			this.scaleToFull()
			document.getElementById("siteText").innerHTML=""
			this.setSection(1,"")
			
		}
		
	}
	this.setSection=function(end,title){
		var s=""
		s+="<span></span><span></span>"
			for(var i=0;i<end;i++ ){
				var loc=this.locations[i]
				s+="<a href='#' onclick='gMaps.evLinkClick(\""+loc.id+"\");return false' class='siteLocationHref' >"
				s+="<img src='/modules/GMaps/layout/"+loc.id+".jpg' /> "
				
				s+=loc.uniName
				s+="</a>"
			}
			document.getElementById("siteText").innerHTML+=s
	}
	this.addLocation=function(obj){
		obj.current=gMapsSiteCurLocation==obj.id
		this.locations.push(obj)
	}
	this.scaleToFull=function(){
		try{
			window.scrollTo(0,0)
			var rb=document.getElementsByTagName('body'); 
			 var w=parseInt(rb[0].clientWidth)
			 var w1=w-this.siteControlsContainerWidth-1		 
			this.getMapsContainerRef().style.width=w1+"px"	
			document.getElementById("siteControlsContainer").style.width=this.siteControlsContainerWidth+"px"	
			}catch(e){}
	}
	this.getInfoWinContent=function(curLoc){
		var s="<table class='infoWinContentTable'><tr><td class='infoImageTD'>"
		s+="<img src='/modules/GMaps/layout/korzkiew2.jpg'/>"
		s+="</td><td>"
		s+="<p class='gInfoWinHead'>"+curLoc.uniName+"</p>"
		s+="<p class='gInfoWinAdres'>"
		for(var j=0;j<curLoc.adres.length;j++){
			s+=curLoc.adres[j]+"<br/>"	
		}
		if(curLoc.phone!=""){
			s+="tel: "+curLoc.phone+"<br/>"
		}
		s+="<a href='mailto:"+curLoc.mail+"' class='gInfoWinHref'>"+curLoc.mail+"</a><br/>"
		if(curLoc.site!=""){
			s+="<a href='http://"+curLoc.site+"' class='gInfoWinHref'>www.donimirski.com</a>"
		}
		s+="</p>"
		s+="</td></tr></table>"
		return s
	}
	this.getLaunchTag=function(){
		var s='<a href="javascript:void(0)" onclick="gMaps.showHide(true);return false"><img src="/modules/GMaps/layout/mapka_korzkiew.gif" /></a>'
		return s;
	}
	this.evMarkersDrawn=function(){
		
	}
	this.configureGmap=function(gmapRef){
		gmapRef.addMapType(G_PHYSICAL_MAP)
	}
}

var gMaps =new GMaps()
if(location.host.indexOf("test.amu.pl")>-1){
gMaps.key="ABQIAAAAHj8mK_lFgkUVPZNqrHmxgBRcABBXjvuUIwYE_o4f4PZ_XSDZZRTIe-yTpjypqvzK-uNYptCjwoH7wg"
}else if(location.host.indexOf("zamek.com.pl")>-1){
gMaps.key="ABQIAAAAHj8mK_lFgkUVPZNqrHmxgBQdU5SxRty5LjsEbLpKvNmFG7lOBhTdfUcKBmOg0XiA2ApzNm4DuBKgzg"
}else{
gMaps.key="ABQIAAAAHj8mK_lFgkUVPZNqrHmxgBRyzx6tZkPHv4dXhpr12MF3ZDg6mBRAldyrZbdYVxV0oZoIettkd6KNJw"
}
gMaps.loadScripts()
siteGMaps=new SiteGMaps()
var gMapsSiteCurLocation="korzkiew"
siteGMaps.addLocation({lat:50.162154213685874,lng:19.882453680038452,zoom:13,id:"korzkiew",uniName:"Zamek Korzkiew",adres:["Korzkiew koło Ojcowa"],phone:"012 419 55 90",mail:"zamek@donimirski.com",site:""})