 /*
  imgsForum = new Array();
  imgsForum[1] = new Image();
  imgsForum[1].src = "PR/Images/forum_inact.gif";
  imgsForum[2] = new Image();
  imgsForum[2].src = "PR/Images/forum_act.gif";

  imgsPartners = new Array();
  imgsPartners[1] = new Image();
  imgsPartners[1].src = "PR/Images/partner_inact.gif";
  imgsPartners[2] = new Image();
  imgsPartners[2].src = "PR/Images/partner_act.gif";

  imgsKontakt = new Array();
  imgsKontakt[1] = new Image();
  imgsKontakt[1].src = "PR/Images/kontakt_inact.gif";
  imgsKontakt[2] = new Image();
  imgsKontakt[2].src = "PR/Images/kontakt_act.gif";
 */

//-------------------- Slownik -------------------------------------------------------------
function openwin(name,win_width,win_height)
{
  var LeftPosition=(screen.availWidth)?(screen.availWidth-win_width)/2:50;
  var TopPosition=(screen.availHeight)?(screen.availHeight-win_height)/2:50;
  var params="height="+win_height+",innerheight="+win_height+",top="+TopPosition+",left="+LeftPosition+",width="+win_width+",innerwidth="+win_width+",resizable=yes,menubar=no,scrollbars=yes,toolbar=no,location=no,statusbar=no,alwaysRaised=yes,dependent=no";
  window.open(name,"movie",params);
}


//-------------------- Logowanie -------------------------------------------------------------
function ShowLogin(isVisible){
   var divName="divLogo";
   var idDiv=document.getElementById(divName).style;

   idDiv.left=findPosX(document.getElementById("tblCenter"))+215;

   if(isVisible!=null){
      if(isVisible) idDiv.visibility=fShow;
      else  idDiv.visibility=fHide;
   }else{
      if(idDiv.visibility == fHide) idDiv.visibility=fShow;
      else  idDiv.visibility=fHide;
   }
   location.href="#ref_top"; 

}


function GoLogin(){
      var frmName="frmLogo"; 
      var frm=document.getElementById(frmName);
      if(document.getElementById('login').value!="" ){
           if(document.getElementById('haslo').value==""){
              location.href='/logowanie_frm2';
           }else frm.submit();
       }
}


//-------- pozegnanie ----------------------------------------------------------------

function popup(Site)
{
       if(getCursorPos() < 0) {
           window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no, scrollbars=no, resizable=no, width=300, height=250');
       }
}



  function getCursorPos(e) {
    var b, x, y

    if (!e) e = window.event;
  
    b = document.body;
    x = e.clientX + b.scrollLeft;
    y = e.clientY + b.scrollTop;
    return x;
  }

//-------- pop-up info o subskrybcji codziennej  ----------------------------------------------------------------
function popup1(Site)
{
//  alert(getCookie('isPopupDisplayed'));
        //window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no, scrollbars=no, resizable=no, width=430, height=230');
        timeA = new Date(2005,9,26,18,0,0);
        // Statements here to take some action.
        timeB = new Date();

        timeDifference = timeA - timeB; 
        //alert (timeDifference);

        if (timeDifference > 0)
          window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no, scrollbars=no, resizable=no, width=300, height=300');

}

//--------  ----------------------------------------------------------------
function popup2(Site)
{

//  alert(getCookie('isPopupDisplayed'));
  //if(getCookie('isPopupDisplayed'))                                                      
    window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no, scrollbars=no, resizable=no, width=336, height=280, left=300, top=300');
}

function popup3(Site)
{
        window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no, scrollbars=no, resizable=no, width=530, height=200');

}

nn4=(document.layers) ? true : false;
ie4=(document.all) ? true : false;

Nowe=null; 
function Otworz(w,s,src, title) {
if (Nowe) { 
 if (ie4) Nowe.close();
 else if (nn4) Nowe.closed;
 Nowe=null 
 }; 
Nowe=window.open("", "","toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=no,status=no,directories=no,resizable=no,height="+w+",width="+s);
Nowe.document.write("<HTML><HEAD><title>"+title+"</title><STYLE>BODY{BACKGROUND-REPEAT:no-repeat}</STYLE></HEAD><BODY BACKGROUND="+src+"></BODY></HTML>")
Nowe.focus() 

}


function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");

      alert(curCookie);
      document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

