<!--
var y1 = 20;   // change the # on the left to adjuct the Y co-ordinate
(document.getElementById) ? dom = true : dom = false;

function hideIt() {
  if (dom) {document.getElementById("layer1dupa").style.visibility='hidden';document.getElementById("layer1dupa").style.display='none';}
}

function showIt() {
  if (dom) {document.getElementById("layer1dupa").style.visibility='visible';}
}

function placeIt() {
  if (dom && !document.all) {document.getElementById("layer1dupa").style.top = window.pageYOffset + (window.innerHeight + 200 - (window.innerHeight-y1)) + "px";}
  if (document.all) {document.all["layer1dupa"].style.top = document.documentElement.scrollTop + (document.documentElement.clientHeight +200 - (document.documentElement.clientHeight-y1)) + "px";}
  window.setTimeout("placeIt()", 100); }

            
function telewizja(){
 var width  = (screen.width)/2;
 var height = (screen.height)/2;
 if(width<550)width=550;
 if(height<480)height=480;
 var left   = (screen.width  - width)/2;
 var top    = (screen.height - height)/2;
 var params = 'width='+width+', height='+height;
 params += ', top='+top+', left='+left;
 params += ', directories=no';
 params += ', location=no';
 params += ', menubar=no';
 params += ', resizable=yes';
 params += ', scrollbars=no';
 params += ', status=no';
 params += ', toolbar=no';
 newwin=window.open("",'Panel Administracyjny', params);
newwin.document.write('<html><head><title>Telewizja klubowa www.djoles.pl</title><style type="text/css">body{margin:0;padding:0;background-color:black;text-align:center;}table{width:100%;height:100%;padding:0px;margin:auto;border:0;text-align:center;}</style></head><body><table><tr><td><object width="536" height="460" allowfullscreen="true" id="pinoplayer"><param name="movie" value="http://pinotv.pl/static/flash/tvplay.swf?channel=4397" /><param name="quality" value="best" /><param name="allowfullscreen" value="true" /><embed src="http://pinotv.pl/static/flash/tvplay.swf?channel=4397" name="pinoplayer" allowfullscreen="true" width="536" height="460" type="application/x-shockwave-flash"></embed></object></td></tr></table></body></html>'); 
 if (window.focus) {newwin.focus()}
 return false;
}

 function got() {
 var q;
 q = document.getElementById('abecadlo').value;
 if (q=='') q = document.getElementById('abecadloq').value;
 if (q=='') q = document.getElementById('abecadloqq').value;
 //if (q == '') alert('niczego nie szukasz!');
 //else
 location.href='/mp3/szukaj/q='+q;
 return false;
 }
 function god() {
window.open('http://www.god.com.pl/?id=01090');
 return false;
 }
 function rxp() {
wondow.open('http://turboxp.xbx.pl/?ref=593');
 return false;
 }
 
function pokaz_ukryj(id) {
            var domeczek = document.getElementById(id).style.display;
            if (domeczek == 'none') document.getElementById(id).style.display='block';
            else document.getElementById(id).style.display='none';
}
function zmcolor(co) {
            if (co == 'over') return 'this.style.background = \'#E80000\';';
            else return 'this.style.background = \'black\';';
}
function zmimage(co,idek) {
            if (co == 'over') { 
                                    document.getElementById(idek).style.color = 'black';
                                    return 'this.style.backgroundImage = \'url(/img/menu_top/hover_2_2.jpg)\';';
            }
            else { 
                                    document.getElementById(idek).style.color = '#FFD700';
                                    return 'this.style.backgroundImage = \'url(/img/menu_top/bg_4_1.jpg)\';'; 
            }
}

function CzyscForm(co,ddef) {
            if (co == ddef) return 'this.value=\'\'';
            else if (co == '') return "this.value='"+ddef+"'";
}
function SprForm(login, haslo) {
            if (login == 'Podaj login')  {alert('Podaj login');return false; }
            else if (haslo == 'password') {alert('Podaj hasło');return false; }
            else {
            document.logowanie.innerHTML = '<b style="font: 12pt Tahoma;font-weight: bold;">Trwa Logowanie...</b>';
            return true;
            }
}

function flash(id, kolor, czas, kolor2, czas2) { 
            document.getElementById(id).style.color = kolor;
             setTimeout('flash("' + id + '","' + kolor2 + '",' + czas2 + ',"' + kolor + '",' + czas + ')', czas); 
}

sfHover = function() {
        var sfEls = document.getElementById("nav").getElementsByTagName("LI");
        for (var i=0; i<sfEls.length; i++) {
                sfEls[i].onmouseover=function() {
        this.className+=" sfhover";
                }
                sfEls[i].onmouseout=function() {
                        this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
                }
        }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

var http_request;
var ReturnText;
var Gurl;
var Gel;
var Gpoststr;

    function makeRequest(url, poststr, el) {

var Gurl = url;
var Gel = el;
var Gpoststr = poststr;

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/html; charset=ISO-8859-2');
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Poddaję się :( Nie mogę stworzyć instancji obiektu XMLHTTP');
            return false;
        }
        
   http_request.onreadystatechange = function() { alertContents(http_request, Gel, Gurl, Gpoststr); };
        
        
        if ( poststr != '' ) {
                              http_request.open('POST', url, true);
                              http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                              http_request.setRequestHeader("Content-length", poststr.length);
                              http_request.setRequestHeader("Connection", "close");
                              http_request.send(poststr);
      }
      else {
                                http_request.open('GET', url, true);
                                http_request.send(null);
      }

    }
      
      function alertContents(http_request, el, url, poststr) {
      
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                document.getElementById(el).innerHTML = http_request.responseText;
            } 
            else if (http_request.status == 500) {
                        document.getElementById(el).innerHTML = '<i>Trwa łączenie z serwerem...</i>';
                        makeRequest(url, poststr, el);
            } else {
                document.getElementById(el).innerHTML ='Wystąpił problem z zapytaniem. Błąd: '+http_request.status;
            }
            
                                    
        }
        
        }
        
    var Cookies = {
create : function(name, value, ttl) {
if(ttl) {
var expire = new Date();
expire.setTime(expire.getTime() + ttl);
var expires = "; expires="+expire.toGMTString();
}
else expires = "";
document.cookie = name + "=" + value + expires + "; path=/";
},

read : function(name) {
var content = document.cookie.split('; ');
var pair = null;
for(keyVar in content) {
pair = content[keyVar].split('=');
if(pair[0] == name) {
return pair[1];
}
}
return false;
},

erase : function(name) {
this.create(name, "", -1);
}
};

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setMinutes(exdate.getMinutes()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString()) + ";path=/";
}

function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return true;
    }
  }
return false;
}

function getCookieValue(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
   return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return false;
}

            //***** shoutbox
            
            
function sb_textarea(akcja,valuef) {
            if (akcja == 'on') {
                        if (valuef == 'Nowa wiadomość')  {return 'this.value=\'\';this.style.color=\'Black\''; }
                        else {return 'this.style.color=\'Black\''; }
            } else {
                        if (valuef == 'Nowa wiadomość')  {return 'this.style.color=\'Gray\''; }
                        else if (valuef == '')  {return 'this.value=\'Nowa wiadomość\';this.style.color=\'Gray\''; }
                        else {return 'this.style.color=\'Black\''; }
            }
}

function scroolsb_reload(id_main, scroolid) {
            var cotxt = '';
            var objjjj = 'ajax=tak&script=shoutbox&';
            objjjj += "id_main=" + encodeURI( id_main );
                    
            makeRequest('/ajax.php', objjjj, scroolid);
}
function scroolsb_dodaj(obiekt, scroolid) {
            autor = obiekt.user.value;
            shut = obiekt.news.value;
            id_main = obiekt.id_menu.value;
            if (autor != '') {
                                     if (shut != '')  {
                                                 if (shut != 'Nowa wiadomość'){          
                                                                         var objjjj = 'ajax=tak&script=shoutbox&f=dodaj&';
                                                             objjjj += "autor=" + encodeURIComponent( autor ) + "&shut=" + encodeURIComponent( shut ) + "&id_main=" + encodeURIComponent( id_main );
                    
                                                                         makeRequest('/ajax.php', objjjj, scroolid);
                                                                        setTimeout('scroolsb_move(\''+scroolid+'\')', 1000);
                                                 }
                                                 else alert('błąd 03! Wpisz wiadomość');
                                                } else alert('błąd 03! Wpisz wiadomość');
            } else alert('błąd 01! Nie odczytano nicka');
}

function scroolsb_move(scroolid){
            document.getElementById(scroolid).scrollTop = document.getElementById(scroolid).scrollHeight;
}

function scroolsb_fresh(id_main, scroolid) {
            vprzed = document.getElementById(scroolid).innerHTML;
                                    scroolsb_reload(id_main, scroolid);
            vpo = document.getElementById(scroolid).innerHTML;
            
            
            if ( vprzed != vpo )
              document.getElementById(scroolid).scrollTop = document.getElementById(scroolid).scrollHeight;
              
                                    setTimeout('scroolsb_fresh('+id_main+', \''+scroolid+'\')', 12000);
}


function pozdro_dodaj(obiekt, scroolid) {
            autor = obiekt.user.value;
            shut = obiekt.news.value;
            id_main = obiekt.id_menu.value;
            if (autor != '') {
                                     if (shut != '')  {
                                                 if (shut != 'Nowa wiadomość'){          
                                                                         var objjjj = 'ajax=tak&script=pozdrowienia&f=dodaj&';
                                                             objjjj += "autor=" + encodeURIComponent( autor ) + "&shut=" + encodeURIComponent( shut ) + "&id_main=" + encodeURIComponent( id_main );
                    
                                                                         makeRequest('/ajax.php', objjjj, scroolid);
                                                 }
                                                 else alert('błąd 03! Wpisz wiadomość');
                                                } else alert('błąd 03! Wpisz wiadomość');
            } else alert('błąd 01! Nie odczytano nicka');
}




            
function menu_top_jezyczki_a(id, dzial) {
            c_name = 'menu_top_jezyczki_' + dzial;
            setCookie(c_name,5,2);
            menu_top_jezyczki(id, dzial);
}

function menu_top_jezyczki(id, dzial) {
            for ( i=1;i<=4;i++ ) {
                     name_id = 'menu_top_jezyczki_'+dzial+'_'+i;
                     name_main_id = 'menu_top_jezyczki_s_'+dzial+'_'+i;
                            if ( i == id ) {
                                        document.getElementById(name_id).style.backgroundImage = 'url(/img/buttons/but_3_2.png)';
                                        document.getElementById(name_main_id).style.display = 'block';
                            }
                            else{
                                        document.getElementById(name_id).style.backgroundImage = 'url(/img/buttons/but_2_2.png)';
                                        document.getElementById(name_main_id).style.display = 'none';
                            }
            } 
}

function menu_top_jezyczki_licznik(i) {
            if ( i < 4 ) return i+1;
            else return 1;
}

function menu_top_jezyczki_cron(dzial, i) {
            
                        c_name = 'menu_top_jezyczki_' + dzial;
            if ( ! getCookie(c_name) )  {
                                    ii = menu_top_jezyczki_licznik(i);                        // kolejna liczba jezyczka
                                    menu_top_jezyczki(ii, dzial);
                        
                                     setTimeout('menu_top_jezyczki_cron("'+dzial+'", '+ii+')', 10000); 
           }
}

var AkrualnyNrLogo;
if ( ! getCookie('LogoIDsrc') ) AkrualnyNrLogo = 2;
else AkrualnyNrLogo = getCookieValue('LogoIDsrc');

function DopasujNumer(nr, dzialanie, calosc) {
            if (dzialanie == 0) temp_nr = nr-1;
            else temp_nr = nr+1;
            
            if (temp_nr < 1) r = calosc;
            else if (temp_nr > calosc) r = 1;
            else r = temp_nr;
            
            return r;
}
function LogoImage(dzialanie) {
            var logo_img = new Array;
            logo_img = ['', '/img/1_2_3.jpg','/img/1_2_3_new_rok.jpg', '/img/logo-k.jpg', 'http://fotosik.djoles.pl/images/333_1_2_3_swieta2.jpg', 'http://fotosik.djoles.pl/images/201_ogoli2.jpg', 'http://fotosik.djoles.pl/images/692_1_2_3.jpg'];
            
            if (dzialanie != 2) {
                        NumerOfLog = DopasujNumer(AkrualnyNrLogo, dzialanie, (logo_img.length-1));
                                    setCookie('LogoIDsrc',NumerOfLog,20);
                        }
                        else NumerOfLog = AkrualnyNrLogo;
                        
            AkrualnyNrLogo = NumerOfLog;
            UrlOfLogo = logo_img[NumerOfLog];
            document.getElementById('logo').style.backgroundImage = 'url('+UrlOfLogo+')';
}


function szukaj_top_card( n ) {
            var q = document.getElementById('abecadloq').value;
            var objjjj = 'ajax=tak&script=wyszukiwarka&card='+n+'&q='+q;
                    
            makeRequest('/ajax.php', objjjj, 'szukaj_top_card');
}
//-->
