
var jest_flash = 0;
var jest_flash_6 = false;
var jest_flash_7 = false;
var jest_flash_8 = false;

if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
    if (navigator.plugins && navigator.plugins["Shockwave Flash"]) {
    	if(navigator.plugins["Shockwave Flash"].description.charAt(navigator.plugins["Shockwave Flash"].description.indexOf('.')-1) >= 6) {
    		jest_flash_6 = true;
    	}
    	if(navigator.plugins["Shockwave Flash"].description.charAt(navigator.plugins["Shockwave Flash"].description.indexOf('.')-1) >= 7) {
    		jest_flash_7 = true;
    	}
    	if(navigator.plugins["Shockwave Flash"].description.charAt(navigator.plugins["Shockwave Flash"].description.indexOf('.')-1) >= 8) {
    		jest_flash_8 = true;
    	}
	if(navigator.plugins["Shockwave Flash"].description.charAt(navigator.plugins["Shockwave Flash"].description.indexOf('.')-2) == 1 &&
	   navigator.plugins["Shockwave Flash"].description.charAt(navigator.plugins["Shockwave Flash"].description.indexOf('.')-1) == 0) {
		jest_flash_6 = true;
		jest_flash_7 = true;
    		jest_flash_8 = true;
    	}
        jest_flash = true;
    }
}

else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
    document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');

    document.write('jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3")))\n');
    document.write('if ( jest_flash <= 0 ) then jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))\n');
    document.write('if ( jest_flash <= 0 ) then jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))\n');
    document.write('if ( jest_flash <= 0 ) then jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
    document.write('if ( jest_flash <= 0 ) then jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');
    document.write('if ( jest_flash <= 0 ) then jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
	document.write('if ( jest_flash <= 0 ) then jest_flash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
    
    document.write('jest_flash_6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))\n');
    document.write('if ( jest_flash_6 <= 0 ) then jest_flash_6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');
    document.write('if ( jest_flash_6 <= 0 ) then jest_flash_6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
    document.write('if ( jest_flash_6 <= 0 ) then jest_flash_6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');

    document.write('jest_flash_7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7")))\n');
    document.write('if ( jest_flash_7 <= 0 ) then jest_flash_7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
    document.write('if ( jest_flash_7 <= 0 ) then jest_flash_7 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
    
    document.write('jest_flash_8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8")))\n');
    document.write('if ( jest_flash_8 <= 0 ) then jest_flash_8 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9")))\n');
    
    document.write('</SCRIPT\> \n');
}


function hideTopLayer() {
	if(document.getElementById) // gecko(NN6) + IE5+ 
	{ 
		document.getElementById("topLayerSlot").style.display = 'none';
	}
	else if(document.all) //IE 4 
	{ 
		document.all["topLayerSlot"].style.display = 'none'; 
	} 
	else if(document.layers)  // NN4 
	{ 
		document.layers["topLayerSlot"].display = 'none';
	}
}

function hidePlayerLayer() {

	if(document.getElementById) // gecko(NN6) + IE5+ 
	{ 
		document.getElementById("playerLayer").style.marginTop = '-2000px';
	}
	else if(document.all) //IE 4 
	{ 
		document.all["playerLayer"].style.marginTop = '-2000px';
	} 
	else if(document.layers)  // NN4 
	{ 
		document.layers["playerLayer"].marginTop = '-2000px';
	}
}


function showPlayerLayer(binaryLink) {

	var sendText = binaryLink;

	if(document.getElementById) // gecko(NN6) + IE5+ 
	{ 
		document.getElementById("playerLayer").style.marginTop = '0px';
	}
	else if(document.all) //IE 4 
	{ 
		document.all["playerLayer"].style.marginTop = '0px';
	} 
	else if(document.layers)  // NN4 
	{ 
		document.layers["playerLayer"].marginTop = '0px';
	}
	
	window.document.myFlashPlayer.SetVariable("myVar", sendText);
	window.document.myFlashPlayer.Play();	
}


function showDisclaimerLayer(binaryLink, sourceContentDivId, newWindow) {
	var hrefValue = binaryLink;
	var layerHeight = (document.getElementById('table_main').offsetHeight+44) + 'px';
	
	changeDivContent( sourceContentDivId, 'disclaimerContent' );
	
	document.getElementById('shadowLayer').style.height=layerHeight;
	document.getElementById('shadowLayer').style.visibility='visible';
	document.getElementById('disclaimerLayer').style.visibility='visible';
	document.getElementById('disclaimerLayer').style.visibility='visible';
	
	if(newWindow == true){
		document.getElementById('disclaimerAgreeLink').href='#';
		document.getElementById('disclaimerAgreeLink').onclick=function(){window.open(hrefValue); hideDisclaimerLayer();};
	} else {
		document.getElementById('disclaimerAgreeLink').href=hrefValue;
		document.getElementById('disclaimerAgreeLink').onclick=function(){hideDisclaimerLayer();};
	}
}

function hideDisclaimerLayer(){
    document.getElementById('disclaimerLayer').style.visibility="hidden";
    document.getElementById('shadowLayer').style.visibility="hidden";
}

function changeDivContent( sourceId, targetId )
{
    var divTarget = document.getElementById( targetId );
    var divSource = document.getElementById( sourceId );
    if( divTarget && divSource )    {   
        divTarget.innerHTML = divSource.innerHTML;
    }
}

function getBrowserWindowSize() {
	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;
  }
  return myHeight;
}

function movePlayerLayer(id, bannerHeight)
{
	var initialYPos = -bannerHeight;
	var stopYPos = 0;

	var el=doc.getElementById?doc.getElementById(id):doc.all?doc.all[id]:doc.layers[id];
	window[id + "_object"] = el;
	if(doc.layers) el.style=el;
	el.currentYPos = el.stopYPos = initialYPos;
	el.stylePosPx=function(y){this.style.top=y+px;};
	el.move=function()
	{
	
		var posY;

		posY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;

		posY += stopYPos-initialYPos;
		
		this.currentYPos += (posY + this.stopYPos - this.currentYPos)/1;
		this.stylePosPx(this.currentYPos);
		setTimeout(this.id + "_object.move()", 1);
	}
	return el;
}


var ns = (navigator.appName.indexOf("Netscape") != -1);
var doc = document;
var px = document.layers ? "" : "px";
function moveTopLayer(id, bannerHeight)
{
	var initialYPos = -bannerHeight;
	var closeButtonHeight = 25;
	var stopYPos = getBrowserWindowSize()/2 - bannerHeight/2 - closeButtonHeight;

	var el=doc.getElementById?doc.getElementById(id):doc.all?doc.all[id]:doc.layers[id];
	window[id + "_object"] = el;
	if(doc.layers) el.style=el;
	el.currentYPos = el.stopYPos = initialYPos;
	el.stylePosPx=function(y){this.style.top=y+px;};
	el.move=function()
	{
	
		var posY;

		posY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;

		posY += stopYPos-initialYPos;
		
		this.currentYPos += (posY + this.stopYPos - this.currentYPos)/8;
		this.stylePosPx(this.currentYPos);
		setTimeout(this.id + "_object.move()", 30);
	}
	return el;
}
//funkcje do obejscia obramowania dla activ contentu w IE
function objectStartLine() {
	document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"');
}
function objectEndLine() {
	document.writeln('>');
}
function embedEndLine() {
	document.writeln(' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
}
function embedPlayer() {
	document.writeln('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width=100% height=100% id="myFlashPlayer"> <param name="wmode" value="transparent" /> <param name="allowScriptAccess" value="sameDomain" /> <param name=movie value="/images/flash/root_player.swf"> <param name=quality value=high> <param name="FlashVars" value="xmlUrl=/player.xml" /> <embed src="/images/flash/root_player.swf" quality=high width=100% height=100% type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="myFlashPlayer" allowScriptAccess="sameDomain" swLiveConnect="true" FlashVars="xmlUrl=/player.xml" wmode="transparent"> </embed> </object>');
}