// preload obrazkow interfejsu.

	img1= new Image(36,187);
	img1.src="gfx/logo.gif";

	
	
	img2= new Image(63,18);
	img2.src="gfx/menu_01.gif";


	
	img3= new Image(59,18);
	img3.src="gfx/menu_02.gif";

	
	img4= new Image(31,18);
	img4.src="gfx/menu_03.gif";


	
	img5= new Image(32,32);
	img5.src="gfx/loader.gif";		
	
	img6= new Image(1000,1000);
	img6.src="gfx/jckll.jpg";		
	
	img7= new Image(92,100);
	img7.src="gfx/next.gif";		
	
	img8= new Image(92,100);
	img8.src="gfx/prev.gif";	





function change(id){
     ID = document.getElementById(id);
    
     if(ID.style.display == "")
          ID.style.display = "none";
     else
          ID.style.display = "";
      }
      
function on(id){
     ID = document.getElementById(id);
     ID.style.display = "";
      }

function off(id){
     ID = document.getElementById(id);
          ID.style.display = "none";
      }
      

	function setActiveStyleSheet(title)
	{
   		var i, a, main;
   		for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
   		{
     		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title"))
        	{
       			a.disabled = true;
       			if(a.getAttribute("title") == title) a.disabled = false;
     		}
   		}
	}

	
	function nastepne_inne(){
Effect.Fade('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
setTimeout("Effect.Appear('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});	 ",500);

	}
	
		function nastepne(){
Effect.Fade('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
setTimeout("Effect.Appear('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});	 ",500);

	}
	
		function poprzednie_inne(){
Effect.Fade('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
setTimeout("Effect.Appear('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});	 ",500);

	}
	
	function poprzednie(img)
	{
		newImage = "url("+img+")";
		Effect.Fade('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
		setTimeout("document.getElementById('zdjecie').style.backgroundImage = newImage; Effect.Appear('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});",500);
	}
	
		
	function zaladuj(fota1, fota2)
	{
		image2= new Image(1000,1000);
     	image2.src="pic/"+fota1;
     	
     	image3= new Image(1000,1000);
     	image3.src="pic/"+fota2;
     	
     	
	}
	
		function laduj(fota1)
	{
		image2= new Image(1000,1000);
     	image2.src="okladki/"+fota1;

     	
	}
	
	function wyczysc()
	{
		//ta funkcja zamienia teksty w lewej i prawej czesci strony na divy strzalek.
		//nie trzeba jej przywolywac z ajaxa, wiec czysty JS jest szybszy.
		setTimeout("document.getElementById('lewa_czesc').innerHTML='<div id=\"wstecz\" style=\"display: none;\"></div>'; document.getElementById('prawa_czesc').innerHTML='<div id=\"dalej\" style=\"display: none;\"></div>'; document.getElementById('lewa_czesc').style.cursor='pointer'; document.getElementById('prawa_czesc').style.cursor='pointer'; ",250);
	}
	
	function stopka_prawo()
	{
		//ta funkcja zmienia numer zdjecia w stopce
		//nie trzeba jej przywolywac z ajaxa, wiec czysty JS jest szybszy.
		numer=document.getElementById('stopka_lewa').innerHTML;
		wartosci=numer.split("/");
		nastepne=parseInt(wartosci[0]);
		ostatnie=parseInt(wartosci[1]);
	
		if(nastepne==ostatnie)
			nastepne=1;
			else
			nastepne++;
		
		setTimeout("document.getElementById('stopka_lewa').innerHTML=nastepne+\"/\"+wartosci[1];",250);

	}	
	
	function stopka_lewo()
	{
		//ta funkcja zmienia numer zdjecia w stopce
		//nie trzeba jej przywolywac z ajaxa, wiec czysty JS jest szybszy.
		numer=document.getElementById('stopka_lewa').innerHTML;
		wartosci=numer.split("/");
		poprzednie=parseInt(wartosci[0]);
		ostatnie=parseInt(wartosci[1]);
	
		if(poprzednie==1)
			poprzednie=ostatnie;
			else
			poprzednie--;
		
		setTimeout("document.getElementById('stopka_lewa').innerHTML=poprzednie+\"/\"+wartosci[1];",250);

	}


	function ustaw_loading()
	{	

		
		newLoader="url()";
			var the_h = 165;
var the_w= 210;
//alert ('The image size is '+w+'*'+h);
var clientH = document.body.clientHeight ;
var clientW = document.body.clientWidth ;
			

			setTimeout("document.getElementById('loading').style.width = '"+the_w+"px';",250);
			
			setTimeout("document.getElementById('loading').style.height = '"+the_h+"px';",250);

			


			setTimeout("document.getElementById('loading').style.top = '"+((clientH/2)-(the_h/2)-10)+"px';",250);		
			setTimeout("document.getElementById('loading').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);		

	
					
	}	
	
	
	
	function ustaw_default()
	{	
			newLoader="url()";
			var the_h = 400;
var the_w= 534;
//alert ('The image size is '+w+'*'+h);
var clientH = document.body.clientHeight ;
var clientW = document.body.clientWidth ;
			

			setTimeout("document.getElementById('kontener_zdjecia').style.width = '"+the_w+"px';",250);
			setTimeout("document.getElementById('zdjecie').style.width = '"+the_w+"px';",250);		
			
			setTimeout("document.getElementById('kontener_zdjecia').style.height = '"+the_h+"px';",250);
			setTimeout("document.getElementById('zdjecie').style.height = '"+the_h+"px';",250);		
			
			setTimeout("document.getElementById('lewa_czesc').style.width = '"+((the_w/2)-20)+"px';",250);
			setTimeout("document.getElementById('lewa_czesc').style.height = '"+(the_h-22)+"px';",250);					
			
			setTimeout("document.getElementById('prawa_czesc').style.width = '"+((the_w/2)-20)+"px';",250);
			setTimeout("document.getElementById('prawa_czesc').style.height = '"+(the_h-22)+"px';",250);		

			setTimeout("document.getElementById('stopka2').style.top = '"+(the_h+4)+"px';",250);
			setTimeout("document.getElementById('stopka2').style.left = '-10px';",250);			
			setTimeout("document.getElementById('stopka2').style.width = '"+(the_w)+"px';",250);				
			setTimeout("document.getElementById('stopka2').style.height = '"+0+"px';",250);		
	

			setTimeout("document.getElementById('kontener_zdjecia').style.top = '"+((clientH/2)-(the_h/2)-10)+"px';",250);		
			setTimeout("document.getElementById('kontener_zdjecia').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);		

			setTimeout("document.getElementById('logo').style.top = '"+((clientH/2)-(the_h/2)-28)+"px';",250);		
			setTimeout("document.getElementById('logo').style.left = '"+((clientW/2)-(the_w/2)-47)+"px';",250);		

			setTimeout("document.getElementById('menu').style.top = '"+((clientH/2)-(the_h/2)-29)+"px';",250);		
			setTimeout("document.getElementById('menu').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);				
			
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = ''; document.getElementById('prawa_czesc').style.cursor='default'; document.getElementById('lewa_czesc').style.cursor='pointer'; ",250);	
setTimeout("document.getElementById('kontener_zdjecia').style.backgroundImage = newLoader;",250);			
					
	}
	
	function zmien_na_default()
	{
			Effect.Fade('kontener',{duration: 0.25, queue: {position:'end', scope: 'znikanie'}});
		
			newLoader="url()";
			var the_h = 400;
var the_w= 534;
//alert ('The image size is '+w+'*'+h);
var clientH = document.body.clientHeight ;
var clientW = document.body.clientWidth ;
			

			setTimeout("document.getElementById('kontener_zdjecia').style.width = '"+the_w+"px';",250);
			setTimeout("document.getElementById('zdjecie').style.width = '"+the_w+"px';",250);		
			
			setTimeout("document.getElementById('kontener_zdjecia').style.height = '"+the_h+"px';",250);
			setTimeout("document.getElementById('zdjecie').style.height = '"+the_h+"px';",250);		
			
			setTimeout("document.getElementById('lewa_czesc').style.width = '"+((the_w/2)-20)+"px';",250);
			setTimeout("document.getElementById('lewa_czesc').style.height = '"+(the_h-22)+"px';",250);					
			
			setTimeout("document.getElementById('prawa_czesc').style.width = '"+((the_w/2)-20)+"px';",250);
			setTimeout("document.getElementById('prawa_czesc').style.height = '"+(the_h-22)+"px';",250);		

			setTimeout("document.getElementById('stopka2').style.top = '"+(the_h+4)+"px';",250);
			setTimeout("document.getElementById('stopka2').style.left = '-10px';",250);			
			setTimeout("document.getElementById('stopka2').style.width = '"+(the_w)+"px';",250);				
			setTimeout("document.getElementById('stopka2').style.height = '"+0+"px';",250);		
	

			setTimeout("document.getElementById('kontener_zdjecia').style.top = '"+((clientH/2)-(the_h/2)-10)+"px';",250);		
			setTimeout("document.getElementById('kontener_zdjecia').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);		

			setTimeout("document.getElementById('logo').style.top = '"+((clientH/2)-(the_h/2)-28)+"px';",250);		
			setTimeout("document.getElementById('logo').style.left = '"+((clientW/2)-(the_w/2)-47)+"px';",250);		

			setTimeout("document.getElementById('menu').style.top = '"+((clientH/2)-(the_h/2)-29)+"px';",250);		
			setTimeout("document.getElementById('menu').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);				
			
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = ''; document.getElementById('prawa_czesc').style.cursor='default'; document.getElementById('lewa_czesc').style.cursor='pointer'; ",250);	
setTimeout("document.getElementById('kontener_zdjecia').style.backgroundImage = newLoader;",250);			
			
	}	

		function zmien_na_info()
	{
			Effect.Fade('kontener',{duration: 0.25, queue: {position:'end', scope: 'znikanie'}});
			ustaw_default();
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = ''; document.getElementById('prawa_czesc').style.cursor='default'; document.getElementById('lewa_czesc').style.cursor='default'; ",250);	
	}	
	
	function zmien_na_albumy()
	{
			Effect.Fade('kontener',{duration: 0.25, queue: {position:'end', scope: 'znikanie'}});
ustaw_default();			
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = ''; document.getElementById('prawa_czesc').style.cursor='default'; document.getElementById('lewa_czesc').style.cursor='default';",250);	
	
	}	
	
	
	
	function zmien_zdjecie(zrodlo,the_w,the_h)
	{

	//obrazek jako TLO
		newImage = "url("+zrodlo+")";
	newLoader = "url(gfx/loader.gif)";		
//var newImg = new Image();
//newImg.src = zrodlo;
//var the_h = newImg.height;
//var the_w= newImg.width;
//alert ('The image size is '+(the_h+4));
var clientH = document.body.clientHeight ;
var clientW = document.body.clientWidth ;


			Effect.Fade('kontener',{duration: 0.25, queue: {position:'end', scope: 'znikanie'}});
			
	
			
			setTimeout("document.getElementById('kontener_zdjecia').style.width = '"+the_w+"px';",250);
			setTimeout("document.getElementById('zdjecie').style.width = '"+the_w+"px';",250);		
			
			setTimeout("document.getElementById('kontener_zdjecia').style.height = '"+the_h+"px';",250);
			setTimeout("document.getElementById('zdjecie').style.height = '"+the_h+"px';",250);		
			
			setTimeout("document.getElementById('lewa_czesc').style.width = '"+((the_w/5)*2)+"px';",250);
			setTimeout("document.getElementById('lewa_czesc').style.height = '"+(the_h-22)+"px';",250);					
			
			setTimeout("document.getElementById('prawa_czesc').style.width = '"+((the_w/5)*2)+"px';",250);
			setTimeout("document.getElementById('prawa_czesc').style.height = '"+(the_h-22)+"px';",250);		

			setTimeout("document.getElementById('stopka2').style.top = '"+(the_h+4)+"px';",250);
			setTimeout("document.getElementById('stopka2').style.left = '-10px';",250);			
			setTimeout("document.getElementById('stopka2').style.width = '"+(the_w)+"px';",250);				
			setTimeout("document.getElementById('stopka2').style.height = '"+24+"px';",250);		
			
			setTimeout("document.getElementById('dalej').style.top = '"+((the_h/2)-55)+"px';",250);
			setTimeout("document.getElementById('wstecz').style.top = '"+((the_h/2)-55)+"px';",250);		

			setTimeout("document.getElementById('kontener_zdjecia').style.top = '"+((clientH/2)-(the_h/2)-10)+"px';",250);		
			setTimeout("document.getElementById('kontener_zdjecia').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);		

			setTimeout("document.getElementById('logo').style.top = '"+((clientH/2)-(the_h/2)-28)+"px';",250);		
			setTimeout("document.getElementById('logo').style.left = '"+((clientW/2)-(the_w/2)-47)+"px';",250);		

			setTimeout("document.getElementById('menu').style.top = '"+((clientH/2)-(the_h/2)-29)+"px';",250);		
			setTimeout("document.getElementById('menu').style.left = '"+((clientW/2)-(the_w/2)-10)+"px';",250);	
setTimeout("document.getElementById('kontener_zdjecia').style.backgroundImage = newLoader;",250);					
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = newImage; 	Effect.Appear('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});	 ",250);				

				//     image2= new Image(1000,1000);
     //image2.src="pic/z7.jpg";
	}
/*	function zmien_zdjecie(zrodlo,rodzaj,rodzaj_poprzedniego)
	{
//	bez efektow
	//obrazek jako TLO
		newImage = "url("+zrodlo+")";

     
		if(rodzaj_poprzedniego==rodzaj)
		{
		//	Effect.Fade('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = newImage; ",5);
		}
		else
		{
		//	Effect.Fade('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
			setTimeout("document.getElementById('zdjecie').style.backgroundImage = newImage; setActiveStyleSheet('"+rodzaj+"');	",5);				
		}
				 //    image2= new Image(343,515);
     //image2.src="pic/z6.jpg";
	}	*/
/*	function zmien_zdjecie(zrodlo,rodzaj,rodzaj_poprzedniego)
	{//obrazek jako obrazek
		//newImage = "url("+zrodlo+")";
newImage = zrodlo;

     
		if(rodzaj_poprzedniego==rodzaj)
		{
			Effect.Fade('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
			setTimeout("document['zdjecie'].src= null; document['zdjecie'].src= newImage; Effect.Appear('zdjecie',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});",500);
		}
		else
		{
			Effect.Fade('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});
			setTimeout("document['zdjecie'].src= null; document['zdjecie'].src= newImage; setActiveStyleSheet('"+rodzaj+"');	Effect.Appear('kontener',{duration: 0.5, queue: {position:'end', scope: 'znikanie'}});	 ",500);				
		}
				     image2= new Image(343,515);
     image2.src="pic/z6.jpg";
	}
*/
