var hinttext = new String();
var docpath = document.URL;//.substr(1,document.URL.length-10);
urlarray = docpath.split("/");
urlarraycount = urlarray.length;
urlpath = "";
for(indexarr=0;indexarr<(urlarraycount-1);indexarr++){urlpath += urlarray[indexarr] + "/";}
var onloadcomplete = false;

var explorer = ((document.all) && ((navigator.userAgent.search('Opera')>=0)?false:true))? true:false
// zmienna informuje czy przeglądarką jest internet eksplorer

if (document.all){pie=((navigator.userAgent.search('Opera')>=0)?false:true) && ((navigator.userAgent.search('Linux')>=0)?false:true)}
else {pie = true;}
// zmienna "pie" informuje czy przeglądarka i system oferuje animacyjny z możliwością zastosowania przeźroczystości

var NoAnim = !pie;
// zmienna z informacją parawda jeśli nie da się uruchomić animacji

var stos = new Array();

var resVideo = new Array();
resVideo[0] = new Array(320,240);
resVideo[1] = new Array(352,288);
resVideo[2] = new Array(373,288);
resVideo[3] = new Array(498,288);

imgPath="taniec/images/";

function getSite(site) {
   document.forms['SiteForms'].elements['menuStr'].value = site;
   document.forms['SiteForms'].submit();}
   
function onmenu(obj) {
   if (onloadcomplete == true ) {
      if (explorer) {document.images["_"+obj].filters.blendTrans.Apply();}
      document.images["_"+obj].src = imgPath+"button00.gif";
      if (explorer) {document.images["_"+obj].filters.blendTrans.Play();}
      if (!(typeof(vlay.hint) == 'undefined')) { hinttext = vlay.hint.innerHTML;}
      if (!(typeof(vlay['hint_'+obj]) == 'undefined')) {
         vlay.hint.vHTML(vlay['hint_'+obj].innerHTML);
         STPE.stop('reklama');
         vlay.podpowiedz.style.visibility = 'hidden';
         vlay.hint.style.visibility = 'visible';}}
   else {setTimeout("onmenu('"+obj+"')",100);}}

function outmenu(obj) {
   if (onloadcomplete == true ) {
      if (explorer) {document.images["_"+obj].filters.blendTrans.Apply();}
      document.images["_"+obj].src = imgPath+"button01.gif";
      if (explorer) {document.images["_"+obj].filters.blendTrans.Play();}
      vlay.hint.style.visibility = 'hidden';
      vlay.hint.vHTML(hinttext);
      STPE.go('reklama',40);
      vlay.podpowiedz.style.visibility = 'visible';}
   else {setTimeout("outmenu('"+obj+"')",100);}}

function animacja(wysokosc) {
   //zabezpieczenie
   if (typeof(vlay.block) != "undefined"){
      if (explorer) {
         vlay.block.style.width=document.body.scrollWidth;
         vlay.block.style.height=document.body.scrollHeight;
         vlay.block.vHTML("<img src=\"taniec/images/transparent.gif\" width=\""+document.body.scrollWidth+"\" height=\""+document.body.scrollHeight+"\" border=\"0\">");}
      else {
         vlay.block.style.width=document.body.offsetWidth;
         vlay.block.style.height=document.body.offsetHeight;
         vlay.block.vHTML("<img src=\"taniec/images/transparent.gif\" width=\""+document.body.offsetWidth+"\" height=\""+document.body.offsetHeight+"\" border=\"0\">");}
      if (navigator.userAgent.search('Opera')>=0) {
         vlay.block.style.width=document.body.scrollWidth;
         vlay.block.style.height=document.body.scrollHeight;
         vlay.block.vHTML("<img src=\"taniec/images/transparent.gif\" width=\""+document.body.scrollWidth+"\" height=\""+document.body.scrollHeight+"\" border=\"0\">");}
   }
   //właściwa animacja
   krokow = Math.round(wysokosc / 3);
   sttop=174; stct=-41; stcr=746; stcb=0; stcl=0;
   vlay.podpowiedz.vkf({top:sttop,ct:stct,cr:stcr,cb:stcb,cl:stcl},1);
   for(ind=0;ind<krokow;ind++){

      sttop -= 43;stct += 43; stcb += 43;      
      vlay.podpowiedz.vkf({top:sttop,ct:stct,cr:stcr,cb:stcb,cl:stcl},60);
      vlay.podpowiedz.vkf({},120);}
   sttop -= 43;stct += 41; stcb += 41;
   vlay.podpowiedz.vkf({top:sttop,ct:stct,cr:stcr,cb:stcb,cl:stcl},60);
   vlay.podpowiedz.van.mode="loop";
   vlay.podpowiedz.van.group="reklama";
   vlay.podpowiedz.style.visibility = 'visible';
   vlay.podpowiedz.van.go=true;}

function rettoframe() {
if (window.parent.location==window.location) {
   document.writeln('Czekaj na załadowanie ramek. Jeśli się nie pojawią, <a href="../index.php">kliknij tutaj</a>');
   document.close;
   window.location='../index.php';}}

function checkClick(obj) {
   if (document.images[obj].src.substr(document.images[obj].src.length-9,document.images[obj].src.length-1) == "check.gif") {
      document.images[obj].src = imgPath+"transparent.gif";
      document.forms['temp'].elements['KursyInfo'].value = "false";}
   else {
      document.images[obj].src = imgPath+"check.gif";
      document.forms['temp'].elements['KursyInfo'].value = "true";}}

function anulujTempForm() {
   document.forms['SiteForms'].reset();}
   
function submitTempForm(site) {
   document.forms['SiteForms'].elements['menuStr'].value = site;
   document.forms['SiteForms'].submit();}
   
function poczta(id) {
   //if ((urlarray[2].substr(0,3).toLowerCase()) == "www") {sufixmail=urlarray[2].substr(11,urlarray[2].length-11)}
   //else {sufixmail=urlarray[2].substr(7,urlarray[2].length-7)};
   sufixmail = 'taniec.konin.pl';
   switch (id) {
      case '0': prefixmail = 'biuro'; break;
      case '1': prefixmail = 'taniec'; break;
      default: prefixmail = 'biuro';
   }
   parent.location='mailto:'+prefixmail+'@'+sufixmail;
}

function otoczenie(instr,imgpath,fwidth,fheight){
   retstr ='<table valign="middle" width="'+(fwidth+6)+'" height="'+(fheight+6)+'" border="0" cellpadding="0" cellspacing="0">';
   retstr +='<tr><td width="3" height="3"><img src="'+imgpath+'cien00.gif" border="0"></td><td background="'+imgpath+'cien01.gif"></td><td width="3"><img src="'+imgpath+'cien02.gif" width="3" height="3" border="0"></td></tr>';
   retstr +='<tr><td width="3" background="'+imgpath+'cien10.gif"></td><td align="center" valign="top" width="'+(fwidth)+'" height="'+(fheight)+'">';
   retstr +=instr;
   retstr +='</td><td background="'+imgpath+'cien12.gif"></td></tr>';
   retstr +='<tr><td height="3"><img src="'+imgpath+'cien20.gif" width="3" height="3" border="0"></td><td background="'+imgpath+'cien21.gif"></td><td><img src="'+imgpath+'cien22.gif" width="3" height="3" border="0"></td></tr></table>';
   return retstr;}

function docComplete(){
   onloadcomplete = true;
   extrafunction();}


function IntToZeroStr(imputInt, lenOfStr) {
   OutText = imputInt.toString();
   if (OutText.length<lenOfStr) {
      ogranicznik = (lenOfStr-OutText.length);   
      for(i=1; i<=ogranicznik; i++) {
         OutText = "0" + OutText;
      } 
   }
   return(OutText);
}

function getvideo(id,plik,resolution){
   if (getvideo.arguments.length<3) {resolution = 1}
   size = 'width="'+resVideo[resolution][0]+'" height="'+(resVideo[resolution][1]+69)+'"';
   if (onloadcomplete == true ) {
   stos.push(vlay[id].innerHTML);
   //if ((transfer == '1')) {size='width="352" height="357"';}
   //else {size='width="320" height="309"';}
   vlay[id].vHTML('<table align="center"><tr><td><object '+size+' classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1"><param name="Filename" value="http://taniec.konin.pl/'+plik+'.wmv"><param name="AutoStart" value="true"><param name="EnableContextMenu" value="false"><param name="ShowCaptioning" value="false"><param name="ShowControls" value="true"><param name="ShowAudioControls" value="true"><param name="ShowGotoBar" value="false"><param name="ShowPositionControls" value="false"><param name="ShowStatusBar" value="true"><param name="ShowDisplay" value="false"><param name="ShowTracker" value="true"><param name="AutoRewind" value="false"><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" '+size+' src="http://taniec.konin.pl/'+plik+'.wmv" autostart="true" enablecontextmenu="false" showcaptioning="false" showcontrols="true" showaudiocontrols="true" showgotobar="false" showpositioncontrols="false" showstatusbar="false" showdisplay="false" showtracker="true" autorewind="false"></embed></object></td></tr><tr><td align="center"><div class="menu" onclick="returnToPrev(\''+id+'\')"><img class="menuimg" src="taniec/images/smollbtnshort.gif" width="77" height="26" border="0" /><div class="buttonopis">wróć</div></div></td></tr></table>');
   }
   else {setTimeout("getvideo('"+id+"','"+plik+"','"+resolution+"')",100);}}
   
function getVideoConstRes(id,plik){
   if (onloadcomplete == true ) {
   stos.push(vlay[id].innerHTML);
   size='width="352" height="357"';
   vlay[id].vHTML('<table cellspacing="0" cellpadding="0" border="0" align="center"><tr><td><object '+size+' classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaplayer1"><param name="Filename" value="http://taniec.konin.pl/'+plik+'.wmv"><param name="AutoStart" value="true"><param name="EnableContextMenu" value="false"><param name="ShowCaptioning" value="false"><param name="ShowControls" value="true"><param name="ShowAudioControls" value="true"><param name="ShowGotoBar" value="false"><param name="ShowPositionControls" value="false"><param name="ShowStatusBar" value="true"><param name="ShowDisplay" value="false"><param name="ShowTracker" value="true"><param name="AutoRewind" value="false"><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" '+size+' src="http://taniec.konin.pl/'+plik+'.wmv" autostart="true" enablecontextmenu="false" showcaptioning="false" showcontrols="true" showaudiocontrols="true" showgotobar="false" showpositioncontrols="false" showstatusbar="false" showdisplay="false" showtracker="true" autorewind="false"></embed></object></td></tr><tr><td class="mini">&nbsp;</td></tr><tr><td align="center"><div class="menu" onclick="returnToPrev(\''+id+'\')"><img class="menuimg" src="taniec/images/smollbtnshort.gif" width="77" height="26" border="0" /><div class="buttonopis">wróć</div></div></td></tr></table>');
   }
   else {setTimeout("getVideoConstRes('"+id+"','"+plik+"')",100);}}

function returnToPrev(id){
   if (stos.length == 0) {vlay[id].vHTML("Błąd skryptu! Proszę odświeżyć stronę!");}
   else {vlay[id].vHTML(stos.pop());}}
   
function getphoto(id,plik,w,h){
   if (onloadcomplete == true ) {
   vlay[id].vHTML('<table cellspacing="0" cellpadding="0" border="0" align="center"><tr><td><img src="'+plik+'.jpg" width="'+w+'" height="'+h+'" border="0" style="border: 3px solid #FFFFFF"></td></tr></table>');
   }
   else {setTimeout("getphoto('"+id+"','"+plik+"','"+w+"','"+h+"')",100);}}

function banerclick(reklamaNo){ document.forms['r'].elements['r'].value = reklamaNo; document.forms['r'].submit();}

function printdebug(str){
   vlay["debuginfo"].vHTML(str);
}

function extrafunction(){
   if (typeof(vlay.ostrokrzew) != "undefined") {
      
      if (explorer) {
         docwidth=document.body.scrollWidth;}
      else {
         //if (navigator.userAgent.search('Opera')>=0) {
         docwidth=document.body.clientWidth;}
         //else {docwidth=document.width;}}
      //vlay.ostrokrzew.vpos((Math.floor((docwidth-990)/2)-90), 20);
      vlay.ostrokrzew.style.left = Math.floor((docwidth-990)/2)-90;
      vlay.ostrokrzew.style.top = 20;
      vlay.ostrokrzew.style.visibility = 'visible';
      //printdebug("szerokość dokumentu : "+docwidth+"<br>od lewej : "+vlay.ostrokrzew.style.left+"px;<br>od góry : "+vlay.ostrokrzew.style.top+"px;");
   }
}
