<!--



var timer = '';
var doit = '';
var tempX = 0;
var tempY = 0;
var tx = 0;
var ty = 0;

var IE = document.all ? true : false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);

function getMouseXY(e) {	
	if( doit != ''){
	  if (IE) { // grab the x-y pos.s if browser is IE
	  	if( (event ? event.clientY : ty) + document.getElementById(doit).offsetHeight + 20 >= (document.documentElement.offsetHeight ? document.documentElement.offsetHeight : document.body.offsetHeight) && (event ? event.clientY : ty) - document.getElementById(doit).offsetHeight + 30  >= 0){
	  		if( document.documentElement && document.documentElement.scrollTop){
		  		tempY = (event ? event.clientY : ty) + document.documentElement.scrollTop - document.getElementById(doit).offsetHeight - 20;
		  		tempX = (event ? event.clientX : tx) + document.documentElement.scrollLeft;
		  	} else if( document.body && document.body.scrollTop ){
		  		tempY = (event ? event.clientY : ty) + document.body.scrollTop - document.getElementById(doit).offsetHeight - 20;
		  		tempX = (event ? event.clientX : tx) + document.body.scrollLeft;
		  	} else {
		  		tempY = (event ? event.clientY : ty) - document.getElementById(doit).offsetHeight - 20;
		  		tempX = (event ? event.clientX : tx);
		  	}
	  	} else {
		  	if( document.documentElement && document.documentElement.scrollTop){
		  		tempY = (event ? event.clientY : ty) + document.documentElement.scrollTop + 20;
		  		tempX = (event ? event.clientX : tx) + document.documentElement.scrollLeft;
		  	} else if( document.body && document.body.scrollTop ){
		  		tempY = (event ? event.clientY : ty) + document.body.scrollTop + 20;
		  		tempX = (event ? event.clientX : tx) + document.body.scrollLeft;
		  	} else {
		  		tempY = (event ? event.clientY : ty) + 20;
		  		tempX = (event ? event.clientX : tx);
		  	}
	  }
	  	if( event ) {
	  		tx = event.clientX;
	  		ty = event.clientY;
	  	}
	  	
	} else {  // grab the x-y pos.s if browser is NS
		if( e ){
	  		tx = e.pageX;
	  		ty = e.pageY;
		}
		if( innerHeight && innerHeight > 0 && (e ? e.pageY : ty) - document.documentElement.scrollTop + document.getElementById(doit).offsetHeight + 20 >= innerHeight && (e ? e.pageY : ty) - document.documentElement.scrollTop - document.getElementById(doit).offsetHeight + 30 > 0 ){
	  		tempX = (e ? e.pageX : tx);
	  		tempY = (e ? e.pageY : ty) - document.getElementById(doit).offsetHeight - 20;
	  	} else {
		    tempX = (e ? e.pageX : tx);
		    tempY = (e ? e.pageY : ty) + 20;
	  	}
	  }
	  return true
	} else {
		tempX = 0;
		tempY = 1000
	}
}
document.onmousemove = getMouseXY;
var px = '';
if( IE )
	px = '';
else
	px = 'px';
function trail() {
	if( doit != '' ){
		t = parseFloat(tempX)-150;
		document.getElementById(doit).style.left = t + px;
		t = parseFloat(tempY);
		document.getElementById(doit).style.top= t + px;
		timer=setTimeout("trail();",30);
	}
}

function hbox(id,src_s){
	if( doit ){
		document.getElementById(doit).style.display = 'none';
	}
	if( document.getElementById(id) ){
		doit = id;
		document.getElementById(id).style.display = 'block';
		getMouseXY();
		if( document.getElementById("foto_"+doit) )
			document.getElementById("foto_"+doit).src = src_s;
		trail();
	}
}
function hhbox(id){
	if( document.getElementById(id) )
		document.getElementById(id).style.display = 'none';
	//setTimeout("document.getElementById('"+id+"').style.display = 'none';",30);
	doit = '';
}

//Menu DMS
function preSelectMenu(id) { selectMenu("menu" + id, id); }
function selectMenu(th, id) {
  th = document.getElementById(th);
  //ukrywam podmenu innych dzialow
  var Nodes = document.getElementsByTagName('div')
  var max = Nodes.length

  for (var i = 0; i < max; i++) {
    var nodeObj = Nodes.item(i);

    if (nodeObj.id.indexOf("pos") != -1) {
      nodeObj.style.display = "none";
    }
  }

  //pokazuje podmenu
  if (document.getElementById("pos" + id)) document.getElementById("pos" + id).style.display = "block";

  //zmieniam style innych butonow dzialow
  var Nodes = document.getElementsByTagName('div')
  var max = Nodes.length

  for (var i = 0; i < max; i++) {
    var nodeObj = Nodes.item(i);

    if (nodeObj.id.indexOf("menu") != -1) {
      nodeObj.className = "menupoz";
    }
  }

  //zmieniam styl wybranego buttony dzialu
  if (th) th.className = "menupoz2";
}
//Menu DMS

var def_color1 = "menupoz";
var act_color1 = "menupoz2";
var def_color = "menupoz_1";
var act_color = "menupoz_2";
var wysokosc_menu_level_1 = 29;
var przesuniecie_level_1 = 0; 

var wysokosc_submenulink = 5;
var przesuniecie_submenulink = -1;

var last;
var obji = new Array(5);
var objj = new Array(5);

var mTimer = null;

function showOpis( s ){
    var oid = 'w'+s.options[s.selectedIndex].value;
    hideall();
    if( document.getElementById(oid) )
      linkuj(oid);

}

function setTimer(){
     clearTimeout(mTimer);
     mTimer = setTimeout("hide('clr')" , 60000 );
}

function setFastTimer(){
     clearTimeout(mTimer);
     mTimer = setTimeout("hide('clr')" , 50 );
}

function seth(objs, c, id, h){
   setTimer();
   unset(c);  
   hide(c); 
   obji[c] = objs;
   objj[c] = id;
     
   objs.className = act_color;

   show(id, h, 'sublink');     
   setTimer();
}

function unset(c){
   setFastTimer();
   if( obji[c] != null )
      obji[c].className = def_color;
}

function setp(c, id, h, mode){
  hide();
  setTimer();
  for (var i = 0;i<obji.length;i++)
  {
    if( obji[i] != null )
      obji[i].className = def_color;
  }

  show(id, h, mode);

  if( objj[c] != null ){
     document.getElementById(objj[c]).className = def_color1;
     document.getElementById('h'+objj[c]).className = def_color1;
  }
  
  document.getElementById(id).className = act_color1;
  document.getElementById('h'+id).className = act_color1;
  objj[c] = id;
}

function unsetp(id, c){
  setFastTimer();
}

function show(id, h, mode){ 
   divmenu = 'm'+id;
   obj = document.getElementById(divmenu);
   if( obj ){   
     pos = getAnchorPosition(id);
     if( mode=='sublink' ){  
     	if( document.getElementById('ma'+h) ){
     		 if( document.getElementById('ma'+h).clientWidth > 0 )
				ww = document.getElementById('ma'+h).clientWidth;
		     else if( document.getElementById('ma'+h).offsetWidth )
				ww = document.getElementById('ma'+h).clientWidth;
	     	 document.getElementById(divmenu).style.left = parseFloat(parseFloat(document.getElementById('ma'+h).style.left) + parseFloat(ww)+przesuniecie_submenulink)+'px'; 
	     	 document.getElementById(divmenu).style.top = parseFloat(parseFloat(pos.y)-parseFloat(wysokosc_submenulink))+'px';
     	}
     }else if( mode=='center' ){
     	document.getElementById(divmenu).style.display='block';
     	document.getElementById(divmenu).style.left= parseFloat(pos.x+przesuniecie_level_1-(document.getElementById(divmenu).clientWidth/2)+(document.getElementById(id).clientWidth/2)+1)+'px';
     } else if( mode=='right' ){
     	document.getElementById(divmenu).style.display='block';
     	document.getElementById(divmenu).style.left= parseFloat(pos.x+przesuniecie_level_1-document.getElementById(divmenu).clientWidth+document.getElementById(id).clientWidth+1)+'px';
     } else {
     	document.getElementById(divmenu).style.left= parseFloat(pos.x+przesuniecie_level_1)+'px';
     	document.getElementById(divmenu).style.top= parseFloat(pos.y+wysokosc_menu_level_1)+'px';
   	 }
     document.getElementById(divmenu).style.display='block';  
     setTimer();
   }
}

function hide(c) {
  if( c == "clr" ){
  	 for (var i = 0;i<objj.length;i++){
     	if( objj[i] && document.getElementById(objj[i])&& document.getElementById('h'+objj[i]) ){
          document.getElementById(objj[i]).className = def_color1;
     	  document.getElementById('h'+objj[i]).className = def_color1;
     	}
     }
  }
  if( c > 0 ){
  	 if(objj[c] && document.getElementById('m'+objj[c]) )	
  	 	document.getElementById('m'+objj[c]).style.display = 'none';
     
  } else {
     var Nodes = document.getElementsByTagName('div')
     var max = Nodes.length
     for(var i=0;i<max;i++) {
                 var nodeObj = Nodes.item(i);                                
                 if(nodeObj.id.indexOf('ma')!=-1 ) {
                    nodeObj.style.display = 'none';                                
                 }
     }
     
  }
}    

function czysc(o){
  for (var i=0; i<o.length;i++) {
      if( o[i].type!= 'hidden' && o[i].type!= 'submit' && o[i].type!= 'button'){
        o[i].value = "";
      }
  }
}

function go(url){
  document.location.href = url;
}

function go_form(f, url){
   f.action = url;
   f.submit();
}

function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;	document.location.href = gourl;
}

function otworz( host, url, tytul, szer, wys, extra_foto ){
    if (parseInt(szer) > 800 || parseInt(wys) > 800){
        NoweOkienko=window.open(url, tytul);
    } else{
		if( extra_foto )
			wys = parseInt(wys)+50;
		if( parseInt(szer) < 150 )
			szer = 350;

        config='left=100,top=100,width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no';
        NoweOkienko=window.open('', tytul, config);
        NoweOkienko.document.open();
        NoweOkienko.document.write('<HTML>');
        NoweOkienko.document.write('<HEAD>');
        NoweOkienko.document.write('<TITLE>'+tytul+'</TITLE>');
        NoweOkienko.document.write('</HEAD>');
        NoweOkienko.document.write('<body style="padding: 0px; margin: 0px;" bgcolor="#ffffff">');
        if( extra_foto )
			NoweOkienko.document.write('<table height="50" cellpadding="0" cellspacing="0" width="100%"><tr><td><img src="'+host+'/logo.gif"></td><td align="right"><img src="'+host+'/'+extra_foto+'"></td></tr></table>');
        NoweOkienko.document.write('<div align="center"><A HREF=# onclick="javascript:self.close();"><IMG SRC="'+host+'/'+url+'" BORDER=0 ALT="Zamknij"></A></div>');
        NoweOkienko.document.write('</BODY>');
        NoweOkienko.document.write('</HTML>');
        NoweOkienko.document.close();
        NoweOkienko.focus();
    }
}
function otworz_url( url, szer, wys, scroll ){
	if( !scroll )
		scroll = "no";
    config='left=100,top=100,width='+szer+',height='+wys+',innerheight='+wys+',innerwidth='+szer+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars='+scroll+',resizable=yes';
    NoweOkienko=window.open(url, '', config);
}

function getAnchorPosition(anchorname) {
	// This function will return an Object with x and y properties
	var useWindow=false;
	var coordinates=new Object();
	var x=0,y=0;
	// Browser capability sniffing
	var use_gebi=false, use_css=false, use_layers=false;
	if (document.getElementById) { use_gebi=true; }
	else if (document.all) { use_css=true; }
	else if (document.layers) { use_layers=true; }
	// Logic to find position
 	if (use_gebi && document.all) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_gebi) {
		var o=document.getElementById(anchorname);
		x=AnchorPosition_getPageOffsetLeft(o);
		y=AnchorPosition_getPageOffsetTop(o);
		}
 	else if (use_css) {
		x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]);
		y=AnchorPosition_getPageOffsetTop(document.all[anchorname]);
		}
	else if (use_layers) {
		var found=0;
		for (var i=0; i<document.anchors.length; i++) {
			if (document.anchors[i].name==anchorname) { found=1; break; }
			}
		if (found==0) {
			coordinates.x=0; coordinates.y=0; return coordinates;
			}
		x=document.anchors[i].x;
		y=document.anchors[i].y;
		}
	else {
		coordinates.x=0; coordinates.y=0; return coordinates;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// getAnchorWindowPosition(anchorname)
//   This function returns an object having .x and .y properties which are the coordinates
//   of the named anchor, relative to the window
function getAnchorWindowPosition(anchorname) {
	var coordinates=getAnchorPosition(anchorname);
	var x=0;
	var y=0;
	if (document.getElementById) {
		if (isNaN(window.screenX)) {
			x=coordinates.x-document.body.scrollLeft+window.screenLeft;
			y=coordinates.y-document.body.scrollTop+window.screenTop;
			}
		else {
			x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
			y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
			}
		}
	else if (document.all) {
		x=coordinates.x-document.body.scrollLeft+window.screenLeft;
		y=coordinates.y-document.body.scrollTop+window.screenTop;
		}
	else if (document.layers) {
		x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset;
		y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset;
		}
	coordinates.x=x;
	coordinates.y=y;
	return coordinates;
	}

// Functions for IE to get position of an object
function AnchorPosition_getPageOffsetLeft (el) {
	var ol=el.offsetLeft;
	while ((el=el.offsetParent) != null) { ol += el.offsetLeft; }
	return ol;
	}
function AnchorPosition_getWindowOffsetLeft (el) {
	return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft;
	}	
function AnchorPosition_getPageOffsetTop (el) {
	var ot=el.offsetTop;
	while((el=el.offsetParent) != null) { ot += el.offsetTop; }
	return ot;
	}
function AnchorPosition_getWindowOffsetTop (el) {
	return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop;
	}

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 sortp(s, k, base){
    var gourl = s.options[s.selectedIndex].value;
	if( k ){
		document.location.href= base+k+"&sort="+gourl;
	} else {
    	document.location.href= base+"?sort="+gourl;	
	}
}

function getcheck(a, b){
   if( a.checked )
     hideall("block", b);
   else
     hideall("none", b);
}

function hideall(all, b) {
                        var Nodes = document.getElementsByTagName('table')
                        var max = Nodes.length
                        for(var i=0;i<max;i++) {
                                var nodeObj = Nodes.item(i);                                
                                if(nodeObj.id.indexOf(b)!=-1) {
                                   nodeObj.style.display = all;                                
                                }
                        }
}       
function hideallt(all, ids, tag) {
                        var Nodes = document.getElementsByTagName(tag)
                        var max = Nodes.length
                        for(var i=0;i<max;i++) {
                                var nodeObj = Nodes.item(i);                                
                                if(nodeObj.id.indexOf(ids)!=-1) {
                                   nodeObj.style.display = all;                                
                                }
                        }
}

function zaplataSelect(){
	document.zamow.action = location.href+"&nc=1";
	document.zamow.submit();
}

function mailer(pre, dom, c, mpre, mdom){
	document.write("<a href='mailto:"+pre+"@"+dom+"' "+c+">"+mpre+(mdom ? "@"+mdom : "")+"</a>");
}

// -->  
<!--
parchor = '';
nanchor = '';
 var myWidth = 0;
 if( typeof( window.innerWidth ) == 'number' ) {
	 //Non-IE
	 myWidth = window.innerWidth;
 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	 //IE 6+ in 'standards compliant mode'
	 myWidth = document.documentElement.clientWidth;
 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	 //IE 4 compatible
	 myWidth = document.body.clientWidth;
 }
 // Split the string into part [0] and part [1]
temp=navigator.appVersion.split('MSIE');

// Parse the string for the "6" in 6.0
ieVer=parseInt(temp[1]);

// Is it greater than 6?
var isIE6=(ieVer == 6)?1:0; 
var load_stan = false;	  
function DmsImageBox(){
	this.init = function (){
		if (!document.getElementsByTagName){ return; }
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			var relAttribute = String(anchor.getAttribute('rel'));
			if (anchor.getAttribute('href') && (relAttribute.match('DmsImageBox'))){
				anchor.onclick = function () {return DmsImageBox.start(this);}
			}
		}
		
		var objOverlay = document.createElement("div");
		objOverlay.setAttribute('id','overlay');
		objOverlay.style.display = 'none';
		objOverlay.setAttribute('align','center');
		objOverlay.style.left = '0px';
		objOverlay.style.top = '0px';
		objOverlay.style.filer = 'alpha(opacity=60)';
		objOverlay.style.opacity = '0.6';
		objOverlay.style.width = '100%';
		objOverlay.style.height = '500px';
		objOverlay.style.zIndex = '90';
		objOverlay.style.position = 'absolute';
		objOverlay.style.background = '#000000';
		
		objOverlay.onclick = function() { DmsImageBox.end(); return false; }
		var objInside = document.createElement("div");
		document.body.appendChild(objOverlay);
		
		objInside.setAttribute('id','inside');
		objInside.style.display = 'none';
		objInside.setAttribute('align','center');
		objInside.style.background = '#ffffff';
		objInside.style.top = '10px';
		objInside.style.marginBottom = '10px';
		objInside.style.position = 'absolute';
		objInside.style.padding = '10px';
		objInside.style.zIndex = '91';
		document.body.appendChild(objInside);
		
		pic1= new Image(24,24); 
		pic1.src="/grafika/loading.gif";
		
	}
	this.loadingInfo = function(fast_start){
		var arrayPageSize = getPageSize();
		hideSelectBoxes();
		document.getElementById('overlay').style.height = arrayPageSize[1]+'px';
		document.getElementById('inside').style.width = '250px';
		document.getElementById('inside').style.height = '150px';
		
		arrayPageScroll = getPageScroll();
		
		
		s = parseFloat(arrayPageScroll[1])+ 10;
		if( s < parseFloat(arrayPageScroll[1]) + 10 )
			s = parseFloat(arrayPageScroll[1])+10;
			
		document.getElementById('inside').style.top = s+'px';
		
		document.getElementById('inside').innerHTML = '<table cellpadding=0 cellspacing=0 width=100% height=100%><tr><td valign=middle align=center><img src="/grafika/loading.gif" border=0></td></tr></table>';
		if( fast_start != 1 )
			opacity('overlay', 0, 60, 500);
		x = Math.round(arrayPageSize[2]/2) - 75;
		document.getElementById('inside').style.left = x+'px';
		opacity('inside', 0, 100, 200);
	}
	this.start = function (obj, fast_start){
		bigImg = obj.getAttribute('href');
		title = obj.getAttribute('rel_name');
		if( !title )
			title = '';
		imgPreloader = new Image();
		this.loadingInfo(fast_start);
		load_stan = true;
		imgPreloader.onload= function() {
			clearOpacity('inside');
			changeOpac(0, 'inside');
			DmsImageBox.showImage(bigImg, this.width, this.height, title);
		}		
		imgPreloader.src = bigImg;
		return false;
	}
	this.showImage = function (src, width, height, title){
	if( load_stan == true ){
		z = 0;
		zi = -1;
		prev = '';
		panchor = '';
		nanchor = '';
		plink = '';
		nlink = '';
		
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			var relAttribute = String(anchor.getAttribute('rel'));
			if (anchor.getAttribute('href') && (relAttribute.match('DmsImageBox'))){
				if( anchor.getAttribute('href') == src){
					panchor = prev;
					if( prev )
						plink = "DmsImageBox.start(panchor, 1);";
					zi = z+1;
				}
				if( zi == z ){
					nanchor = anchor;
					nlink = "DmsImageBox.start(nanchor, 1);";
				}
				prev = anchor;
				z++;
			}
		}
		
		var arrayPageSize = getPageSize();
		if( width < 400 )	
			width = 400;
		if( height < 300 )
			height = 300;
		x = Math.round(arrayPageSize[2]/2) - Math.round(width/2);
		document.getElementById('inside').style.left = x+'px';
		height = parseFloat(height) + 30;
		document.getElementById('inside').style.width = width+'px';
		document.getElementById('inside').style.height = height+'px';
		arrayPageScroll = getPageScroll();
		
		s = parseFloat(arrayPageScroll[1])+ 10;
		
		document.getElementById('inside').style.top = s+'px';
		
		var arrayPageSize = getPageSize();
		if( parseInt(height) + s + 50 > arrayPageSize[1] ){
				tmp =  parseInt(height) + s + 50;
				document.getElementById('overlay').style.height = tmp+'px';
		}
		
		htm = '<table style="filter:alpha(opacity=100);" cellpadding=0 cellspacing=0 width=100% height=100%><tr><td colspan=3 valign=middle align=center><img onClick="DmsImageBox.end();" style="cursor: pointer;" border=0 src="'+src+'" border=0></td></tr><tr><td align=left height=20 style="padding-top: 8px;color:#000000;" width="250">'+
		(panchor != '' ? '<div style="filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;cursor:hand; width: 25px; text-align: center; padding-top: 6px;padding-bottom: 5px;position: absolute; top: 100px;"><a style="color: #000000;" href="javascript:void(0)" onclick="'+plink+'"><img src="/grafika/ico_back.gif" border="0"></a></div>' : '')+
		zi+'&nbsp;/&nbsp;'+z+'</td><td width="'+(width-50)+'" style="padding-top: 8px;color:#000000;" align=center>'+title+'</td><td width=25>'+
		(nanchor != '' ? '<div style="filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;cursor:hand; width: 25px; text-align: center; padding-top: 6px;padding-bottom: 5px;position: absolute; top: 100px;"><a style="color: #000000;" href="javascript:void(0)" onclick="'+nlink+'"><img src="/grafika/ico_next.gif" border="0"></a></div>' : '')+
		(isIE6 ? "<br>" : "")+'<div style="float: right"><div style="filter:alpha(opacity=50);-moz-opacity:.50;opacity:.50;cursor:hand; width: 25px; text-align: center; padding-top: 6px;padding-bottom: 5px;"><a style="color: #000000" href="javascript: DmsImageBox.end();"><img src="/grafika/ico_close.gif" border="0"></a></div></div></td></tr></table>';
		
		document.getElementById('inside').innerHTML = htm;
		opacity('inside', 0, 100, 500);
		var arrayPageSize = getPageSize();
		document.getElementById('overlay').style.height = arrayPageSize[1]+'px';
		load_stan = false;
	}}

	this.end = function (){
		load_stan = false;
		imgPreloader.onLoad = "void();";
		changeOpac(0, 'inside');
		clearOpacity('inside');
		//opacity('inside', 100, 0, 100);
		opacity('overlay', 60, 0, 100);
		showSelectBoxes();
	}
}

function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){ // Explorer 6 strict mode
		xScroll = document.documentElement.scrollWidth;
		yScroll = document.documentElement.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth + document.body.offsetLeft;
		yScroll = document.body.offsetHeight + document.body.offsetTop;
		alert(document.height);
	}
	
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) 
	return arrayPageSize;
}
function getPageScroll(){

	var yScroll;

	if (self.pageYOffset) {
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScroll = document.body.scrollTop;
	}

	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

var timers = Array();
timers['inside'] = Array(1000);
timers['overlay'] = Array(1000);

function clearOpacity(id){
	for(i=0;i<1000;i++){
		if( timers[id][i] )
			clearTimeout(timers[id][i]);
		timers[id][i] = "";
	}
}

function opacity(id, opacStart, opacEnd, millisec) { 
	clearOpacity(id);
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            timers[id][i] = setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
	object.display = 'block';
	if( opacity == 0 )
		document.getElementById(id).style.display = 'none';
} 
function showSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "visible";
	}
}
function hideSelectBoxes(){
	selects = document.getElementsByTagName("select");
	for (i = 0; i != selects.length; i++) {
		selects[i].style.visibility = "hidden";
	}
}

var DmsImageBox = new DmsImageBox();
function initDmsImageBox(){
	DmsImageBox.init();
	initGetUrl();
}
window.onload= initDmsImageBox;

function initGetUrl(){
	var anchors = document.getElementsByTagName('a');
	for (var i=0; i<anchors.length; i++){
		var anchor = anchors[i];
		var relAttribute = String(anchor.getAttribute('rel'));
		if (anchor.getAttribute('href') && (relAttribute.match('menu') || relAttribute.match('menu_top'))){
			anchor.onclick = function () {return getUrl(this, this.getAttribute('href'));}
		}
	}
}

function getUrl(obj, url){
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			var relAttribute = String(anchor.getAttribute('rel'));
			if (anchor.getAttribute('href') && (relAttribute.match('menu'))){
				anchor.style.textDecoration = "none";
			}
		}
		if( obj.getAttribute('rel') == "menu")
			obj.style.textDecoration = "underline";
		if (document.getElementById) {
			var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
			if(x){
				x.onreadystatechange = function(){
				if (x.readyState == 4){
					document.getElementById('gl').innerHTML = x.responseText;
					initDmsImageBox();					
				}}
				
			}
			x.open("GET", url+";content=1", true);
			if( document.getElementById('content') )
				document.getElementById('content').innerHTML = "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p align=center>Loading / Ładowanie strony</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>";
			else
				document.getElementById('content2').innerHTML = "<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p align=center>Loading / Ładowanie strony</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>";
				
			x.send(null);
		}
		return false;
}


var FlashDetect = new function(){
	var self = this;
	self.installed = false;
	self.raw = "";
	self.major = -1;
	self.minor = -1;
	self.revision = -1;
	self.revisionStr = "";
	var activeXDetectRules = [
		{
			"name":"ShockwaveFlash.ShockwaveFlash.7",
			"version":function(obj){
				return getActiveXVersion(obj);
			}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash.6",
			"version":function(obj){
				var version = "6,0,21";
				try{
					obj.AllowScriptAccess = "always";
					version = getActiveXVersion(obj);
				}catch(err){}
				return version;
			}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash",
			"version":function(obj){
				return getActiveXVersion(obj);
			}
		}
	];
	var getActiveXVersion = function(activeXObj){
		var version = -1;
		try{
			version = activeXObj.GetVariable("$version");
		}catch(err){}
		return version;
	};
	var getActiveXObject = function(name){
		var obj = -1;
		try{
			obj = new ActiveXObject(name);
		}catch(err){}
		return obj;
	};
	var parseActiveXVersion = function(str){
		var versionArray = str.split(",");//replace with regex
		return {
			"raw":str,
			"major":parseInt(versionArray[0].split(" ")[1], 10),
			"minor":parseInt(versionArray[1], 10),
			"revision":parseInt(versionArray[2], 10),
			"revisionStr":versionArray[2]
		};
	};
	var parseStandardVersion = function(str){
		var descParts = str.split(/ +/);
		var majorMinor = descParts[2].split(/\./);
		var revisionStr = descParts[3];
		return {
			"raw":str,
			"major":parseInt(majorMinor[0], 10),
			"minor":parseInt(majorMinor[1], 10), 
			"revisionStr":revisionStr,
			"revision":parseRevisionStrToInt(revisionStr)
		};
	};
	var parseRevisionStrToInt = function(str){
		return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || self.revision;
	};
	self.majorAtLeast = function(version){
		return self.major >= version;
	};
	self.FlashDetect = function(){
		if(navigator.plugins && navigator.plugins.length>0){
			var type = 'application/x-shockwave-flash';
			var mimeTypes = navigator.mimeTypes;
			if(mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description){
				var version = mimeTypes[type].enabledPlugin.description;
				var versionObj = parseStandardVersion(version);
				self.raw = versionObj.raw;
				self.major = versionObj.major;
				self.minor = versionObj.minor; 
				self.revisionStr = versionObj.revisionStr;
				self.revision = versionObj.revision;
				self.installed = true;
			}
		}else if(navigator.appVersion.indexOf("Mac")==-1 && window.execScript){
			var version = -1;
			for(var i=0; i<activeXDetectRules.length && version==-1; i++){
				var obj = getActiveXObject(activeXDetectRules[i].name);
				if(typeof obj == "object"){
					self.installed = true;
					version = activeXDetectRules[i].version(obj);
					if(version!=-1){
						var versionObj = parseActiveXVersion(version);
						self.raw = versionObj.raw;
						self.major = versionObj.major;
						self.minor = versionObj.minor; 
						self.revision = versionObj.revision;
						self.revisionStr = versionObj.revisionStr;
					}
				}
			}
		}
	}();
};
var MM_FlashCanPlay = false;
if(FlashDetect.majorAtLeast(7))   
	MM_FlashCanPlay = true; 
 		
var ji = 1;
function insertSwf(plik, width, height, transparent, border, id_replace, im){
    rnd = width+height+ji;
    ji++;

 if( id_replace && (MM_FlashCanPlay || !im)){
 	document.getElementById(id_replace).innerHTML = (
	'<object '+(border ? 'class="tfoto"' : '')+' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="movie" value="' + plik + '" /><param name="quality" value="high" />'+(transparent ? '<param name="wmode" value="transparent" />' : '<param name="bgcolor" value="'+(border ? border : '#ffffff')+'">')+'<embed src="' + plik + '" '+(transparent ? 'wmode="transparent"' : '')+' quality="high" bgcolor='+(border ? border : '#ffffff')+' width="' + width + '" height="'
         + height
         + '" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>');
 	
 } else if( MM_FlashCanPlay || !im ){
 	document.write('<div id="f'+rnd+'" style="width:'+width+';height:'+height+'px"></div>');
 	document.getElementById('f'+rnd).innerHTML = (
	'<object '+(border ? 'class="tfoto"' : '')+' classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="quality" value="high" /><param name="movie" value="' + plik + '" />'+(transparent ? '<param name="wmode" value="transparent" />' : '<param name="bgcolor" value="'+(border ? border : '#ffffff')+'">')+'<embed src="' + plik + '" '+(transparent ? 'wmode="transparent"' : '')+' quality="high" bgcolor='+(border ? border : '#ffffff')+' width="' + width + '" height="'
         + height
         + '" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/go/getflashplayer"></embed></object>');
 } else if( im ) {
 		document.write('<img src="'+im+'" width="'+width+'" height="'+height+'" '+(border ? 'class=tfoto' : '')+' border=0 />');
 }
 
}

//-->
