function ShowHideU(name) {
	var form = document.getElementById(name);

	form.style.display = (form.style.display == 'block') ? 'none':'block';

	if (!document.all) {switchEditors(document.getElementById("otherlang"),"on");}
}

var myRemote = null;

function launch(newURL, newName, newFeatures, orgName)
{
var remote = open(newURL, newName, newFeatures);
if (remote.opener == null)
remote.opener = window;
remote.opener.name = orgName;
return remote;
}

function launchRemote(web,width,height)
{
 if (myRemote == null || myRemote.closed )
 {
	myRemote = launch('', "myRemote", "screenX=0,left=0,screenY=0,top=0,channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0,width = " + width + ",height = " + height, "MENU");
	myRemote.document.write('<html><head><title>Galeria</title></head><body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"><img onclick="window.close()" src="'+ web +'" alt="" border="0"> </body></html>');
    myRemote.focus();
    myRemote.document.close();
 }else {
 	myRemote.close();
	launchRemote(web);
 }
}

function init(Obrazek){

  	var separator = Obrazek.indexOf(";");
  	var Bg = Obrazek.substring(0,separator);
	var Div = document.getElementById('gora-left-2');
    Div.style.background= "url("+Bg+") no-repeat";
    setTimeout("div_change('"+Obrazek+"')",7000);

}

  function div_change(bg){

  	var separator = bg.indexOf(";");
  	var nextBg = bg.substring(0,separator);
 	var futureBg = bg.substring(separator +1,bg.length) + ';' + nextBg;

 	var separator = futureBg.indexOf(";");
  	var futureBg_one = futureBg.substring(0,separator);

	change_opacity('0',nextBg, futureBg_one);

	setTimeout("div_change('"+futureBg+"')",9000);
 }

 function change_opacity(tab_index,nextBg,futureBg){

 		//var tablicaFuture = new Array(0,10,20,30,40,50,60,70,80,90,100,100,100,100,100);
 		//var tablicaNext = new Array(100,80,60,40,20,0,0,0,0,0);
 		var tablicaFuture = new Array(0,10,20,30,40,50,60,70,80,90,100,100,100,100,100);
 		var tablicaNext = new Array(100,90,80,70,60,50,40,30,20,10,0,0,0,0,0);

		// zmniejsza sie przezroczystosc
		var next_div = document.getElementById('gora-left-1');

        next_div.style.background= "url("+nextBg+") no-repeat";
		next_div.style.filter = "alpha(opacity="+tablicaNext[tab_index]+")";
		ff=100/100;
		next_div.style.opacity = ff;

		// zwieksza sie przezroczystosc
		var future_div = document.getElementById('gora-left-2');
        future_div.style.background= "url("+futureBg+") no-repeat";
		future_div.style.filter = "alpha(opacity="+tablicaFuture[tab_index]+")";
		ff=tablicaFuture[tab_index]/100;
		future_div.style.opacity = ff;



 	new_tab_index = Number ( tab_index) +1;

 	if (new_tab_index < 13){
 		setTimeout("change_opacity('"+new_tab_index+"','"+nextBg+"','"+futureBg+"')",150);

 	}

 }
