// JavaScript Document

okno=window.document;

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow_logout(theURL,winName,features) { //v2.0
document.execCommand("ClearAuthenticationCache"); 
okno=window.open(theURL,winName,features);
window.okno.focus();
window.close();
}


function MM_openBrWindow(theURL,szer,wys,scr) { //v2.0
lewy=(screen.width-szer)/2;
gorny=(screen.height-wys)/2;	
features='left='+lewy+',top='+gorny+',width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scr+',resizable=no';
  okno=window.open(theURL,'winName',features);
  okno.moveTo(lewy,gorny);
  okno.resizeTo(szer,wys);
  window.okno.focus();
} 

function  wybierz_opis() {
	if (document.form_dodaj.przenies_opis.checked) {
		document.form_dodaj.opis.value  = document.form_dodaj.wzor_opis.value;
	}  
	else {
		document.form_dodaj.opis.value  = "";
	}

}



/*function  obrazek_podglad() {
		document.form_dodaj.obrazek_podglad.src  = document.form_dodaj.obrazek.value;
}
*/

function create_window (image, width, height) {
width = width + 25;
height = height +50;
if (window.popup_window && !window.popup_window.closed) {
	window.popup_window.resizeTo (width, height);
	}

var window_spec = "location=no, scrollbars=no, menubars=no, toolbars=no, resizable=yes, left=0, top=0, width=" + width  + ", height=" + height;

var url = "image_window.php?image=" + image;

popup_window = window.open(url, "PictureWindow", window_spec);
popup_window.focus();
}

////////////////////////form
