function confirmLink_Text(theLink, text)
{
 qs = confirm(text);
 if(qs)
 {
  window.location=theLink;
 }
}

function OpenWindow(theURL,winName,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
  window.open(theURL,winName,settings);
}



function OpenFormatWindow(theURL,winName,w,h,scroll)
{
  LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
  settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable';
pop = window.open(theURL,winName,settings);
pop.document.write('<html><head><title>GALERIA</title></head><body bgcolor="white" topmargin="0" leftmargin="0"><center>');
pop.document.write('<a href="javascript:window.close();"><img src="'+theURL+'" alt="Zamknij okno" border=0></a></center>');
pop.document.write('</body></html>');
}

 function textCounter(field, countfield, maxlimit)
 {
  if (field.value.length > maxlimit)
   field.value = field.value.substring(0, maxlimit);
  else
   countfield.value = maxlimit - field.value.length;
 }

function trim(t){return t.replace(/^\s+/g,'').replace(/\s+$/g,'')}

function sprawdz(wart)
 {
   if (isNaN(wart.value) || trim(wart.value)=="" || trim(wart.value)<=0)
   {
    alert("Uwaga! \r\n"+wart.value+" nie jest dozwoloną wartością.");
    wart.value="";
   }

    return true;
 }


		function img_on(imgName) {
		imgOn = eval(imgName + "_on.src");
		document [imgName].src = imgOn;
		 }
		function img_out(imgName) {
		imgOut = eval(imgName + ".src");
		document [imgName].src = imgOut;
		 }

