function displayWindow(url, width, height) {

  var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0, scrollbars=yes, menubar=no' );

}





function okienko(url,width,height,sb,top,left){

  window.open(url,'okienko','align=center,location=0,toolbar=0,status=0,location=0,directories=0,resizable=0,scrollbars='+sb+',width='+width+',height='+height+',top='+top+',left='+left+',menubar=no')

}

function imsee(id)
{
  document.getElementById('im1').style.display="none";
  document.getElementById('im2').style.display="none";
  document.getElementById('im3').style.display="none";
  document.getElementById('im' + id).style.display="block";
}

function SendRequest(param1,param2,param3) {
  document.getElementById('ile6').className="";
  document.getElementById('ile9').className="";
  document.getElementById('ile12').className="";
  document.getElementById('ile'+param3).className="active";
  SetOpacity("ajaxchange",0);
  var req = mint.Request();

  req.OnSuccess = function() {
    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  req.Send("/katalog_ajax.php5?poziom_1="+param1+"&poziom_2="+param2+"&ileNaStrone="+param3, "ajaxchange")


}

function listaSpolecznosc(param)
{
  if (document.getElementById('lista'+param).style.display == "block")
  document.getElementById('lista'+param).style.display = "none"
  else
  {
    var req = mint.Request();
    req.OnSuccess = function(){
      document.getElementById('lista'+param).style.display = "block";
    }
    req.Send("/listaSpolecznosci.php5?id="+param,"lista"+param);
  }

}


function produktZgloszony(param)
{
  if ($('produkt'+param).style.display == "block"){
    $('produkt'+param).style.display = "none"
     $('s'+param).innerHTML = 'rozwiń';
    //rozwin
  } else {
    var req = mint.Request();
    req.OnSuccess = function(){
      $('produkt'+param).style.display = "block";
      $('s'+param).innerHTML = 'zwiń';

      //zwin
    }
    req.Send("/produktyZgloszone.php5?id="+param,"produkt"+param);
  }
}
function pokazForm()
{
  if ($('formZglos').style.display == "block"){
    $('formZglos').style.display = "none";
    $('sformZglos').innerHTML = 'rozwiń';
  } else {
    $('formZglos').style.display = "block";
    $('sformZglos').innerHTML = 'zwiń';
  }
}
function produktZgloszonyOpinie(param)
{
    var req = mint.Request();
    req.Send("/produktyZgloszoneOpinie.php5?id="+param,"sonda"+param);
}
function zmien(param,direction)
{
  if (direction == 2){
    produktZgloszonyOpinie(param);
    $('opisProduktu'+param).style.display = "none"
    $('sonda'+param).style.display = "block"
    $('liProdukt'+param).className = ""
    $('liSonda'+param).className = "active"
    
  } else {
    $('opisProduktu'+param).style.display = "block"
    $('sonda'+param).style.display = "none"
    $('liProdukt'+param).className = "active"
    $('liSonda'+param).className = ""

  }
}

function ProduktyGlosuj(param) {
    var req = mint.Request();
               
    req.OnSuccess = function() {
      location.href='#aProduct'+param;
      zmien(param,2);
      $('glosowanie'+param).hide();
    }
               
    req.SendForm("formGlosowanie"+param);
} 






function czyNaPewno() {
  var req = mint.Request();
  req.OnSuccess = function(){
    document.getElementById('czynapewno').style.display = "block";
    document.getElementById("czynapewno").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/czyNaPewno.php5","czynapewno");


}


function czytajKomentarz(param,param2) {
  var req = mint.Request();
  req.OnSuccess = function(){
    document.getElementById('czytajkomentarz').style.display = "block";
    document.getElementById("czytajkomentarz").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/czytajKomentarz.php5?id="+param+"&idkp="+param2,"czytajkomentarz");


}



function popupprodukt(param) {
  var req = mint.Request();
  req.OnSuccess = function(){
    document.getElementById('czytajkomentarz').style.display = "block";
    document.getElementById("czytajkomentarz").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/popupproduktt.php5?odnosnik="+param);


}


function czyNaPewnoo() {
  var req = mint.Request();
  req.OnSuccess = function(){
    document.getElementById('czynapewno').style.display = "block";
    document.getElementById("czynapewno").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/czyNaPewnoo.php5","czynapewno");


}


function SendRequestTagDel(param1,param2) {
  var req = mint.Request();
  req.Send("/ulubioneKategorieDel_ajax.php5?k="+param1+"&t="+param2, "ajaxchange")


}

function SendRequestUlubione(param1,param2) {

  if (param1 == 0)
  SetOpacity("UKcontent", 0);
  var req = mint.Request();
  var reg1 = mint.Request();
  if (param1 == 0)
  req.OnSuccess = function(){
    document.getElementById('UKcontent').style.display = "block";
    mint.fx.Fade("UKcontent", 100, 20, 1000);
  }
  if (param1 == 1)
  req.Send("/ulubioneKategorie.php5?id=" + param2, "UKcontent");
  else {
    if (param1 == 2)
    req.Send("/ulubioneKategorie.php5?id=" + param2 + "&del=yes", "UKcontent");
    else {
      if (temp == 0) {
        temp = 1;
        req.Send("/ulubioneKategorie.php5", "UKcontent");
      }
      else {
        temp = 0;
        document.getElementById('UKcontent').style.display = "none";
      }
    }
  }
}










function SendRequestTagi(param1,param3) {
  document.getElementById('ile6').className="";
  document.getElementById('ile9').className="";
  document.getElementById('ile12').className="";
  document.getElementById('ile'+param3).className="active";
  SetOpacity("ajaxchange",0);
  var req = mint.Request();
  var reg1 = mint.Request();
  req.OnSuccess = function() {
    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  req.Send("/tagii_ajax.php5?odnosnik="+param1+"&ileNaStrone="+param3, "ajaxchange")


}


function SendRequestWyszukiwarka(param1) {
  document.getElementById('ile6').className="";
  document.getElementById('ile9').className="";
  document.getElementById('ile12').className="";
  document.getElementById('ile'+param1).className="active";
  SetOpacity("ajaxchange",0);
  var req = mint.Request();
  var reg1 = mint.Request();
  req.OnSuccess = function() {
    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  req.Send("/wyszukiwarka_ajax.php5?ileNaStrone="+param1, "ajaxchange")


}


function SendRequestTagiProducent(param1,param2) {

  SetOpacity("ajaxchange",0);
  var req = mint.Request();
  req.OnSuccess = function() {
    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  req.Send("/tagii_ajax.php5?odnosnik="+param1+"&producent="+param2, "ajaxchange");
}



function SendRequestRecenzjePagination(param1) {

  SetOpacity("ajaxchange_recenzje",0);
  var req = mint.Request();
  req.OnSuccess = function() {
    mint.fx.Fade("ajaxchange_recenzje", 100, 20, 1000);
  }
  req.Send("/recenzje_ajax.php5?strona="+param1, "ajaxchange_recenzje");
}


function SendRequestPagination(param1, param2, param3){

  SetOpacity("ajaxchange", 0);
  var req = mint.Request();
  req.OnSuccess = function(){

    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  if (param2 != '')
  req.Send("/katalog_ajax.php5?poziom_1=" + param1 + "&poziom_2=" + param2 + "&strona=" + param3, "ajaxchange");
  else
  req.Send("/katalog_ajax.php5?poziom_1=" + param1 + "&strona=" + param3, "ajaxchange");

}


function SendRequestZakupyPagination(param1, param3){

  SetOpacity("main6", 0);
  var req = mint.Request();
  req.OnSuccess = function(){

    mint.fx.Fade("main6", 100, 20, 1000);
  }

  req.Send("/profil_zakupy_ajax.php5?strona=" + param3, "main6");

}


function SendRequestWyszukiwarkaPagination(param1, param2, param3,param4){

  SetOpacity("ajaxchange", 0);
  var req = mint.Request();
  req.OnSuccess = function(){

    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  req.Send("/wyszukiwarka_ajax.php5?fraza=" + param1 + "&dzial=" + param2 + "&producent=" + param3 + "&strona=" + param4, "ajaxchange");
}



function SendRequestTagiPagination(param1, param2){

  SetOpacity("ajaxchange", 0);
  var req = mint.Request();
  req.OnSuccess = function(){
    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  req.Send("/tagii_ajax.php5?odnosnik=" + param1 + "&strona=" + param2, "ajaxchange");

}



function SendRequestProducent(param1,param2,param3) {

  SetOpacity("ajaxchange",0);
  var req = mint.Request();
  req.OnSuccess = function() {
    mint.fx.Fade("ajaxchange", 100, 20, 1000);
  }
  if (param2!='')
  req.Send("/katalog_ajax.php5?poziom_1="+param1+"&poziom_2="+param2+"&producent="+param3, "ajaxchange");
  else
  req.Send("/katalog_ajax.php5?poziom_1="+param1+"&producent="+param3, "ajaxchange");

}


function SendRequestDodajRecenzje() {
  var req = mint.Request();
  req.OnSuccess = function() {
    document.getElementById("dodajRecenzje").style.display="block";
  }
  req.Send("/dodajRecenzje.php5","dodajRecenzje")


}


function SendRequestLogowanie() {
  var req = mint.Request();
  req.OnSuccess = function() {
    document.getElementById("logowanie").style.display="block";
    document.getElementById("logowanie").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/logowaniepop.php5","logowanie")


}



function SendRequestListaPrezentow() {
	var req = mint.Request();
	req.OnSuccess = function() {
		document.getElementById("logowanie").style.display="block";
		document.getElementById("logowanie").style.top=getScrollY() + 200 + "px";
    }
    req.Send("/listaPrezentow.php5","logowanie")
	
    
}


function SendRequestZapytaj(param1) {
  var req = mint.Request();
  req.OnSuccess = function() {
    document.getElementById("zapytaj").style.display="block";
    document.getElementById("zapytaj").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/zapytaj.php5?id=" + param1,"zapytaj");
}


function SendRequestZapytajW(param1,param2,param3,param4) {
	var req = mint.Request();
	req.OnSuccess = function() {
		document.getElementById("zapytaj").style.display="block";
		document.getElementById("zapytaj").style.top=getScrollY() + 200 + "px";
    }
    req.Send("/zapytaj.php5?id=" + param1 + "&kido=" + param2 + "&status="+param3+ "&N="+param4,"zapytaj");
}


function SendRequestLogowanie2() {
  var req = mint.Request();
  req.OnSuccess = function() {
    document.getElementById("logowanie").style.display="block";
    document.getElementById("logowanie").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/logowaniepop2.php5","logowanie")


}


function SendRequestPrzypomnijHaslo() {
  var req = mint.Request();
  req.OnSuccess = function() {
    document.getElementById("logowanie").style.display="none";
    document.getElementById("przypomnijHaslo").style.display="block";
    document.getElementById("przypomnijHaslo").style.top=getScrollY() + 200 + "px";
  }
  req.Send("/przypomnijHaslo.php5","przypomnijHaslo")


}

function SendRequestZglosProdukt() {
  var req = mint.Request();
  var y = getScrollY() + 200;
  req.OnSuccess = function() {
    document.getElementById("zglos_produkt").style.display="block";
    document.getElementById("zglos_produkt").style.top = y + "px";

  }
  req.Send("/zglosProdukt.php5","zglos_produkt")


}



function SendRequestWiadomosci(param)
{

  var req = mint.Request();
  var y = getScrollY() + 100;
  req.OnSuccess = function() {
    document.getElementById("jakToDziala").style.display="block";
    document.getElementById("jakToDziala").style.top = y + "px";
  }
  req.Send("/wiadomosci.php5?id="+param,"jakToDziala");

}

function SendRequestJakToDziala() {
  var req = mint.Request();
  var y = getScrollY() + 100;
  req.OnSuccess = function() {
    document.getElementById("jakToDziala").style.display="block";
    document.getElementById("jakToDziala").style.top = y + "px";
  }
  req.Send("/jakToDziala.php5","jakToDziala")


}


function niezalogowany() {
  var req = mint.Request();
  var y = getScrollY() + 100;
  req.OnSuccess = function() {
    document.getElementById("jakToDziala").style.display="block";
    document.getElementById("jakToDziala").style.height="50px";
    document.getElementById("jakToDziala").style.top = y + "px";
  }
  req.Send("/niezalogowany.php5","jakToDziala")


}



function SendRequestJakToDziala2() {
  var req = mint.Request();
  var y = getScrollY() + 200;
  req.OnSuccess = function() {
    document.getElementById("jakToDziala2").style.display="block";

    document.getElementById("jakToDziala2").style.top = y + "px";
  }
  req.Send("/jakToDziala2.php5","jakToDziala2")


}


function SendRequestRejestracja() {
   document.getElementById("logowanie").style.display="none";
  var req = mint.Request();
  req.OnSuccess = function() {
    document.getElementById("rejestracjapop").style.display="block";
  }
  req.Send("/rejestracjapop.php5","rejestracjapop")


}

function ChangeFoto(param)
{
  SetOpacity("galeriabig"+param,0);
  document.getElementById('galeriabig0').style.display="none";
  document.getElementById('galeriabig1').style.display="none";
  if (document.getElementById('galeriabig2'))
  {
    document.getElementById('galeriabig2').style.display="none";
  }

  document.getElementById('galeriabig'+param).style.display="block";
  mint.fx.Fade("galeriabig"+param, 100, 20, 1000);
}

function SendTagi(param1,param2)
{
  SetOpacity("tagilista",0);
  var req = mint.Request();
  req.OnSuccess = function() {
    mint.fx.Fade("tagilista",100, 20, 3000);
  }
  if (param2== -1)
  req.Send("/tagi_ajax.php5?ciag="+param1, "tagilista");
  else
  req.Send("/tagi_ajax.php5?ciag="+param1+"&limit="+param2, "tagilista");
}

function getScrollY() {
  var 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 zgas()
{
  document.getElementById('koszykAdd').style.display = 'block';
  mint.fx.Fade('koszykAdd', 0, 20, 4000);
}

function acb(id1,id2)
{
  document.getElementById(id1).style.display='block';
  document.getElementById(id1 + 'li').className='active';
  document.getElementById(id2).style.display='none';
  document.getElementById(id2 + 'li').className='';
}

function aa()
{
	document.getElementById('produktAdd').style.display = 'none';
}


function aaa()
{
	document.getElementById('koszykAdd').style.display = 'none';
}

function zgasProdukt()
{
  var y = getScrollY() + 200;
  document.getElementById("produktAdd").style.top = y + "px";
  document.getElementById('produktAdd').style.display = 'block';
  mint.fx.Fade('produktAdd', 0, 20, 4000);
}




function pokaz(id)
{
  var l = document.getElementById(id);
  l.style.display="block";
}


function pokaz(id){
  var o = document.getElementById(id);
  if (o.style.display != 'block') {
    o.style.display = "block";
  }

  if (id=='na_dzien_dobry')
  document.getElementById("menu1").style.background=' #3DC5E7 url("/_szablony_/public/img/menu1act.gif") no-repeat center top';
  else if(id=='wazne_w_pracy')
  document.getElementById("menu2").style.background=' #3DC5E7 url("/_szablony_/public/img/menu2act.gif") no-repeat center top';
  else if(id=='po_godzinach')
  document.getElementById("menu3").style.background=' #3DC5E7 url("/_szablony_/public/img/menu3act.gif") no-repeat center top';
  else if(id=='na_wieczor')
  document.getElementById("menu4").style.background=' #3DC5E7 url("/_szablony_/public/img/menu4act.gif") no-repeat center top';
  else if(id=='dla_urody')
  document.getElementById("menu5").style.background=' #3DC5E7 url("/_szablony_/public/img/menu5act.gif") no-repeat center top';
  else if(id=='rosnij_duzy')
  document.getElementById("menu6").style.background=' #3DC5E7 url("/_szablony_/public/img/menu6act.gif") no-repeat center top';
  else if(id=='prezent_z_okazji')
  document.getElementById("menu7").style.background=' #3DC5E7 url("/_szablony_/public/img/menu9act.gif") no-repeat center top';



}



function OnLoad(id) {
  mint.gui.RegisterDragObject(id);
}




function schowaj(id)
{
  var o = document.getElementById(id);
  if (id == 'na_dzien_dobry') {
    document.getElementById("na_dzien_dobry").style.display = "none";
    document.getElementById("menu1").style.background = ' #fff url("/_szablony_/public/img/menu1.gif") no-repeat center top';
  }
  else
  if (id == 'wazne_w_pracy') {
    document.getElementById("wazne_w_pracy").style.display = "none";
    document.getElementById("menu2").style.background = ' #fff url("/_szablony_/public/img/menu2.gif") no-repeat center top';
  }
  else
  if (id == 'po_godzinach') {
    document.getElementById("po_godzinach").style.display = "none";
    document.getElementById("menu3").style.background = ' #fff url("/_szablony_/public/img/menu3.gif") no-repeat center top';
  }
  else
  if (id == 'na_wieczor') {
    document.getElementById("na_wieczor").style.display = "none";
    document.getElementById("menu4").style.background = ' #fff url("/_szablony_/public/img/menu4.gif") no-repeat center top';
  }
  else
  if (id == 'dla_urody') {
    document.getElementById("dla_urody").style.display = "none";
    document.getElementById("menu5").style.background = ' #fff url("/_szablony_/public/img/menu5.gif") no-repeat center top';
  }
  else
  if (id == 'rosnij_duzy') {
    document.getElementById("rosnij_duzy").style.display = "none";
    document.getElementById("menu6").style.background = ' #fff url("/_szablony_/public/img/menu6.gif") no-repeat center top';
  }
  else
  if (id == 'prezent_z_okazji') {
    document.getElementById("prezent_z_okazji").style.display = "none";
    document.getElementById("menu7").style.background = ' #fff url("/_szablony_/public/img/menu9.gif") no-repeat center top';
  }
}

function close(id)
{
  document.getElementById(id).style.display='none';
}


