﻿var windowHeight,windowWidth,w;
var xScroll, yScroll,y;
function odswiezgalerie(id,lang)
{

advAJAX.setDefaultParameters({
 onSuccess : function(obj) {document.getElementById(obj.tag).innerHTML = obj.responseText; $(".lightbox").lightbox(); },
 onLoading : function(obj) { },
  onError : function(obj) { }
    });
advAJAX.get({
  url: "galeriat.php?sg="+id+"&l="+lang,tag:"obgal"
    
});
}
function odswiezgaleriew(id,lang)
{

advAJAX.setDefaultParameters({
 onSuccess : function(obj) {document.getElementById(obj.tag).innerHTML = obj.responseText; $(".lightbox").lightbox(); },
 onLoading : function(obj) { },
  onError : function(obj) { }
    });
advAJAX.get({
  url: "galeria.php?sg="+id+"&l="+lang,tag:"obgal"
    
});
}
function srodkuj()
{

if (self.innerHeight) { // all except Explorer
			if(document.documentElement.clientWidth){
				windowWidth = document.documentElement.clientWidth;
			} else {
				windowWidth = self.innerWidth;
			}
			windowHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
			windowWidth = document.documentElement.clientWidth;
			windowHeight = document.documentElement.clientHeight;
		} else if (document.body) { // other Explorers
			windowWidth = document.body.clientWidth;
			windowHeight = document.body.clientHeight;
		}

	w=(windowWidth-960)/2
	if (w>0)
document.getElementById('body').style.left=w+'px';
else
document.getElementById('body').style.left=0;

}
function pion(wys,wys1){
var odst,ptop,odst1;
todt=wys/10;
todt1=wys1/10;
odst=wys-wys/4;
odst1=wys1-wys1/4;
ptop=wys/8+80;
wys=wys+119;
if (document.getElementById('dolny'))
document.getElementById('dolny').style.top=wys+'px';

if (document.getElementById('krechasr'))
{document.getElementById('krechasr').style.height=(odst)+'px';
$('#krechasr').css({'margin-top':todt+'px'});}
if (document.getElementById('krechasr2'))
{
document.getElementById('krechasr2').style.height=(odst)+'px';
$('#krechasr2').css({'margin-top':todt+'px'});}
if (document.getElementById('krechasr1'))
{document.getElementById('krechasr1').style.height=(odst1)+'px';
$('#krechasr1').css({'margin-top':todt1+'px'});}

if (document.getElementById('krechasr3'))
{document.getElementById('krechasr3').style.height=(odst1)+'px';
$('#krechasr3').css({'margin-top':todt1+'px'});}
}
$(document).ready(
	function()
	
	{var wys=0
	$('#body').hide();
	
	srodkuj();
$("#tabor div").hide();	

	//poprawia style dla ie
if(-1 != navigator.userAgent.indexOf("MSIE")) 
{
$('span.menu').css({'padding-top':'2px'});
if($('div.zakladka'))
$('div.zakladka').css({'left':'770px'});

if($('span.gal'))
{

$('span.gal').css({'padding-top':'2px'});
$('span.gal').css({'padding-bottom':'2px'});
$('span.gal').css({'padding-left':'2px'});
$('span.gal').css({'vertical-align':'text-top'});

}
}
if(-1 != navigator.userAgent.indexOf("Mozilla")) 
{
if ($('span.gal'))
{
$('span.gal').css({'padding-top':'30px'});
$('span.gal').css({'padding-left':'2px'});
$('span.gal').css({'height':'310px'});

}
}
$('#body').css({'visibility':'visible'});
$('#body').show();
$(document).pngFix();
// ukrywa elementy
 $(".lightbox").lightbox();


 // sprawdza czy jesteśmy w onas
	if ($("#tresc1"))
	{
	wys=$("#tresc1").height();
	}
	;
	pion($("#tresc").height(),wys);


 
	 //obsługa menu górnego;
	 $('span.menu').mouseover(function()
	 {
	 $(this).fadeTo("normal",0.8);
	 }
	 );
	 $('span.menu').mouseout(function()
	 {
	 $(this).fadeTo("normal",1.0);
	 }
	 );
	//obsługa zakładek na podstronie tabor
	//ustawia startową zakładke
	$('div.zakladka').css({'background-image': "url('./images/zakladka.png')"});
	$('#startzak').css({'background-image': "url('./images/zakladka_in.png')"});
	
	$("#tabor div").hide()
	$("#tabor1").show().css({'width':'490px'});
	$(document).pngFix();
	//obsługa przeskoku zakładek
	$('div.zakladka').click(function()
	{
	$('div.zakladka').css({'background-image': "url('./images/zakladka.png')"});
	$(this).css({'background-image': "url('./images/zakladka_in.png')"});
	$("#tabor div").hide()
	$("#tabor"+this.lang).show().css({'width':'490px'});
	$(document).pngFix();
	
	}
	)
	
	}
	)
	
