function doPic(imgName, resize_w, resize_h, title)
{
	
	document.getElementById('mainpic').innerHTML='<a href="userimg/img_d/'+imgName+'" rel="lightbox" title="'+title+'" ><img name="mainpic" src="userimg/img_m/'+imgName+'" width="'+resize_w+'" height="'+resize_h+'" border="0"  ></a>';
	


}

function doPicGal(imgName, orginal_w, orginal_h, resize_w, resize_h, title)
{
	
	document.getElementById('mainpic').innerHTML='<a href="galery/img_d/'+imgName+'" rel="lightbox" title="'+title+'" class="imgTitle"><img name="mainpic" src="galery/img_s/'+imgName+'" width="'+resize_w+'" height="'+resize_h+'" style="border:solid #000000 1px; cursor:pointer;"  ><div class="imgTitle">'+title+'</div></a>';
	


}

function displayWindow(url, title, width, height) 
{


       window.open(url,title,'width='+width+', height='+height+',toolbar=no,location=yes,directories=yes,status=no,menubar=no,scrollbars=yes,resizable=yes' );
} 

function isValue(id)
{
	

flaga = 0;
wart = document.getElementById(id).value;
wart = wart.replace(',','.');

for(i=1; i<wart.length; i++)
if(isNaN(parseInt(wart.charAt(i))) && wart.charAt(i)!='.')
flaga = 1;

liczba = parseFloat(wart)
if(isNaN(liczba))
flaga = 1;


if(flaga == 0)
{
//Na przyszlosc
}
else
{
document.getElementById(id).value = '';
}
}

function drukuj(){
 // sprawdz mozliwosci przegladarki
   if (!window.print){
      alert("Twoja przegladarka nie drukuje!")
   return 0;
   }
 window.print(); // jesli wszystko ok 
}

function clear(id)
{
document.getElementById(id).value = '';	
}


function displaySW(controlId)
{

var control = document.getElementById(controlId);

if(control.style.display == "block" || control.style.display == "")

control.style.display = "none";

else

control.style.display = "block";

}

function displaySWS(controlId, controlId2)
{

var control = document.getElementById(controlId);
var control2 = document.getElementById(controlId2);

control.style.display = "block";
control2.style.display = "none";

}

function displaySWOk(controlId)
{

var control = document.getElementById(controlId);

control.style.display = "block";

}

function displaySWNull(controlId)
{

var control = document.getElementById(controlId);

control.style.display = "none";


}

function imposeMaxLength(Object, MaxLen)
{
  return (Object.value.length <= MaxLen);
}

function liczOff(id, id2, val)
{

var ile = document.getElementById(id).value;
ile = ile.length;
document.getElementById(id2).innerHTML = val - ile;

}

function Menu(id, klasa) {
	if(navigator.appName == "Microsoft Internet Explorer")
	{
	var klasa = klasa; 
	document.getElementById(id.id).className = klasa;

		}
	else
	document.getElementById(id.id).setAttribute("class", klasa);
	
}


function displaySubM(controlId)
{

var control = document.getElementById(controlId);

control.style.display = "block";

}

function displaySubMH(controlId)
{

var control = document.getElementById(controlId);

//subTimeout = window.setTimeout("displaySubMH2('"+control+"')",500);

control.style.display = "none";
}

function displaySubMH2(controlId)
{

var control = document.getElementById(controlId);

control.style.display = "none";

}

function print_frag(id) {
div = document.getElementById(id);
okno = window.open("", "", "toolbar=0, location=0, resizable=1, directories=0, status=1, menubar=1, scrollbars=1, height=800, width=700, top=80, left=350");
var html = div.innerHTML;
html = '<html><head><link rel="stylesheet" type="text/css" /></head><body>'+html+'</body></html>';

okno.document.write(html);
//okno.print();
okno.focus(); 
}






