 function getElement(obj)
 {
	return document.getElementById(obj);
 }

 function getElementLeft(obj)
 {
	var o=getElement(obj);
	var curentleft = 0;
	if (o.offsetParent)
	{
		while (o.offsetParent)
		{
			curentleft += o.offsetLeft
			o = o.offsetParent;
		}
	}
	else if (o.x)
		curentleft += o.x;
	return curentleft;
 }

 function getElementWidth(obj)
 {
	var o=getElement(obj);
	if (o.offsetWidth)
		return o.offsetWidth;
	else
		return o.width;
 }

 function getElementTop(obj)
 {
	var o=getElement(obj);
	var curenttop = 0;
	if (o.offsetParent)
	{
		while (o.offsetParent)
		{
			curenttop += o.offsetTop;
			o = o.offsetParent;
		}
	}
	else if (o.y)
		curenttop += o.y;
	return curenttop;
 }

 function getElementHeight(obj)
 {
	var o=getElement(obj);
	if (o.offsetHeight)
		return o.offsetHeight;
	else
		return o.height;
 }

 function getScrollX()
 {
	var scrOfX = 0;
  	if(typeof( window.pageYOffset ) == 'number' )
	{
    		//Netscape compliant
		scrOfX = window.pageXOffset;
	}
	else
		if(document.body && ( document.body.scrollLeft || document.body.scrollTop ))
		{
			//DOM compliant
			scrOfX = document.body.scrollLeft;
		}
		else
			if(document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ))
			{
    				//IE6 standards compliant mode
				scrOfX = document.documentElement.scrollLeft;
  			}
	return scrOfX;
 }

 function getScrollY()
 {
	var scrOfY = 0;
  	if(typeof( window.pageYOffset ) == 'number' )
	{
    		//Netscape compliant
		scrOfY = window.pageYOffset;
	}
	else
		if(document.body && ( document.body.scrollLeft || document.body.scrollTop ))
		{
			//DOM compliant
			scrOfY = document.body.scrollTop;
		}
		else
			if(document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ))
			{
    				//IE6 standards compliant mode
				scrOfY = document.documentElement.scrollTop;
  			}
	return scrOfY;
 }

 function showElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.display='block';
 }

 function hideElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.display='none';
 }

 function showHideElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.display=o.style.display=='none'?'block':'none';	 
 }
 
 function elementShow(obj)
 {
	var o=getElement(obj);
	if (o!=null)
		o.style.visibility='visible';
 }

 function elementHide(obj)
 {
	var o=getElement(obj);
	if (o!=null)
		o.style.visibility='hidden';
 }

 function markElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.color='#FF0000';
 }

 function unMarkElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.color='#000000';
 }

 function delconfirm(param)
 {
	if (param)
		return confirm('Czy na pewno chcesz usun±æ '+param+'?');
	else
		return confirm('Czy na pewno chcesz usun±æ?');
 }

 function preloader(images)
 {
	for (i=0;i<images.length;i++)
	{
		var img=new Image();
		img.src=images[i];
	}
 }
	
 function rolover(object,image)
 {
	getElement(object).src=image;		
 }
	

 function resizeGraph(obj,w,h)
 {
	if (w>0 && obj.width>w)
	{
		obj.height=(obj.height*w)/obj.width;
		obj.width=w;
	}

	if (h>0 && obj.height>h)
	{
		obj.width=(obj.width*h)/obj.height;
		obj.height=h;
	}

 }

 function getPictureDim(path,w,h)
 {
	ext=path.substring(path.length-3,path.length);
	if (ext=='jpg' || ext=='gif' || ext=='png' || ext=='tif' || ext=='bmp')
	{
		var img = new Image();
		img.src = path;
		img.onLoad = setDim(img,w,h);
	}
 }
	
 function setDim(img,w,h)
 {
	if (img.width && img.width>0)
		getElement(w).value=img.width;
	else
		if (img.offsetWidth && img.offsetWidth>0)
			getElement(w).value=img.offsetWidth;
	if (img.height && img.height>0)
		getElement(h).value=img.height;
	else
		if (img.offsetHeight && img.offsetHeight>0)
			getElement(h).value=img.offsetHeight;
 }

 hWindow = null;
 function imgpreview(src, w, h)
 {
	if(window.screen)
	{
 		aw=screen.availWidth;
	 	ah=screen.availHeight;
	}else
	{
	 aw=1024;
	 ah=768;
	}

	if(hWindow==null || hWindow.closed)
	{
 		param=
 		"left=" + (aw-w)/2 + ","
 		+"top=" + (ah-h)/2 + ","
 		+"screenX=" + (aw-w)/2 + ","
 		+"screenY=" + (ah-h)/2 + ","
 		+"width=" + w + ","
 		+"height=" + h + ","
 		+"innerWidth=" + w + ","
 		+"innerHeight=" + h + ","
 		+"toolbar=no,"
 		+"location=no,"
 		+"directories=no,"
 		+"status=no,"
	 	+"menubar=no,"
	 	+"scrollbars=no,"
		+"resizable=no"
 		hWindow = window.open("",'preview',param);
	}

	hWindow.document.open();
	hWindow.document.clear();
	hWindow.document.write(
				"<html><head>\n" 
				+ "<title>Podgl±d</title>\n"
				+ "</head>\n"
				+ "<body topmargin=0 leftmargin=0 bgcolor=\"#FFFFFF\" width="+ w +" height="+ h +" style=\"background-repeat:no-repeat;cursor:pointer\" onclick=\"javascript:window.close();\" onload=\"document.getElementById('box').style.display='none';document.getElementById('image').style.display='block'\"><div id=\"box\" align=\"center\" style=\"font-family:Verdana;font-size:9pt\"><b>Loading...</b></div><img src=\""+src+"\" id=\"image\" width=\""+w+"\" height=\""+h+"\" style=\"display:none\" alt=\"\" /></body>\n"
				+ "</html>");
	hWindow.document.close();
	hWindow.focus();
 }

 SWFObject= function (id, src, width, height, version, autowrite)
 {
	this.id = id;
	this.src = src;
	this.width = width;
	this.height = height;
	this.param = new Array();
	this.version = (typeof version == 'string')?version:'7,0,19,0';
	if (autowrite)
		document.write(this.getHTML());
 }

SWFObject.prototype = {

	getHTML: function ()
	{
		var str = "";

		str += '<div style="position:relative;width:'+ this.width +'px;height:'+ this.height +'px;z-index:0">';
		str += '<object id="'+ this.id +'" name="'+ this.id +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ this.version +'" width="'+ this.width +'" height="'+ this.height +'">';
		str += '<param name="movie" value="'+ this.src +'" />';		
		str += '<param name="quality" value="high" />';
		str += '<param name="wmode" value="transparent" />';

		for(i=0;i<this.param.length;i++)
			str += '<param name="'+ this.param[i][0] +'" value="'+ this.param[i][1] +'" />';
			
		str += '<embed id="'+ this.id +'" name="'+ this.id +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+ this.src +'" width="'+ this.width +'" height="'+ this.height +'" wmode="transparent" quality="high" ';
		
		for(i=0;i<this.param.length;i++)
			str += this.param[i][0] +'="'+ this.param[i][1] +'" ';
		
		str += '/>';
		str += '</'+'object>';
		str += '</'+'div>';

		return str;
	},
	
	setParam: function(name, value)
	{
		this.param[this.param.length]=new Array(name, value);
	},
	
	write: function ()
	{
		document.write(this.getHTML());	
	}
}


 function getElement(obj)
 {
	return document.getElementById(obj);
 }

 function getElementLeft(obj)
 {
	var o=getElement(obj);
	var curentleft = 0;
	if (o.offsetParent)
	{
		while (o.offsetParent)
		{
			curentleft += o.offsetLeft
			o = o.offsetParent;
		}
	}
	else if (o.x)
		curentleft += o.x;
	return curentleft;
 }

 function getElementWidth(obj)
 {
	var o=getElement(obj);
	if (o.offsetWidth)
		return o.offsetWidth;
	else
		return o.width;
 }

 function getElementTop(obj)
 {
	var o=getElement(obj);
	var curenttop = 0;
	if (o.offsetParent)
	{
		while (o.offsetParent)
		{
			curenttop += o.offsetTop;
			o = o.offsetParent;
		}
	}
	else if (o.y)
		curenttop += o.y;
	return curenttop;
 }

 function getElementHeight(obj)
 {
	var o=getElement(obj);
	if (o.offsetHeight)
		return o.offsetHeight;
	else
		return o.height;
 }

 function getScrollX()
 {
	var scrOfX = 0;
  	if(typeof( window.pageYOffset ) == 'number' )
	{
    		//Netscape compliant
		scrOfX = window.pageXOffset;
	}
	else
		if(document.body && ( document.body.scrollLeft || document.body.scrollTop ))
		{
			//DOM compliant
			scrOfX = document.body.scrollLeft;
		}
		else
			if(document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ))
			{
    				//IE6 standards compliant mode
				scrOfX = document.documentElement.scrollLeft;
  			}
	return scrOfX;
 }

 function getScrollY()
 {
	var scrOfY = 0;
  	if(typeof( window.pageYOffset ) == 'number' )
	{
    		//Netscape compliant
		scrOfY = window.pageYOffset;
	}
	else
		if(document.body && ( document.body.scrollLeft || document.body.scrollTop ))
		{
			//DOM compliant
			scrOfY = document.body.scrollTop;
		}
		else
			if(document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ))
			{
    				//IE6 standards compliant mode
				scrOfY = document.documentElement.scrollTop;
  			}
	return scrOfY;
 }

 function showElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.display='block';
 }

 function hideElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.display='none';
 }

 function showHideElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.display=o.style.display=='none'?'block':'none';	 
 }
 
 function elementShow(obj)
 {
	var o=getElement(obj);
	if (o!=null)
		o.style.visibility='visible';
 }

 function elementHide(obj)
 {
	var o=getElement(obj);
	if (o!=null)
		o.style.visibility='hidden';
 }

 function markElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.color='#FF0000';
 }

 function unMarkElement(obj)
 {
	o=getElement(obj);
	if (o!=null)
		o.style.color='#303030';
 }

 function delconfirm(param)
 {
	if (param)
		return confirm('Czy na pewno chcesz usun±æ '+param+'?');
	else
		return confirm('Czy na pewno chcesz usun±æ?');
 }

 function preloader(images)
 {
	for (i=0;i<images.length;i++)
	{
		var img=new Image();
		img.src=images[i];
	}
 }
	
 function rolover(object,image)
 {
	getElement(object).src=image;		
 }
	

 function resizeGraph(obj,w,h)
 {
	if (w>0 && obj.width>w)
	{
		obj.height=(obj.height*w)/obj.width;
		obj.width=w;
	}

	if (h>0 && obj.height>h)
	{
		obj.width=(obj.width*h)/obj.height;
		obj.height=h;
	}

 }

 function getPictureDim(path,w,h)
 {
	ext=path.substring(path.length-3,path.length);
	if (ext=='jpg' || ext=='gif' || ext=='png' || ext=='tif' || ext=='bmp')
	{
		var img = new Image();
		img.src = path;
		img.onLoad = setDim(img,w,h);
	}
 }
	
 function setDim(img,w,h)
 {
	if (img.width && img.width>0)
		getElement(w).value=img.width;
	else
		if (img.offsetWidth && img.offsetWidth>0)
			getElement(w).value=img.offsetWidth;
	if (img.height && img.height>0)
		getElement(h).value=img.height;
	else
		if (img.offsetHeight && img.offsetHeight>0)
			getElement(h).value=img.offsetHeight;
 }

 hWindow = null;
 function IMGpopup(src, w, h, t)
 {
	if(window.screen)
	{
		aw=screen.availWidth;
		ah=screen.availHeight;
	}else
	{
		aw=1024;
		ah=768;
	}

	if(hWindow==null || hWindow.closed)
	{
 		param=
 		"left=" + (aw-w)/2 + ","
 		+"top=" + (ah-h)/2 + ","
 		+"screenX=" + (aw-w)/2 + ","
 		+"screenY=" + (ah-h)/2 + ","
 		+"width=" + w + ","
 		+"height=" + h + ","
 		+"innerWidth=" + w + ","
 		+"innerHeight=" + h + ","
 		+"toolbar=no,"
 		+"location=no,"
 		+"directories=no,"
 		+"status=no,"
	 	+"menubar=no,"
	 	+"scrollbars=no,"
		+"resizable=no"
 		hWindow = window.open("",'preview',param);
	}

	hWindow.document.open();
	hWindow.document.clear();
	hWindow.document.write(
				"<html><head>\n" 
				+ "<title>"+ (t ? t : "Obrazek") + "</title>\n"
				+ "</head>\n"
				+ "<body topmargin=0 leftmargin=0 bgcolor=\"#FFFFFF\" width="+ w +" height="+ h +" style=\"background-repeat:no-repeat;cursor:pointer\" onclick=\"javascript:window.close();\" onload=\"document.getElementById('box').style.display='none';document.getElementById('image').style.display='block'\"><div id=\"box\" align=\"center\" style=\"font-family:Verdana;font-size:9pt\"><b>Loading...</b></div><img src=\""+src+"\" id=\"image\" width=\""+w+"\" height=\""+h+"\" style=\"display:none\" alt=\"' + (t?t:'') + '\" /></body>\n"
				+ "</html>");
	hWindow.document.close();
	hWindow.focus();
 }

 popup = null;

 function popupSWF(src, w, h)
 {
	if(window.screen)
	{
 		aw=screen.availWidth;
	 	ah=screen.availHeight;
	}
	else
	{
		aw=1024;
		ah=768;
	}

	if (popup == null)
	{

		document.write('<div id="popup" style="position:absolute;top:'+0+'px;left:'+((aw-w)/2)+'px;width:'+(w+10)+'px;height:'+(h+10)+'px">');
		document.write('<table cellspacing="0" cellpadding="0"><tr><td></td><td align="right"><span style="cursor:pointer; padding:0px; font-size:9pt; font-weight:bold" onclick="javascript:hideElement(\'popup\');">x</span></td></tr><tr><td>');
		new SWFObject('popup', src, w, h, null, true)
		document.write('</td><td></td></tr></table>');
		document.write('</div>');
	}
 }

 function popupIMG(src, w, h, a)
 {
	if(window.screen)
	{
 		aw=screen.availWidth;
	 	ah=screen.availHeight;
	}
	else
	{
		aw=1024;
		ah=768;
	}

	if (popup == null)
	{
		document.write('<div id="popup" style="position:absolute;top:'+0+'px;left:'+((aw-w)/2)+'px;width:'+(w+10)+'px;height:'+(h+10)+'px">');
		document.write('<table cellspacing="0" cellpadding="0"><tr><td></td><td align="right"><span style="cursor:pointer; padding:0px; font-size:9pt; font-weight:bold" onclick="javascript:hideElement(\'popup\');">x</span></td></tr><tr><td>');
		document.write('<img src="' + src + '" width="' + w + '" height="' + h + '" alt="' + (a?a:'') + '" onclick="javascript:hideElement(\'popup\');" />');
		document.write('</td><td></td></tr></table>');
		document.write('</div>');
		window.setTimeout('popupMove()', 100);
	}
 }

 function popupMove()
 {
	if(window.screen)
	{
 		aw=screen.availWidth;
	 	ah=screen.availHeight;
	}
	else
	{
		aw=1024;
		ah=768;
	}

	var h = parseInt(getElement('popup').style.height.substr(0,getElement('popup').style.height.length-2));
	var y = parseInt(getElement('popup').style.top.substr(0,getElement('popup').style.top.length-2));
	
	if (y < ((ah-h)/4))
	{
		getElement('popup').style.top = (y + 10) + 'px';
		window.setTimeout('popupMove()', 100);
	}
 }
 function popupHide()
 {
	hideElement('popup');
 }

 SWFObject= function (id, src, width, height, version, autowrite)
 {
	this.id = id;
	this.src = src;
	this.width = width;
	this.height = height;
	this.param = new Array();
	this.version = (typeof version == 'string')?version:'7,0,19,0';
	if (autowrite)
		document.write(this.getHTML());
 }

SWFObject.prototype = {

	getHTML: function ()
	{
		var str = "";

		str += '<div style="position:relative;width:'+ this.width +'px;height:'+ this.height +'px;z-index:0">';
		str += '<object id="'+ this.id +'" name="'+ this.id +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ this.version +'" width="'+ this.width +'" height="'+ this.height +'">';
		str += '<param name="movie" value="'+ this.src +'" />';		
		str += '<param name="quality" value="high" />';
		str += '<param name="wmode" value="transparent" />';

		for(i=0;i<this.param.length;i++)
			str += '<param name="'+ this.param[i][0] +'" value="'+ this.param[i][1] +'" />';
			
		str += '<embed id="'+ this.id +'" name="'+ this.id +'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+ this.src +'" width="'+ this.width +'" height="'+ this.height +'" wmode="transparent" quality="high" ';
		
		for(i=0;i<this.param.length;i++)
			str += this.param[i][0] +'="'+ this.param[i][1] +'" ';
		
		str += '/>';
		str += '</'+'object>';
		str += '</'+'div>';

		return str;
	},
	
	setParam: function(name, value)
	{
		this.param[this.param.length]=new Array(name, value);
	},
	
	write: function ()
	{
		document.write(this.getHTML());	
	}
}
