/* ----------------------------------------------------- */
/* funkcja liczaca czas w dol */
/* ----------------------------------------------------- */
function countdown(liczba)
{
  //obliczam minuty z liczby
  var min=Math.floor(liczba/60);
  var sekundy=liczba-(min*60);
  if(liczba>0)
    if(sekundy>=10)
	   document.getElementById('countdown').innerHTML=" "+min+":"+sekundy+" min";
	 else
  	 document.getElementById('countdown').innerHTML=" "+min+":0"+sekundy+" min";
  else
    document.getElementById('countdown').innerHTML="0 min";
	if(liczba>0)
		setTimeout("countdown("+(liczba-1)+")",1000);
	else
	  if(liczba==0)
		  alert("Sesja wygasła.\nProszę skopiować dane i zalogować się ponownie !!");
}
//------------------------------------------------------------------------------
function ustawwysokosc()
{
  if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    myHeight = window.innerHeight;
    myWidth=window.innerWidth;
  }
  else
    if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight;
      myWidth=document.documentElement.clientWidth; 
    }
    else
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        myWidth=document.body.clientWidth;
      }
  document.getElementById('srodek').style.height=(myHeight-14)+"px";
  document.getElementById('srodekwycentrowany').style.minHeight=(myHeight-255)+"px";
  document.getElementById('tablicacentrujaca').style.width=(myWidth-17)+"px";
  document.getElementById('tabelasrodkowa').style.width=(myWidth-17)+"px";
  //document.getElementById('banergorny').style.width=(myWidth-17)+"px";
  //dodajemy statystyki
  //document.writeln('<'+'scr'+'ipt type="text/javascript" src="http://home.hit.stat.pl/_'+(new Date()).getTime()+'/script.js?id=nFtKr0CKh5sB9jleCGoDE3a5HdvZX.rT.qjk_F6oVMj.Y7"></'+'scr'+'ipt>');
}
//------------------------------------------------------------------------------
function ladujnapis()
{
  var so = new SWFObject("./media/desktop/Napis.swf", "index", "460", "48", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("napis");
}
//------------------------------------------------------------------------------
function ladujstrzalke()
{
  var so = new SWFObject("./media/desktop/PrzyciskStrzalka.swf", "index", "30", "30", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("strzalka");
}
//------------------------------------------------------------------------------
function ladujstrzalkeszukaj()
{
  var so = new SWFObject("./media/desktop/PrzyciskStrzalka.swf", "index", "30", "30", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("strzalkaszukaj");
}
//------------------------------------------------------------------------------
function wyslijformeszukaj()
{
  document.getElementById('formaszukaj').submit();
} 
//------------------------------------------------------------------------------
function ladujprzycisk1(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/sgr.swf", "index", "120", "46", "1","");
  else
    var so = new SWFObject("./media/desktop/sg.swf", "index", "120", "46", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk1");
}
function ladujprzycisk2(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/pnr.swf", "index2", "122", "48", "2","");
  else
    var so = new SWFObject("./media/desktop/pn.swf", "index2", "120", "46", "2","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk2");
}
function ladujprzycisk3(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/sir.swf", "index", "120", "46", "1","");
  else
    var so = new SWFObject("./media/desktop/si.swf", "index", "120", "46", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk3");
}
function ladujprzycisk4(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/lgr.swf", "index", "120", "46", "1","");
  else
    var so = new SWFObject("./media/desktop/lg.swf", "index", "120", "46", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk4");
}
function ladujprzycisk5(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/ssr.swf", "index", "120", "46", "1","");
  else
    var so = new SWFObject("./media/desktop/ss.swf", "index", "120", "46", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk5");
}
function ladujprzycisk6(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/lar.swf", "index", "120", "46", "1","");
  else
    var so = new SWFObject("./media/desktop/la.swf", "index", "120", "46", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk6");
}
function ladujprzycisk7(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/inr.swf", "index", "120", "46", "1","");
  else
    var so = new SWFObject("./media/desktop/in.swf", "index", "120", "46", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("przycisk7");
}
function ladujprzyciskmalyc(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/klasacr.swf", "index", "42", "42", "1","");
  else
    var so = new SWFObject("./media/desktop/klasac.swf", "index", "42", "42", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("pz1");
}
function ladujprzyciskmalyb(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/klasabr.swf", "index", "42", "42", "1","");
  else
    var so = new SWFObject("./media/desktop/klasab.swf", "index", "42", "42", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("pz2");
}
function ladujprzyciskmalya(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/klasaar.swf", "index", "42", "42", "1","");
  else
    var so = new SWFObject("./media/desktop/klasaa.swf", "index", "42", "42", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("pz3");
}
function ladujprzyciskmalyiv(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/ligaivr.swf", "index", "42", "42", "1","");
  else
    var so = new SWFObject("./media/desktop/ligaiv.swf", "index", "42", "42", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("pz4");
}
function ladujprzyciskmalyiii(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/ligaiiir.swf", "index", "42", "42", "1","");
  else
    var so = new SWFObject("./media/desktop/ligaiii.swf", "index", "42", "42", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("pz6");
}
function ladujprzyciskmalyv(red)
{
  if(red==true)
    var so = new SWFObject("./media/desktop/ligavr.swf", "index", "42", "42", "1","");
  else
    var so = new SWFObject("./media/desktop/ligav.swf", "index", "42", "42", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("pz5");
}
//------------------------------------------------------------------------------
function ladujbanerflash(idbaneru,plik,szer,wyso)
{
  var so = new SWFObject(plik, "index",szer,wyso,"1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  var warstwa='baner'+idbaneru;
  so.write(warstwa);
}
function ladujstrzalkigaleri()
{
  var so = new SWFObject("./media/desktop/strzalkigaleria.swf", "index", "220", "50", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("strzalkigaleri");
}
function ladujstrzalkigaleril()
{
  var so = new SWFObject("./media/desktop/strzalkagalerialeft.swf", "index", "40", "50", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("strzalkigaleril");
}
function ladujstrzalkigalerir()
{
  var so = new SWFObject("./media/desktop/strzalkagaleriaright.swf", "index", "40", "50", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("strzalkigalerir");
}
function otworzstrone(link)
{
  window.open(link,"chaild");
  void(null);
}
function displayWindow(url, width, height)
{
  var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=1,scrollbars=0,menubar=0' );
}

function showpopuplayer(typ,zm)
{
	//document.getElementById('popupsrodek').innerHTML="costam"+zm;
	var so = new SWFObject("./media/desktop/galeria03.swf", "index", "800", "640", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.addParam("FlashVars","picturetab="+zm);
  so.write("popupsrodek");
  pozycjuj();
	document.getElementById('popup').style.display='block';
	document.getElementById('popupsrodek').style.display='block';
}
//------------------------------------------------------------
function clospopuplayer()
{
	document.getElementById('popup').style.display='none';
	document.getElementById('popupsrodek').style.display='none';
}
//------------------------------------------------------------
function pozycjuj()
{
	if( typeof( window.innerWidth ) == 'number' )
  {
    //Non-IE
    myHeight = window.innerHeight;
    myWidth=window.innerWidth;
  }
  else
    if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
    {
      //IE 6+ in 'standards compliant mode'
      myHeight = document.documentElement.clientHeight;
      myWidth=document.documentElement.clientWidth; 
    }
    else
      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
      {
        //IE 4 compatible
        myHeight = document.body.clientHeight;
        myWidth=document.body.clientWidth;
      }
   document.getElementById('popup').style.width=myWidth+"px";
   document.getElementById('popup').style.height=myHeight+"px";
	   
   if(myHeight>700)
   	document.getElementById('popupsrodek').style.height="700px";
   else
   	document.getElementById('popupsrodek').style.height=myHeight+"px";
   
   //document.getElementById('popupsrodek').style.overflow="scroll";
  
   if(myWidth>820)
   	document.getElementById('popupsrodek').style.width="820px";
   else
   	document.getElementById('popupsrodek').style.width=myWidth+"px";
   	
   if(((myWidth-800)/2)>0)
   	document.getElementById('popupsrodek').style.left=((myWidth-800)/2)+"px";
	 else
		document.getElementById('popupsrodek').style.left="2px";
		
   if(((myHeight-700)/2)>0)
   		document.getElementById('popupsrodek').style.top=((myHeight-700)/2)+"px";
   else
   		document.getElementById('popupsrodek').style.top="2px";

}
function ladujprzyciskigrup(kategoria)
{
  var so = new SWFObject("./media/desktop/PrzyciskiGrup.swf", "index", "250", "40", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
	so.addParam("FlashVars","nrprzycisku="+kategoria);
  so.write("przyciskigrupy");
}
function ladujprzyciskikategori(kategoria)
{
  var so = new SWFObject("./media/desktop/PrzyciskiKategori.swf", "index", "835", "47", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
	so.addParam("FlashVars","nrprzycisku="+kategoria);
  so.write("przyciskikategori");
}
function ladujprzyciskrss()
{
  var so = new SWFObject("./media/desktop/rss.swf", "rssicon", "40", "40", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("rss");
}
//------------------------------------------------------------------------------
function ladujwybory2010()
{
  var so = new SWFObject("./media/reklama/wybory2010.swf", "index", "880", "85", "1","");
  so.addParam("quality", "high");
  so.addParam("wmode", "transparent");
  so.write("wybory2010");
}
