var linkarray=new Array();
var flashinstalled = 0;//nie wiadomo czy zainstalowany
var flashversion = 0;//na razie zero, po zakonczeniu powinna przechowywac numer wersji plugina

if (navigator.plugins && navigator.plugins.length){
	x = navigator.plugins["Shockwave Flash"];
	if (x){
		flashinstalled = 2;//zainstalowany
		if (x.description)
		{
			y = x.description;
                        flashversion = parseInt (y.replace (/^.*\s+(\d+)\.?\d*\s+\S+$/, "$1"), 10);
		}
	}
	else{
		flashinstalled = 1;//niezainstalowany
	}
	if (navigator.plugins["Shockwave Flash 2.0"]){
		flashinstalled = 2;//zainstalowany
		flashversion = 2;//plugin 2.0
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length){
	x = navigator.mimeTypes['application/x-shockwave-flash'];
	if (x && x.enabledPlugin)
		flashinstalled = 2;//zainstalowany
	else
		flashinstalled = 1;//niezainstalowany
}else{

document.write('<SCRIPT LANGUAGE="VBScript">\n');
document.write('on error resume next\n');
document.write('\n');
document.write('If 1 = 1 Then\n');
document.write('	For i = 2 to 10\n');
document.write('		If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then\n');
document.write('\n');
document.write('		Else\n');
document.write('			flashinstalled = 2\n');
document.write('			flashversion = i\n');
document.write('		End If\n');
document.write('	Next\n');
document.write('End If\n');
document.write('\n');
document.write('If flashinstalled = 0 Then\n');
document.write('	flashinstalled = 1\n');
document.write('End If\n');
document.write('\n');
document.write('<\/script>');

}

function cc(){
  self.status="";
}

function imgComplete(){
    for(var numer=0; numer<9; numer++){
	if(document.getElementById('start_img_'+numer)){
	    if(!(document.getElementById('start_img_'+numer).complete)){
		document.getElementById('start_img_'+numer).src = document.getElementById('start_img_'+numer).src;
    	    }
	}else{}
    
    }
}
     

function getGifMsg(numer,gif,w,h ,linek,pw,ph){
    m = '';
	if(!(linek=='')){
		m+='<a href="'+linek+'">';
	}
	m+='<img src="'+gif+'" border="0" width="'+w+'" height="'+h+'" alt="" id="start_img_'+numer+'">';
	if(!(linek==''))m+='</a>';
    return m;
}//~

function window_clone(linek){
	window.open(linek);
}

function setFr(numer,hasGif,opr,flash,gif,instalowac,wersja,w,h,linek,flashvars,popup_width,popup_height){

 flashname='start_movie_'+numer;
 linkarray[numer]=linek;
 
 if(gif==''){    hasGif=0;    }

 if(isNaN(parseInt(popup_width))  || parseInt(popup_width)<0 || !popup_width) 		popup_width=0;
 if(isNaN(parseInt(popup_height)) || parseInt(popup_height)<0 || !popup_height) 	popup_height=0; 
 var msg='';


 if(!(linek=='')){

	if(window.link_w_nowym_oknie==1){
		
		linek='javascript:window_clone(\''+linek+'\')';
		
	} else if(popup_width==0){
    } else {
		linek='javascript:openNewWindow(\''+linek+'\',\'startwin_'+(new Date()).getTime()+'\',\'width='+popup_width+', height='+popup_height+'\')';
    }
 }
 



	if(flashinstalled==2 && !(flash == '')){
		if(wersja <= flashversion){
				msg+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+wersja+',0,0,0" width="'+w+'" height="'+h+'" id="'+flashname+'">\
				<param name="movie" value="'+flash+'?link='+linek+'">\
				<param name="quality" value="high">\
				<param name="flashvars" value="'+flashvars+'">\
				<param name="wmode" value="transparent">\
				<embed src="'+flash+'?link='+linek+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'" flashvars="'+flashvars+'" name="'+flashname+'"></embed>\
			    </object>';
		}else if((wersja > flashversion && instalowac==0) && hasGif==1){
		    
		    msg+=getGifMsg(numer,gif,w,h,linek,popup_width,popup_height);
		    
		}else if(wersja > flashversion && instalowac==1){
			window.open('http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','mm','left=20,top=20,width=450,height=350,scrollbars=1');

		}
	}else{
		if(instalowac==0 && hasGif==1){
		
		    msg+=getGifMsg(numer,gif,w,h,linek,popup_width,popup_height);
		    
		}else if(instalowac==1){
			window.open('http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','mm','left=20,top=20,width=450,height=350,scrollbars=1');
		}
	}

	if(document.getElementById('start_baner_'+numer)){
		document.getElementById('start_baner_'+numer).innerHTML=msg;
		timeout1 = setTimeout('imgComplete()',5000);
	}
}




function loadScripts(rid, rid_dol, path){
   if(document.getElementById('scr_0')){   	document.getElementById('scr_0').src=startad+'/kreacje.js?rid='+rid+'&nr=0&size=24'+path;}
   if(document.getElementById('scr_1')){   	document.getElementById('scr_1').src=startad+'/kreacje.js?rid='+rid+'&nr=1&size=2'+path;}
   if(document.getElementById('scr_2')){   	document.getElementById('scr_2').src=startad+'/kreacje.js?rid='+rid+'&nr=2&size=1'+path;}
   if(document.getElementById('scr_3')){    document.getElementById('scr_3').src=startad+'/kreacje.js?rid='+rid+'&nr=3&size=18'+path;}
   if(document.getElementById('scr_4')){    document.getElementById('scr_4').src=startad+'/kreacje.js?rid='+rid+'&nr=4&size=22'+path;}
//--
   if(document.getElementById('scr_5')){   	document.getElementById('scr_5').src=startad+'/kreacje.js?rid='+rid_dol+'&nr=5&size=3';} 
   if(document.getElementById('scr_6')){   	document.getElementById('scr_6').src=startad+'/kreacje.js?rid='+rid_dol+'&nr=6&size=3';} 
   if(document.getElementById('scr_7')){   	document.getElementById('scr_7').src=startad+'/kreacje.js?rid='+rid_dol+'&nr=7&size=3';}
   if(document.getElementById('scr_8')){   	document.getElementById('scr_8').src=startad+'/kreacje.js?rid='+rid_dol+'&nr=8&size=3';}
//--

   if(document.getElementById('gemius')){	document.getElementById('gemius').src='/js/gemius.js';}
}

function setColor() {
    return;
}

function setColor(s) {
    return;
}

