
	 noweOkienko = null;
 function galeria(src, w, h, podpis){
	 if(window.screen){ aw=screen.availWidth;ah=screen.availHeight; }else{ aw=320; ah=450;	}
	 if(noweOkienko==null || noweOkienko.closed){
	  ustawienia=
	  "left=" + (w)/2 + ","	  +"top=" + (h)/2 + ","	  +"screenX=" + (aw-w)/2 + ","	  +"screenY=" + (ah-h)/2 + ","	  +"width=" + w + ","
	  +"height=" + h + ","	  +"innerWidth=" + w + ","	  +"innerHeight=" + h + ","	  +"toolbar=0,"	  +"location=0,"
	  +"directories=0,"	  +"status=0,"	  +"menubar=0,"	  +"scrollbars=0,"	  +"resizable=0"
	  noweOkienko = window.open("",'obrazek',ustawienia);
	 }
	 noweOkienko.document.open();
	 noweOkienko.document.clear();
	 noweOkienko.document.write(
	 "<html><head>\n"
	 +" <Title> - "+podpis+" - </title>"
	 +" <SCRIPT>"	 +"function na_dol(){"+"new_window = window.resizeTo(width=galeria.width, height=galeria.height+100);"
	 +"}" +"</SCRIPT>" + "</HEAD><BODY topmargin=0 leftmargin=0 onload=na_dol(); ggColor=#ffffff>"
	 +"\n"	 +"\n"	 + "<img name=galeria src=" + src + " onmousedown ='close();'>");
	 noweOkienko.document.close();
	 noweOkienko.focus();
 	}

//---------------------------------
	 noweOkienko1 = null;
function openW(strona,width_,height_){
		noweOkienko1 = window.open(strona,'strona','width='+width_+',height='+height_+',toolbars=no,resizeble="yes",scrollbars=yes');
		noweOkienko1.focus();
}
//---------------------------------
	 noweOkienko2 = null;
function openZ(strona,width_,height_){
		noweOkienko2 = window.open(strona,'strona','width='+width_+',height='+height_+',toolbars=no,resizeble="yes",scrollbars=yes');
		noweOkienko2.focus();
}
//---------------------------------
function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;	
	window.location.href = gourl;
}
//wstaw obrazek funkcje obsługujace wstawianie obrazka tablica
function wstawdate(zmienna){
	var zmienna;
    var dataw=showModalDialog("popups/insert_data.php",window,"resizable: yes; help: no; status: no; scroll: no; ");
	
	if (dataw!=null){
		document.getElementById(zmienna).focus();
		document.getElementById(zmienna).value=dataw; 

//		document.form1.elements[zmienna].focus();
//		document.form1.elements[zmienna].value=dataw; 
	}
}
//wstaw obrazek funkcje obsługujace wstawianie obrazka tablica
function wstawdate2(form,zmienna){
	var zmienna;
    var dataw=showModalDialog("popups/insert_data.php",window,"resizable: yes; help: no; status: no; scroll: no; ");
	
	if (dataw!=null){
		document.getElementById(zmienna).focus();
		document.getElementById(zmienna).value=dataw; 
		}
}
//-------------------------
function selectCheckboxes(what,pref,stan){  
	for(i=0;i<what.elements.length;i++){    
		if(what.elements[i].type == "checkbox" && what.elements[i].name.substring(0,pref.length) == pref){     
			what.elements[i].checked=stan;    
			}  
		}
}
//-------------------------
function suma(cena){  
	for(i=0;i<cena.length;i++){    
			suma+=cena[$i];
		}
	return suma;
}

//=----------------------------------
function change_vis(obj,obj2,value){
	if (value == 'yes') document.getElementById(obj).style.display = "block";  else document.getElementById(obj).style.display = "none";
	if (value == 'yes') document.getElementById(obj2).style.display = "block"; else document.getElementById(obj2).style.display = "none";
}

function checkbox_disabled(obj,objh,akcja){
	var hidden = document.getElementById(objh);
	if (!akcja)
	{
		hidden.disabled=true;
	}
	else {
		hidden.disabled=false;
	}
	//alert(hidden.value);
}


function obj_disabled(s,obj2,wartosc){
	var hidden = document.getElementById(obj2);
	var select = s.options[s.selectedIndex].value;	
		//		alert(select);
		if(select == wartosc){     
			hidden.disabled=true;   
			}  
			else hidden.disabled=false;
}
function ukryj(obj){
	obj.style.display = "none";
}

function zmien_value(obj,obj2,wartosc){
	var obj = document.getElementById(obj);
	var obj2 = document.getElementById(obj2);
	obj.value = wartosc;
	obj2.innerHTML = wartosc.toFixed(2);
}

function pobierz_width_strony(){
		var     ie  = navigator.appName == "Microsoft Internet Explorer";
		var  opera  = navigator.appName == "Opera";

		var width;

		if (ie) {width = document.body.offsetWidth;}
			else 
				{
				width = window.innerWidth;
				}
		return width;
}

function ustaw_logo(){
		var w = pobierz_width_strony()/2;
		document.getElementById("logo").style.left = parseInt(w)-600;
		document.getElementById("motyw").style.left = parseInt(w)-150;
}

function zmien_img(obj,nazwa){
	obj.src = nazwa;
}
