// JavaScript Document
function showSlide(idobr){
				 try{
				 		 
				 		 okno=window.open("showslide.php?idobr="+idobr,"","toolbar=no,menubar=no, location=no, personalbar=no, status=no,resizable=no, scrollbars=no, copyhistory=no,width="+screen.width+", height="+screen.height+", top=0, left=0");
						 okno.moveTo(0,0);
						 okno.focus();
						 
				 }
				 catch(err){
				 						alert("błąd");
				 }
}

function showSlideWind(obraz){
	
		var okno;
		var slajd = new Image();
		var oknoWidth;//=slajd.width+60;
		var oknoHeight;//=slajd.height+60;

		try{
			//slajd.src="bank/"+obraz;
			slajd.src=obraz;
		}
		catch(err){
			alert(err);
		}
		try{
				if(slajd.complete){
					
			oknoWidth=slajd.width+60;
			oknoHeight=slajd.height+60;
			okno=window.open("/showslide.php?obraz="+obraz,"",
		  "toolbar=no,menubar=no, location=no, personalbar=no, status=no,resizable=no, scrollbars=no, copyhistory=no,width="+
		  oknoWidth+
		  ", height="+
		  oknoHeight+
		  ", top=30, left=30");
			okno.focus();
			return(true);
			
		}
		
		else{
			slajd.onload = function(){
				oknoWidth=slajd.width+60;
				oknoHeight=slajd.height+60;
				okno=window.open("/showslide.php?obraz="+obraz,"",
		  		"toolbar=no,menubar=no, location=no, personalbar=no, status=no ,resizable=no, scrollbars=no, copyhistory=no,width="+
		  		oknoWidth+
		  		", height="+
		  		oknoHeight+
		  		", top=30, left=30");
				okno.focus();
				return(true);
			}
		}
		}
		
		//okno.focus();
		catch(err){
			//return(false);
		}
		return(false);
	
}

//var oldheight,oldwidth;
var  obraz;


function scaleImg(){
 				 document.images["img_slide"].style.display="none";
				 oldheight = document.images["img_slide"].height;
				 oldwidth = document.images["img_slide"].width;
				 newheight = screen.height-190;
				 proc = newheight/oldheight;
				 newwidth = oldwidth*proc;
				 if (newwidth>(screen.width-80)){
				 		
						/*newwidth = screen.width-80;
						proc = newwidth/oldwidth;
						newheight = oldheight*proc;
						*/
						
						document.images["img_slide"].width=screen.width-80;
						
				 }
				else{
						
						document.images["img_slide"].height = newheight;
						
						//document.images["img_slide"].width = newwidth;
				}
				 
				 document.images["img_slide"].style.display="inline";
				
}

function scaleOpis(){
		document.getElementById("div_opis").style.width=document.images["img_slide"].width+"px";
}

function unScaleImg(){
		//document.images["img_slide"].width=oldwidth;
		//document.images["img_slide"].height=oldheight;
		document.images["img_slide"].src=document.images["img_slide"].src;
}

function scaleDisp(){
 				 document.getElementById("div_display").style.width==screen.width-20;
				 document.getElementById("div_display").style.height==screen.height-50;
				
				
				
}
