function question(komunikat,link)
  {
  if (confirm(komunikat))
    document.location.href=link;

  }
function addbookmark()
{ var tytul = 'prezentyonline.pl'; var adres = 'http://www.prezentyonline.pl';
//FireFox
if (window.sidebar) { window.sidebar.addPanel(tytul, adres, "");
//IE
} else if (window.external) { window.external.AddFavorite(adres, tytul);
//Opera
} else if (window.opera && window.print) { var a = document.createElement('a'); a.setAttribute('href', adres); a.setAttribute('title', tytul); a.setAttribute('rel','sidebar'); a.click(); } }


function wczytaj(url)
  {
  document.location.href=url;
  }
function zapal_tlo(object,obj1,obj2)
  {
  if (object.className == obj1) object.className =obj2;
  }
function zgas_tlo(object,obj2,obj1)
  {
  if (object.className == obj2) object.className = obj1;
  }



function wndSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ];
}
function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

function popup(id,pwidth,pheight)
  {
  //mint.fx.Fade("strona", 30, 1, 1);
  $("popup").style.display="block";
  $("popup").style.width=pwidth+"px";
  $("popup").style.height=pheight+"px";
  var scrl=getScrollXY();
  var wSize=wndSize();
  $("popup").style.left=Math.round(scrl[0]+(wSize[0]-pwidth)/2)+"px";
  $("popup").style.top=Math.round(scrl[1]+(wSize[1]-pheight)/2)+"px";
  //$("zawartosc").style.height=Math.round(pheight*0.83)+"px";
   
    var req = mint.Request();
    req.AddParam("id", id);
    
    req.Send("popup.php","popup");
  }
  
function close()
  {
   //mint.fx.Fade("strona", 100, 1, 1);
   //mint.fx.Fade("popup", 0, 10, 50);
   $("popup").style.display="none";
  }
  
  
function display_faq(id)
  {
  if ($("b"+id).style.display == "block")
    {
    $("b"+id).style.display="none";
    $("a"+id).style.border="none";
    }
  else
    {
    $("b"+id).style.display="block";
    $("a"+id).style.border="1px solid #c6c6c6";
    }
  }
  
  
function SendRequest(formularz,div,parametr1,parametr2) {
    var req = mint.Request();
    req.AddParam("param1", parametr1);
    req.AddParam("param2", parametr2);
    req.OnSuccess = function() {
        $(div).innerHTML = this.responseText;
    }
    req.SendForm(formularz);
}

function _Send(strona,div,parametr1,parametr2) {
    var req = mint.Request();
    req.AddParam("param1", parametr1);
    req.AddParam("param2", parametr2);
    
    req.OnSuccess = function() {
        $(div).innerHTML = this.responseText;
    }

    req.Send(strona);
}

function pokarz_ukryj(div)
  {
  if ($(div).style.display == "none")
    $(div).style.display = "block";
  else
    $(div).style.display = "none";
  }

function showpopup(id,pwidth,pheight)
  {
  $("mpopup").style.display="block";
  SetOpacity("mpopup", 100);
  SetSize("mpopup", 50, 50);

  $("mpopup").innerHTML ="<img src='images/ajax-loader.gif' alt='' border='0'>";

  SetY($("mpopup"),GetY($("p"+id))+20);

  if ( screen.availWidth<GetX($("p"+id))+pwidth )
    SetX($("mpopup"),GetX($("p"+id))-100);
  else
    SetX($("mpopup"),GetX($("p"+id))+20);

  var scrY=getScrollY()+screen.availHeight;
  var maxpozY=GetY($("p"+id))+220+pheight;
  
  //if (scrY<maxpozY) alert("scrY: "+ (scrY)+" maxYokna "+ (maxpozY));
  //if ();
  var req = mint.Request();

  req.OnLoaded = function()
    {
    $("mpopup").innerHTML ="";
    var group = mint.fx.Group(null, 20, 100);
    if (scrY<maxpozY) group.Add("mpopup", "top", null, (GetY($("p"+id))- (maxpozY-scrY))-20);
    if ( screen.availWidth<GetX($("p"+id))+pwidth ) group.Add("mpopup", "left", null, (screen.availWidth-(pwidth+220)) );
    group.Add("mpopup", "width", null, pwidth);
    group.Add("mpopup", "height", null, pheight);
    group.Run();

   group.OnDone = function(group){
      $("mpopup").innerHTML =req.responseText;
       }

    }
    

  req.Send("mpopup.php?id="+id);
  }

function getScrollY() {
  scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
  } else if( document.body && ( document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;

  }
  return scrOfY;
}


function hidepopup()
  {
    var group = mint.fx.Group(null, 20, 100);
    group.Add("mpopup", "opacity", null, 0);

    group.Run();
   group.OnDone = function(group){
    $("mpopup").style.display = "none";

       }
  }
  
function showpopup2(id,pwidth,pheight)
  {
  $("mpopup").style.display="block";
  SetOpacity("mpopup", 100);
  SetSize("mpopup", 50, 50);

  $("mpopup").innerHTML ="<img src='images/ajax-loader.gif' alt='' border='0'>";

  SetY($("mpopup"),GetY($("p"+id))+20);
  SetX($("mpopup"),GetX($("p"+id))-70);

  var scrY=getScrollY()+screen.availHeight;
  var maxpozY=GetY($("p"+id))+220+pheight;

  //if (scrY<maxpozY) alert("scrY: "+ (scrY)+" maxYokna "+ (maxpozY));
  //if ();
  var req = mint.Request();

  req.OnLoaded = function()
    {
    $("mpopup").innerHTML ="";
    var group = mint.fx.Group(null, 20, 100);
    if (scrY<maxpozY) group.Add("mpopup", "top", null, (GetY($("p"+id))- (maxpozY-scrY))-20);
    //group.Add("mpopup", "left", null,( GetX($("p"+id)) - (pwidth+100) )  );
    group.Add("mpopup", "left", null,( (screen.availWidth - pwidth)/2) )  ;
    group.Add("mpopup", "width", null, pwidth);
    group.Add("mpopup", "height", null, pheight);
    group.Run();

   group.OnDone = function(group){
      $("mpopup").innerHTML =req.responseText;
       }

    }


  req.Send("mpopup.php?id="+id);
  }

