﻿

function pop(link,title,w,h)
{
//newwindow = window.open(link, title,"width="+w+",height="+h);
testwindow= window.open (link, title, "location=0,status=0,scrollbars=1,width="+w+",height="+h);

}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}


function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


    if (document.images)
    {
      preload_image_object = new Image();
      image_url = new Array();
      image_url[0] = "http://www.kobylanka.pl/gfx/sommer/box_fav_on.gif";
      image_url[1] = "http://www.kobylanka.pl/gfx/sommer/box_firstpage_on.gif";
      image_url[2] = "http://www.kobylanka.pl/gfx/sommer/box_friend_on.gif";
      image_url[3] = "http://www.kobylanka.pl/gfx/sommer/jezioro.gif";
      image_url[4] = "http://www.kobylanka.pl/gfx/sommer/wieniec.gif";
      image_url[5] = "http://www.kobylanka.pl/gfx/sommer/z_lotu.gif";

       var i = 0;
       for(i=0; i<=5; i++) 
         preload_image_object.src = image_url[i];
    }





function setDIV(what){
		
		
		switch (what){
			case 'miedwie':
				bg = "gfx/sommer/jezioro.jpg";
				body = '<h2>Jezioro miedwie</h2><p>Powierzchnia 35km<sup>2</sup> (piąte miejsce w Polsce, drugie, po jeziorze Dąbie, w województwie zachodniopomorskim). Jezioro leży na wysokości 14 m n.p.m., a jego głębokość wynosi 43,8 m, co daje największą w Polsce kryptodepresję (prawie 30 m p.p.m.). Linia brzegowa ma długość ok. 39 km (maks. szerokość 3,2 km), brzegi są bezleśne, w południowej części bagniste. Przez Miedwie przepływa rzeka Płonia, uchodzą do niego rzeki Gowienica i Ostrowica, w okolicach Żelewa znajduje się ujęcie wody pitnej dla mieszkańców Szczecina.<a href="http://www.miedwie.com.pl">www.miedwie.com.pl</a></p>';
			break;
			
			case 'lipa':
				bg = "gfx/sommer/wieniec.jpg";
				body = '<h2>Wieniec Zgody</h2><p>W Kobylance w 1460 roku, burmistrzowie Stargardu i Szczecina po długiej i wyniszczającej wojnie (1456 -1460) o prawa składu nad Inoujściem, zawarli pokój i na znak zgody zasadzili lipę - która rosnąc do dziś- zwaną została, przez wszystkich późniejszych "Wieńcem Zgody", To symbol pojednania i świadectwo tamtych dni. Protoplasta herbu Gminy.</p>';
			break;

			case 'ptak':
				bg = "gfx/sommer/z_lotu.jpg";
				body = '<h2>Gmina z lotu ptaka</h2><ul class="fotos_main"><li><img src="gfx/zieleniewo.jpg" alt="Miniaturka zdjęcia" border="0" height="95" width="120"></li><li><img src="gfx/kobylanka.jpg" alt="Miniaturka zdjęcia" border="0" height="95" width="120"></li><li><img src="gfx/reptowo.jpg" alt="Miniaturka zdjęcia" border="0" height="95" width="120"></li></ul><p><a href="gallery,1.html">zobacz galerię</a></p>';
			break;







			default : 
				bg = "z_lotu.jpg";
				body = 'xx';
		}		
		
		elem = document.getElementById('klosy').style;
		elem.background = 'transparent url('+bg+') no-repeat center top;';

		document.getElementById('klosy').innerHTML = body;
	}


function setOriginal() {
	document.getElementById('klosy').style.background = 'transparent url(gfx/sommer/klosy.jpg) no-repeat center top';
	document.getElementById('klosy').innerHTML = '<H2>Witamy na stronie Gminy Kobylanka!</H2><p>Rzecznik dodał, że Balcerowicz uważa ponadto, iż przesłuchanie urzędującego prezesa NBP przez komisję śledczą stanowiłoby niebezpieczny precedens i osłabiłoby pozycję banku centralnego w przyszłości. Rzecznik uchylił się od odpowiedzi na pytanie, czy Leszek Balcerowicz odmówi stawienia się przed komisją w innym terminie.	Rzecznik dodał, że Balcerowicz uważa ponadto, iż przesłuchanie urzędującego prezesa NBP przez komisję śledczą stanowiłoby niebezpieczny precedens i osłabiłoby pozycję banku centralnego w przyszłości. Rzecznik uchylił się od odpowiedzi na pytanie, czy Leszek Balcerowicz odmówi stawienia się przed komisją w innym terminie.</p>';

}





var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;

function animate()
{
var elem = document.getElementById('progress');
if(elem != null) {
if (pos==0) len += dir;
if (len>32 || pos>79) pos += dir;
if (pos>79) len -= dir;
if (pos>79 && len==0) pos=0;
elem.style.left = pos;
elem.style.width = len;
}
}

function remove_loading() {
this.clearInterval(t_id);
var targelem = document.getElementById('loader_container');
targelem.style.display='none';
targelem.style.visibility='hidden';
var t_id = setInterval(animate,60);
}




var w=1
var h=1
	
function gettrailobj(){
	if (document.getElementById)
		return document.getElementById("trailimageid").style
	else if (document.all)
		return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail(){
	document.onmousemove="";
	//document.getElementById('ttimg').style.display="inline";
	document.getElementById('hadwa').style.display="none";
	document.getElementById('tximg').src="#";
	document.getElementById('tximg').style.display="none";
	gettrailobj().visibility="hidden";
	gettrailobj().left=0;
	gettrailobj().top=-1000;
}


function showtrail(file,description, width,height){
	if(	navigator.userAgent.toLowerCase().indexOf('opera') == -1 &&
		navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
			
		w=width;
		h=height;
		gettrailobj().visibility="visible";
		gettrailobj().width=w+"px";
		gettrailobj().height=h+20+"px";
			document.getElementById('tximg').src = file;

			document.getElementById('hadwa').innerHTML=description;
			document.getElementById('hadwa').style.display="block";
			//document.getElementById('ttimg').style.display="none";
			document.getElementById('tximg').style.display="inline";
		document.onmousemove=followmouse
	
		
			
		
		//newHTML = '<div class="border_preview" style="width:'+  width +'px;height:'+ height +'px"><div id="loader_container"><div id="loader"><div align="center">Wczytywanie obrazka...</div><div id="loader_bg"><div id="progress"> </div></div></div></div>';
		//newHTML = newHTML + '<h2 class="title_h2">' + ' '+description + '</h2>'
		
    	//newHTML = newHTML + '<div class="preview_temp_load"><img onload="javascript:remove_loading();" src="' + file + '" width="'+  width +'" height="'+ height +'" border="0"></div>';
		//newHTML = newHTML + '</div>'; 
		
		//if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
		//	newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'"></iframe>';
		//}	
	
		//gettrailobjnostyle().innerHTML = newHTML;
		
	
	



	
	
	
	}
}


function followmouse(e){

	if(	navigator.userAgent.toLowerCase().indexOf('opera') == -1 &&
		navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{

		var xcoord=20;
		var ycoord=20;

		if (typeof e != "undefined"){
			xcoord+=e.pageX;
			ycoord+=e.pageY;
		}
		else 
			if (typeof window.event !="undefined"){
				xcoord+=truebody().scrollLeft+event.clientX;
				ycoord+=truebody().scrollTop+event.clientY;
			}


		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

		if (xcoord+w+3>docwidth)
			xcoord=xcoord-w-(20*2)

		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
			ycoord=ycoord-h-20;

		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"

	}

}