<!--

function onFinishedPlaying() {
	document.getElementById("gl").style.display = "block";
	document.getElementById("intro_foto").style.display = 'none';
}

//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 = 27;
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, myHeight = 0;
 if( typeof( window.innerWidth ) == 'number' ) {
	 //Non-IE
	 myWidth = window.innerWidth;
	 myHeight = window.innerHeight;
 } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	 //IE 6+ in 'standards compliant mode'
	 myWidth = document.documentElement.clientWidth;
     myHeight = document.documentElement.clientHeight;
 } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	 //IE 4 compatible
	 myWidth = document.body.clientWidth;
	 myHeight = document.body.clientHeight;
 }
		  
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 = '150px';
		document.getElementById('inside').style.height = '150px';
		
		arrayPageScroll = getPageScroll();
		
		
		s = parseFloat(arrayPageScroll[1])+Math.round(myHeight/2) - 60;
		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);
		imgPreloader.onload= function() {
			opacity('inside', 100, 0, 100);
			DmsImageBox.showImage(bigImg, this.width, this.height, title);
		}		
		imgPreloader.src = bigImg;
		return false;
	}
	this.showImage = function (src, width, height, title){
		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';
		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;" 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;" 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>' : '')+
		'<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';
	}
	this.end = function (){
		opacity('inside', 100, 0, 100);
		opacity('overlay', 60, 0, 100);
		showSelectBoxes();
	}
	this.end = function (){
		imgPreloader.onLoad = "void();";
		opacity('inside', 100, 0, 100);
		opacity('overlay', 60, 0, 100);
		showSelectBoxes();
	}
}


function getPageSize(){
	
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = document.body.scrollWidth;
		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 { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	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;
}
function opacity(id, opacStart, opacEnd, millisec) { 
    //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++) 
            { 
            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();
}
window.onload= initDmsImageBox;

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=5,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '"><PARAM NAME=movie VALUE="' + plik + '">'+(transparent ? '<PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent>' : (border ? '' : '<PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=opaque>')+'<PARAM NAME=bgcolor VALUE='+(border ? border : '#FFFFFF')+'>')+'<EMBED src="' + plik + '" '+(transparent ? 'wmode="transparent"' : (border ? "" : 'wmode="opaque"'))+' quality=high bgcolor='+(border ? border : '#FFFFFF')+' WIDTH="' + width + '" HEIGHT="'
         + height
         + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></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=5,0,0,0" WIDTH="' + width + '" HEIGHT="' + height + '"><PARAM NAME=movie VALUE="' + plik + '">'+(transparent ? '<PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=transparent>' : (border ? '' : '<PARAM NAME=quality VALUE=high><PARAM NAME=wmode VALUE=opaque>')+'<PARAM NAME=bgcolor VALUE='+(border ? border : '#FFFFFF')+'>')+'<EMBED src="' + plik + '" '+(transparent ? 'wmode="transparent"' : (border ? "" : 'wmode="opaque"'))+' quality=high bgcolor='+(border ? border : '#FFFFFF')+' WIDTH="' + width + '" HEIGHT="'
         + height
         + '" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>');
 } else if( im ) {
 		document.write('<img src="'+im+'" width="'+width+'" height="'+height+'" '+(border ? 'class=tfoto' : '')+' border=0 />');
 }
 
}

//-->