function getPageSize() {
        var xScroll, yScroll;
        if (window.innerHeight && window.scrollMaxY) {	
            xScroll = window.innerWidth + window.scrollMaxX;
            yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } else {
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        var windowWidth, windowHeight;
        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;
        }	
        if(yScroll < windowHeight){
            pageHeight = windowHeight;
        } else { 
            pageHeight = yScroll;
        }
        if(xScroll < windowWidth){	
            pageWidth = xScroll;		
        } else {
            pageWidth = windowWidth;
        }
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
        return arrayPageSize;
 };


function sprawdz_wysokosc(varik) {

    zmienna = getPageSize();

		
		//jaka powinna byc maksymalna grafika
		wysokosc_grafiki = zmienna[3] - 260 - 10 - 10; //dostepne miejsce - wysokosc paskow - wysokosc marginesow - wysokosc obramowania

		//alert(wysokosc_grafiki);
		//alert(document.getElementById('mainphoto').offsetHeight);

		//Jaka ma byc wysokosc calego obszaru
		wysokosc_calego_obszaru = zmienna[3] - 260; //dostepne miejsce - wysokosc paskow
		podwojna_wysokosc_calego_obszaru = wysokosc_calego_obszaru * 1;
		
		//Ustalanie jakie zdjecie ma pokazywac jesli to onload
		if(varik == 0){
		}
		else{
		document.images.logo.src = varik;
		document.getElementById("mainphoto").style.border = "5px solid #300f24";
		}

		//alert(wysokosc_grafiki);

		document.getElementById("mainphoto").style.height = wysokosc_grafiki + "px";
	
		document.getElementById("mainphoto").setAttribute("class", "przezroczystosc wysoka");
	


		document.getElementById("menu_top").style.height = wysokosc_calego_obszaru + "px";
		document.getElementById("menu_top_in").style.height = wysokosc_calego_obszaru + "px";


		document.getElementById("content").style.height = wysokosc_calego_obszaru + "px";

}

function nowe_photo(source, width, height) {

    zmienna = getPageSize();
		$("#main_info").hide();
		$("#block2").show();
		
		
		//jaka powinna byc maksymalna grafika
		wysokosc_grafiki = zmienna[3] - 260 - 10 - 10; //dostepne miejsce - wysokosc paskow - wysokosc marginesow - wysokosc obramowania

		//alert(wysokosc_grafiki);
		//alert(document.getElementById('mainphoto').offsetHeight);

		//Jaka ma byc wysokosc calego obszaru
		wysokosc_calego_obszaru = zmienna[3] - 260; //dostepne miejsce - wysokosc paskow
		podwojna_wysokosc_calego_obszaru = wysokosc_calego_obszaru * 1;

		document.getElementById("mainphoto").src = source;
			document.getElementById("mainphoto_tmp").src = source;

		//alert(wysokosc_grafiki);

		//document.getElementById("mainphoto").style.height = wysokosc_grafiki + "px";
	
		document.getElementById("mainphoto").setAttribute("class", "przezroczystosc wysoka");
	


		document.getElementById("menu_top").style.height = wysokosc_calego_obszaru + "px";
		document.getElementById("menu_top_in").style.height = wysokosc_calego_obszaru + "px";


		document.getElementById("content").style.height = wysokosc_calego_obszaru + "px";

		

		
}


function loading(){

	$("#block2").hide();
	$("#main_info").show();

	}
window.onresize=function(){sprawdz_wysokosc(0)}
