/*
 * Główna biblioteka funkcji JavaScript
 * Hipermarket Finansowy
 */

// funkcja obsługi menu (lewe/górne)
function change_offert(of_type, of_subtype, of_dst, of_tab, of_kh_tab) {
  if ( document.top_menu ) {
/*
    if ( of_type == 1 && of_subtype == 1 )
      document.top_menu.adv_active.value = 2;
    if ( of_type == 3 && of_subtype == 1 )
      document.top_menu.adv_active.value = 1;
    if ( of_type == 3 && of_subtype == 6 )
      document.top_menu.adv_active.value = 1;
*/
    document.top_menu.ofert_type.value = of_type;
    document.top_menu.ofert_subtype.value = of_subtype;
    document.top_menu.ofert_dst.value = of_dst;
    document.top_menu.ofert_tab.value = of_tab;
    document.top_menu.ofert_kh_tab.value = of_kh_tab;
    document.top_menu.submit();
  }
}
// eof funkcja obsługi menu (lewe/górne)


// nowa funkcja obsługi menu (lewe/górne)
function change_offert_new(of_type, of_subtype, of_dst, of_page, of_dept_menu_pos) {
  if ( document.new_top_menu ) {
    var new_top_menu = document.new_top_menu;
    new_top_menu.ofert_type.value = of_type;
    new_top_menu.ofert_subtype.value = of_subtype;
    new_top_menu.ofert_dst.value = of_dst;
    new_top_menu.tm_page.value = of_page;
    new_top_menu.dept_menu_pos.value = of_dept_menu_pos;
    new_top_menu.submit();
  }
}
// eof nowa funkcja obsługi menu (lewe/górne)


// funkcje obsługi lewego menu
var current_id = 0;
ar_down		= new Image();
ar_down.src	= "images/arrow_down_black.gif";
ar_right		= new Image();
ar_right.src	= "images/arrow_right_black.gif";

function showTab(id) {
  if ( current_id != 0 && current_id != id ) {
    document.getElementById('id'+current_id).style.display='none';
    document.getElementById('img'+current_id).src=ar_right.src;
  }
  document.getElementById('id'+id).style.display='block';
  document.getElementById('img'+id).src=ar_down.src;
  current_id = id;
}

function hideTab(id) {
//  document.getElementById('id'+id).style.display='none';
//  document.getElementById('img'+id).src='http://localhost/hiper_finance/images/arrow_right_black.gif';
}

function change_tab(id) {
  var kr_find = document.getElementById('kr'+id);
  if (kr_find)
    expandcontent(kr_find);
}
// eof funkcje obsługi lewego menu

// funkcja obsługi zmiany tabu w kredytach hipotecznych
function change_kh_tab(id) {
  var kh_find = document.getElementById('kh_'+id);
  if (kh_find) {
    expandcontent(kh_find);
  }
}
// eof funkcja obsługi zmiany tabu w kredytach hipotecznych

// funkcja obsługi zaawansowanego wyszukiwania
function change_adv_srch() {
  if (document.getElementById('adv_srch')) {
    if ( document.getElementById('adv_srch').style.display == '' )
      document.getElementById('adv_srch').style.display = 'none';
    else
      document.getElementById('adv_srch').style.display = '';
  }
}
// eof funkcja obsługi zaawansowanego wyszukiwania


// funkcje otwierajšca nowe okno o wybranych rozmiarach
function formSendDS(form_name, small)
{
  if ( window.domain !== undefined && window.domain == 'skapiec' ) {
    document.forms[form_name].setAttribute("action","finanse_popup.html");
  }

  if ( small == 1 ) {
    var nleft = (screen.width - 840)/2;
    var ntop = (screen.height - 620)/2;
    window.open("","myNewWin","toolbar=no,height=620px,width=840px,resizable=1,scrollbars=1,location=0,statusbar=0,menubar=0,left="+nleft+",top="+ntop).focus();
  } else if ( small == 2 ) {
    var nleft = (screen.width - 640)/2;
    var ntop = (screen.height - 620)/2;
    window.open("","scheduleWin","toolbar=no,height=620px,width=640px,resizable=1,scrollbars=1,location=0,statusbar=0,menubar=0,left="+nleft+",top="+ntop).focus();
  } else {
    window.open("","myNewWin","toolbar=no,fullscreen=yes,resizable=1,scrollbars=1,location=0,statusbar=0,menubar=0").focus();
  }
  var a = window.setTimeout("document."+form_name+".submit();",100);
}

function formSendOCAC(form_name)
{
  if ( window.domain !== undefined && window.domain == 'skapiec' ) {
    document.forms[form_name].setAttribute("action","finanse_popup.html");
  }

  window.open("","OCACWin","toolbar=no,height=620px,width=740px,resizable=1,scrollbars=1,location=0,statusbar=0,menubar=0,left=100,top=100").focus();
  var a = window.setTimeout("document."+form_name+".submit();",100);
}

function formSendOpinion(form_name)
{
  if ( window.domain !== undefined && window.domain == 'skapiec' ) {
    document.forms[form_name].setAttribute("action","finanse_popup.html");
  }

  window.open("","opinionWin","toolbar=no,height=640px,width=700px,resizable=1,scrollbars=1,location=0,statusbar=0,menubar=0,left=100,top=100").focus();
  var a = window.setTimeout("document."+form_name+".submit();",100);
}

function tempWindow(tw_link, tw_width, tw_height)
{
  window.open(tw_link,"TempWin","toolbar=no,height="+tw_height+"px,width="+tw_width+"px,resizable=1,scrollbars=1,location=0,statusbar=0,menubar=0,left=100,top=100").focus();
}

// eof funkcje otwierajšca nowe okno o wybranych rozmiarach


function LinkClick(linkobj) {
    advAJAX.get({
        url: "guide.php",
        onSuccess : function(obj) {
                  var tab = obj.responseText.split("&&");
                  if ( document.getElementById('guide_content') )
                    document.getElementById('guide_content').innerHTML = tab[0];

                  // tekst do filmu
                  if ( document.getElementById('hf_guide_video_text') )
                    document.getElementById('hf_guide_video_text').style.display='none';
                  if ( tab.length > 1 && document.getElementById('hf_guide_video_text')) {
                    if ( tab[1] != '' ) {
                      document.getElementById('hf_guide_video_text').style.display='block';
                      document.getElementById('lyr1').innerHTML = tab[1];
                      dw_scrollObj.loadLayer('wn','lyr1');
                    }
                  }

                  // inny film
                  if ( tab.length > 2 ) {
                    void(0);
                  }

                  //nowy artykuł
                  if ( tab.length > 3 ) {
                    if ( tab[3] != '' && document.getElementById('hf_adv1_body') )
                      document.getElementById('hf_adv1_body').innerHTML = tab[3];
                  }

                  //nowa promocja
                  if ( tab.length > 4 ) {
                    if ( tab[4] != '' && document.getElementById('hf_adv2_body') )
                      document.getElementById('hf_adv2_body').innerHTML = tab[4];
                  }

        },
        parameters : {
          "ajax" : "1",
          "rel" : linkobj.getAttribute("rel")
        },
        method: "POST",
        async: true
    });
}

function initializeAjaxContent() {
  for (var i=0; i<arguments.length; i++){
    var ulobj=document.getElementById(arguments[i]);
    var ulist=ulobj.getElementsByTagName("li");

    for (var x=0; x<ulist.length; x++){
      var ulistlink=ulist[x].getElementsByTagName("a")[0];
      if (ulistlink.getAttribute("rel")){
         ulistlink.onclick = function() {
           expandcontent(this);
           LinkClick(this);
           return false;
         }
      }
    }

  }
}

function videoAutoRun() {
  if ( document.getElementById("video_check").getAttribute("rel") == "check" ) {
    advAJAX.get({
        onSuccess : function(obj) { document.getElementById("video_check").setAttribute("rel","uncheck"); document.getElementById("video_check").src="http://www.hipermarketfinansowy.pl/images/buttons/video_uncheck.gif"; sendEvent('guide_video_1','stop');},
        parameters : {
          "ajax" : "1",
          "p_video_autorun" : "1"
        },
        method: "POST",
        async: true
    });

  } else {
    advAJAX.get({
        onSuccess : function(obj) { document.getElementById("video_check").setAttribute("rel","check"); document.getElementById("video_check").src="http://www.hipermarketfinansowy.pl/images/buttons/video_check.gif"; sendEvent('guide_video_1','playpause');},
        parameters : {
          "ajax" : "1",
          "p_video_autorun" : "2"
        },
        method: "POST",
        async: true
    });

  }
}

function initializeCompareOverLib() {
  var ulist = document.getElementsByTagName("input");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_compare') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Zaznacz dwie lub więcej ofert, następnie kliknij <img src="http://www.hipermarketfinansowy.pl/images/buttons/porownaj_top.gif"> by wyświetlić porównanie warunków szczegółowych.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Podpowiedź</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', LEFT, WIDTH, 200, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }
}

function initializeCompareOverLibUTF8() {
  var ulist = document.getElementsByTagName("input");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_compare') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Zaznacz dwie lub wiÄcej ofert, nastÄpnie kliknij <img src="http://www.hipermarketfinansowy.pl/images/buttons/porownaj_top.gif"> by wyĹwietliÄ porĂłwnanie warunkĂłw szczegĂłĹowych.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">PodpowiedĹş</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', LEFT, WIDTH, 200, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }
}

function initializePrivateOverLib() {
  ulist = document.getElementsByTagName("a");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_private') {
        ulistitem.onmouseover = function() {return overlib('<br><ul><li style="margin-left: 20px;">Gwarantujemy <b>pełną poufność</b> Państwa danych osobowych dostępnych w zakładce "Moje konto"<li style="margin-left: 20px;">Dane osobowe są przekazywane do banków i innych inst.finansowych <b>TYLKO</b> w niezbędnych przypadkach, <b>w celu realizacji</b> zakupu wybranego produktu.<li style="margin-left: 20px;">Przed przekazaniem Państwa danych <b>każdorazowo</b> wyświetlana jest informacja o tym.<li style="margin-left: 20px;">Po wprowadzeniu aukcji i negocjacji oferty, dla banków i doradców widoczne są tylko parametry finansowe, <b>bez danych osobowych</b>.</ul><div style="margin:6px; font-weight: bold; width:100%; text-align: center;">Dane osobowe przekazywane są TYLKO w momencie, kiedy zdecydujecie się Państwo na wybraną ofertę.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Polityka poufności</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', LEFT, WIDTH, 400, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }
}

function initializePrivateOverLibUTF8() {
  ulist = document.getElementsByTagName("a");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_private') {
        ulistitem.onmouseover = function() {return overlib('<br><ul><li style="margin-left: 20px;">Gwarantujemy <b>peĹnÄ poufnoĹÄ</b> PaĹstwa danych osobowych dostÄpnych w zakĹadce "Moje konto"<li style="margin-left: 20px;">Dane osobowe sÄ przekazywane do bankĂłw i innych inst.finansowych <b>TYLKO</b> w niezbÄdnych przypadkach, <b>w celu realizacji</b> zakupu wybranego produktu.<li style="margin-left: 20px;">Przed przekazaniem PaĹstwa danych <b>kaĹźdorazowo</b> wyĹwietlana jest informacja o tym.<li style="margin-left: 20px;">Po wprowadzeniu aukcji i negocjacji oferty, dla bankĂłw i doradcĂłw widoczne sÄ tylko parametry finansowe, <b>bez danych osobowych</b>.</ul><div style="margin:6px; font-weight: bold; width:100%; text-align: center;">Dane osobowe przekazywane sÄ TYLKO w momencie, kiedy zdecydujecie siÄ PaĹstwo na wybranÄ ofertÄ.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Polityka poufnoĹci</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', LEFT, WIDTH, 400, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }
}

function initializeMarginOverLib() {
  ulist = document.getElementsByTagName("a");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_funds') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">'+this.getAttribute('opis')+'</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Fundusze</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_margin') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">'+this.getAttribute('opis')+'</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Składniki oprocentowania</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_rating') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Rating to obiektywne porównanie na ile dana oferta spełnia standardy rynkowe.<br />Najwyższa ocena to 5.</div><div class="hf_overlib" style="text-align: center; border-top: 1px solid #FFCC33;">Klikij aby zobaczyć szczegóły ratingu oferty.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Punktacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_rank') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Kliknij tutaj aby zobaczyć opinie internautów</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Opinie</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_payoff') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Kliknij tutaj aby zobaczyć jakie będą dokładne koszty miesięczne. Zmień walutę kredytu lub jego okres w pasku szybkiego wyboru i przekonaj się jak kształtuje to wysokość raty.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Plan spłaty</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_costs') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">To całkowity koszt odsetek, kapitału i innych opłat kredytu. </div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Suma kosztów</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_spread') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">To różnica kursu waluty po jakim spłacamy kredyt. Im wyższy spread, tym więcej bank pobiera każdorazowo za spłatę w złotówkach kredytu walutowego - (o ile procent będzie droższa co miesięczna spłata).</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Spread</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }

  ulist = document.getElementsByTagName("p");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_extramoney') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Dzięki wzrostowi cen nieruchomości, refinansując kredyt można go zwiększyć, wypłacając gotówkę. Każdy bank stosuje odmienne zasady - zobacz, które daje najwięcej!</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Dodatkowa gotówka</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_instalment') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Rata zawiera:<br />- prowizję banku,<br />- ratę kapitałowo-odsetkową,<br />- koszt spread,<br />- ewentualne dodatkowe ubezpieczenie obowiązkowe.<br /><br />Więcej szczegółów w <b>harmonogramie spłat</b>.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Rata</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_margin') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">'+this.getAttribute('opis')+'</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Składniki oprocentowania</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_best') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">w zależności od dochodów i sytuacji</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Wysokość raty</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }


  ulist = document.getElementsByTagName("u");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'how_toget') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 20px; font: normal 10pt Tahoma, Arial, sans-serif;"><b>Oprocentowanie</b> kredytu składa się z:</div><div style="font-weight: normal; text-align: left; margin-bottom: 22px; font-size: 10pt;"><ul><li><b>Stawki bazowej</b> (stałej, ale innej dla każdego banku)<li><b>Marży</b> (która może podlegać negocjacjom)</ul>Wysokość marży można negocjować samodzielnie w banku, lecz warto pozostawić to doradcy kredytowemu, który - z racji tego iż udziela wielu kredytów - posiada zniżki dla swoich klientów w różnych bankach.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Jak uzyskać lepsze warunki</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 420, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }

  ulist = document.getElementsByTagName("img");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'real_ofe_value') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Realna wartość pokazuje, ile warta byłaby dzisiaj Twoja emerytura. Kliknij na podkreślonej realnej kwocie, aby zobaczyć  szczegóły.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Realna wartość emerytury</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'real_percent') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Realne oprocentowanie obliczone dla wybranego okresu i kwoty lokaty (oprocentowanie jest z reguły wyższe im dłuższa lokata).</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Realne oprocentowanie</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 420, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'rns_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw wybierz rodzaj nieruchomości, jaką zamierzasz zakupić, i jej powierzchnię.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'rns_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Następnie określ jej wartość rynkową.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'rns_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz okres spłaty.<br /><br />Zwróć uwagę, iż kredyty na okres powyżej 30 lat są zwykle nieopłacalne<br /><br />Sprawdź różne opcje dla tego samego kredytu!</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 146, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kh_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw wybierz rodzaj nieruchomości, jaką zamierzasz zakupić, i jej wartość rynkową.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kh_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz wielkość kredytu - pamiętaj, że im wyższy wkład własny, tym niższe oprocentowanie.<br /><br />Jeżeli wybierzesz wkład własny poniżej 20%, zapewne konieczne będzie ubezpieczenie brakującego wkładu - dodatkowa opłata do raty kredytu.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 155, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kh_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz walutę kredytu i okres spłaty.<br /><br />Kredyty w CHF i EUR mają niższe raty, z kolei kredyty w PLN są bezpieczne, można uzyskać dopłatę państwa do odsetek przez 8 lat.<br /><br />Zwróć uwagę, iż kredyty na okres powyżej 30 lat są zwykle nieopłacalne<br /><br />Sprawdź różne opcje dla tego samego kredytu!</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 216, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'khk_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw określ przybliżoną bieżącą wartość rynkową nieruchomości.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'khk_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wprowadź kwoty poszczególnych kredytów, które chcesz skonsolidować w jeden. Jeżeli nie posiadasz kredytu danego typu wpisz 0.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 155, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'khk_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz walutę kredytu i okres spłaty.<br /><br />Kredyty w CHF i EUR mają niższe raty, z kolei kredyty w PLN są bezpieczne, można uzyskać dopłatę państwa do odsetek przez 8 lat.<br /><br />Zwróć uwagę, iż kredyty na okres powyżej 30 lat są zwykle nieopłacalne<br /><br />Sprawdź różne opcje dla tego samego kredytu!</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 216, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kp_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw określ wysokość pożyczki jaka Cię interesuje.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kp_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz okres kredytowania. Im dłuższy tym mniejsze raty ale jednocześnie wyższe koszty kredytu.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kp_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Zawęź ofertę do kredytów udzielanych na zaświadczenie o dochodach lub bez niego.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280,  FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw określ cenę pojazdu jaki będzie celem kredytowania.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz wielkość kredytu - pamiętaj, że im wyższy wkład własny, tym niższe oprocentowanie.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz walutę kredytu i okres spłaty.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280,  FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_4') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Określ wiek samochodu. W wielu bankach wpływa on na wysokość oprocentowania.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280,  FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'pa_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Saldo miesięczne  - kwota, jaka średnio jest utrzymywana na rachunku w ciągu miesiąca.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'pa_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Liczba przelewów - przelewów tego samego  wewnątrz banku nie bierzemy pod uwagę, gdyż zazwyczaj są one bezpłatne.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'pa_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wypłaty z bankomatów - opłat za wypłaty z bankomatów własnych banków nie bierzemy pod uwagę, gdyż zazwyczaj są one bezpłatne.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280,  FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
      
      
    }
  }

}

function initializeMarginOverLibUTF8() {
  ulist = document.getElementsByTagName("a");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_funds') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">'+this.getAttribute('opis')+'</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Fundusze</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_margin') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">'+this.getAttribute('opis')+'</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">SkĹadniki oprocentowania</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_rating') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Rating to obiektywne porĂłwnanie na ile dana oferta speĹnia standardy rynkowe.<br />NajwyĹźsza ocena to 5.</div><div class="hf_overlib" style="text-align: center; border-top: 1px solid #FFCC33;">Klikij aby zobaczyÄ szczegĂłĹy ratingu oferty.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Punktacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_rank') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Kliknij tutaj aby zobaczyÄ opinie internautĂłw</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Opinie</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_payoff') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Kliknij tutaj aby zobaczyÄ jakie bÄdÄ dokĹadne koszty miesiÄczne. ZmieĹ walutÄ kredytu lub jego okres w pasku szybkiego wyboru i przekonaj siÄ jak ksztaĹtuje to wysokoĹÄ raty.</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Plan spĹaty</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_costs') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">To caĹkowity koszt odsetek, kapitaĹu i innych opĹat kredytu. </div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Suma kosztĂłw</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_spread') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">To rĂłĹźnica kursu waluty po jakim spĹacamy kredyt. Im wyĹźszy spread, tym wiÄcej bank pobiera kaĹźdorazowo za spĹatÄ w zĹotĂłwkach kredytu walutowego - (o ile procent bÄdzie droĹźsza co miesiÄczna spĹata).</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Spread</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }

  ulist = document.getElementsByTagName("p");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'hf_extramoney') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">DziÄki wzrostowi cen nieruchomoĹci, refinansujÄc kredyt moĹźna go zwiÄkszyÄ, wypĹacajÄc gotĂłwkÄ. KaĹźdy bank stosuje odmienne zasady - zobacz, ktĂłre daje najwiÄcej!</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Dodatkowa gotĂłwka</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_instalment') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">Rata zawiera:<br />-prowizjÄ banku,<br />- ratÄ kapitaĹowo-odsetkowÄ,<br />- koszt spread,<br />- ewentualne dodatkowe ubezpieczenie obowiÄzkowe.<br /><br />WiÄcej szczegĂłĹĂłw w <b>harmonogramie spĹat</b>.</div>',SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Rata</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_margin') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">'+this.getAttribute('opis')+'</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">SkĹadnikioprocentowania</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'hf_best') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib">w zaleĹĽnoĹ>ci od dochodĂłw i sytuacji</div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">WysokoĹ>Ä? raty</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 180, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }

  ulist = document.getElementsByTagName("u");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'how_toget') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 20px; font: normal 10pt Tahoma, Arial, sans-serif;"><b>Oprocentowanie</b> kredytu skĹada siÄ z:</div><div style="font-weight: normal; text-align: left; margin-bottom: 22px; font-size: 10pt;"><ul><li><b>Stawki bazowej</b> (staĹej, ale innej dla kaĹźdego banku)<li><b>MarĹźy</b> (ktĂłra moĹźe podlegaÄ negocjacjom)</ul>WysokoĹÄ marĹźy moĹźna negocjowaÄ samodzielnie w banku, lecz warto pozostawiÄ to doradcy kredytowemu, ktĂłry - z racji tego iĹź udziela wielu kredytĂłw - posiada zniĹźki dla swoich klientĂłw w rĂłĹźnych bankach.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Jak uzyskaÄ lepsze warunki</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 420, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }

  ulist = document.getElementsByTagName("img");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'real_percent') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Realne oprocentowanie obliczone dla wybranego okresu i kwoty lokaty (oprocentowanie jest z reguĹy wyĹźsze im dĹuĹźsza lokata).</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Realne oprocentowanie</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', CENTER, WIDTH, 420, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kh_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw wybierz rodzaj nieruchomoĹ>ci, jakÄ. zamierzasz zakupiÄ?, i jej wartoĹ>Ä? rynkowÄ..</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kh_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz wielkoĹ>Ä? kredytu - pamiÄTtaj, ĹĽe im wyĹĽszy wkĹ,ad wĹ,asny, tym niĹĽsze oprocentowanie.<br /><br />JeĹĽeli wybierzesz wkĹ,ad wĹ,asny poniĹĽej 20%, zapewne konieczne bÄTdzie ubezpieczenie brakujÄ.cego wkĹ,adu - dodatkowa opĹ,ata do raty kredytu.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 155, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kh_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz walutÄT kredytu, okres spĹ,aty i rodzaj rat.<br /><br />Kredyty w CHF i EUR majÄ. niĹĽsze raty, z kolei kredyty w PLN sÄ. bezpieczne, moĹĽna uzyskaÄ? dopĹ,atÄT paĹ"stwa do odsetek przez 8 lat.<br /><br />ZwrĂłÄ? uwagÄT, iĹĽ kredyty na okres powyĹĽej 30 lat sÄ. zwykle nieopĹ,acalne<br /><br />SprawdĹş rĂłĹĽne opcje dla tego samego kredytu!</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, HEIGHT, 216, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kp_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw okreĹ>l wysokoĹ>Ä? poĹĽyczki jaka CiÄT interesuje.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kp_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz okres kredytowania. Im dĹ,uĹĽszy tym mniejsze raty ale jednoczeĹ>nie wyĹĽsze koszty kredytu.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'kp_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">ZawÄTĹş ofertÄT do kredytĂłw udzielanych na zaĹ>wiadczenie o dochodach lub bez niego.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_1') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Najpierw okreĹ>l cenÄT pojazdu jaki bÄTdzie celem kredytowania.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_2') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz wielkoĹ>Ä? kredytu - pamiÄTtaj, ĹĽe im wyĹĽszy wkĹ,ad wĹ,asny, tym niĹĽsze oprocentowanie.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_3') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Wybierz walutÄT kredytu i okres spĹ,aty.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280,  FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      } else
      if (ulistitem.getAttribute("rel") == 'ks_4') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">OkreĹ>l wiek samochodu. W wielu bankach wpĹ,ywa on na wysokoĹ>Ä? oprocentowania.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Informacja</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', RIGHT, WIDTH, 280,  FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }

}

function initializeBrokerOverLib() {
  var ulist = document.getElementsByTagName("img");
  for (var x=0; x<ulist.length; x++) {
    var ulistitem=ulist[x];
    if (ulistitem.getAttribute("rel")) {
      if (ulistitem.getAttribute("rel") == 'mini_help') {
        ulistitem.onmouseover = function() {return overlib('<div class="hf_overlib"><div style="text-align: left;margin-bottom: 10px;height: 70px; font: normal 10pt Tahoma, Arial, sans-serif;">Kalkulator przedstawia oszczędności, jakie można uzyskać zamawiając kredyt poprzez hipermarketfinansowy.pl, w stosunku do najmniej korzystnej oferty w chwili obecnej. Wszystkie obliczenia przeprowadzane są dla stawek rzeczywistych, obowiązujących w dniu dzisiejszym, przy założeniu wieku najstarszego kredytobiorcy = 30 lat oraz LTV = 90% i aktualnych stawkach WIBOR, LIBOR odpowiednich dla każdego z banków.<br /><br />Obliczenia uwzględniają spread wyliczony na dzień dzisiejszy na podstawie automatycznie aktualizowanych danych.</div></div>', SHADOW, SHADOWOPACITY,70, CAPTION, '<div class="hf_overlib_title">Oszczędności</div>', BGCLASS, 'hf_overlib_bgclass', CAPCOLOR, '#000000', LEFT, WIDTH, 420, HEIGHT, 170, FGCOLOR, '#FFFFFF', DELAY, 300, TEXTCOLOR, '#222C53', NOCLOSE);};
        ulistitem.onmouseout = function() {return nd();};
      }
    }
  }
}

function loadAdv() {
    advAJAX.get({
        onSuccess : function(obj) { document.getElementById("hf_adv2_body").innerHTML=obj.responseText; setTimeout("loadAdv()",15000); },
        parameters : {
          "ajax" : "1",
          "p_adv2_change" : "1"
        },
        method: "POST",
        async: true
    });
}

function changeAdv(adv_id) {
  document.adv_form.adv_active.value=adv_id;
  document.adv_form.submit();
}


/* blink dla przycisku "Wybierz" w wynikach */
var blink_list = new Array();
var blink_run = false;
var intervalID;

function startBlink() {
  if ( blink_run == false )
    intervalID = window.setInterval('blink(0)',500);
  blink_run = true;
}

function stopBlink() {
  if ( blink_run == true ) {
    window.clearInterval(intervalID);
    blink(1);
  }

  blink_run = false;
}

function blink(all_show) {
  var i;
  if ( !blink_list || blink_list.length == 0 ) {
    var blink_list_id = 0;
    var parent_div = document.getElementById('noffertslist');
    if ( parent_div ) {
      var images = parent_div.getElementsByTagName('input');
      for ( i=0; i < images.length; i++ ) {
        if ( images[i].getAttribute('type') != 'image' )
          continue;
        if ( images[i].getAttribute('src').indexOf('opcje_zakupu.gif') > -1  ) {
          blink_list[blink_list_id] = images[i];
          blink_list_id++;
        }
      }
    }
  }

  if ( blink_list ) {
    if ( all_show == 1 ) {
      for ( i=0; i < blink_list.length; i++ )
          blink_list[i].style.backgroundColor = '';
    } else {
      for ( i=0; i < blink_list.length; i++ ) {
        if ( blink_list[i].style.backgroundColor == '' )
          blink_list[i].style.backgroundColor = '#CCE0FF';
        else
          blink_list[i].style.backgroundColor = '';
      }
    }
  }

}
/* eof blink dla przycisku "Wybierz" w wynikach */

function initializeMasterForm() {
  var master_form = document.masterform;
  
  if ( master_form.mf_order_alternative ) {
    master_form.mf_order_alternative.value = 0;
  }

  var better_condition = 0;
  if ( master_form.mf_better_condition ) {
    better_condition = master_form.mf_better_condition.value;
  }


  if ( arguments[0] == 1 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 1;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 2 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 1;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','scheduleWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 3 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 1;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 4 ) {
    master_form.ofert_step.value = 3;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 1;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 5 ) {
    master_form.ofert_step.value = 4;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.removeAttribute('target');
    master_form.removeAttribute('action');
  } else
  if ( arguments[0] == 6 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 1;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 7 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.show_ability.value = 1;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 8 ) {
    master_form.ofert_step.value = 4;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.removeAttribute('target');
    master_form.removeAttribute('action');
    if ( better_condition != 1 )
      master_form.mf_order_alternative.value = 2;
  }

  master_form.mf_rate_1.value = arguments[1];
  master_form.mf_rate_2.value = arguments[2];
  master_form.mf_product_id.value = arguments[3];
  master_form.mf_month_period.value = arguments[4];
  master_form.mf_percent.value = arguments[5];
  master_form.mf_type.value = arguments[6];
  master_form.mf_spread.value = arguments[7];
  master_form.mf_promo_percent.value = arguments[8];
  master_form.mf_promo_month_period.value = arguments[9];
  master_form.mf_percent_component.value = arguments[10];
  master_form.mf_product_type.value = arguments[11];
  master_form.mf_cost_list.value = arguments[12];
  master_form.mf_sum.value = arguments[13];
  master_form.mf_self_value.value = arguments[14];
  if ( arguments.length>14 && master_form.mf_comm ) {
    master_form.mf_comm.value = arguments[15];
  }

  if ( arguments.length>15 && master_form.mf_insurance ) {
    master_form.mf_insurance.value = arguments[16];
  }
}

function initializeSerialForm() {
  var master_form = document.serialform;
  
  if ( arguments[0] == 1 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 1;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 2 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 1;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','scheduleWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 3 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 1;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 4 ) {
    master_form.ofert_step.value = 3;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 1;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 5 ) {
    master_form.ofert_step.value = 4;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.removeAttribute('target');
    master_form.removeAttribute('action');
  } else
  if ( arguments[0] == 6 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 1;
    master_form.show_adviser.value = 0;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 7 ) {
    master_form.ofert_step.value = 2;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.show_ability.value = 1;
    master_form.setAttribute('target','myNewWin');
    master_form.setAttribute('action','index.php?no_b=1');
  } else
  if ( arguments[0] == 8 ) {
    master_form.ofert_step.value = 4;
    master_form.show_costs.value = 0;
    master_form.show_schedule.value = 0;
    master_form.details.value = 0;
    master_form.show_spread.value = 0;
    master_form.show_adviser.value = 0;
    master_form.removeAttribute('target');
    master_form.removeAttribute('action');
  }

  master_form.mf_serial.value = 'A0'+arguments[1];
}

function calculateSelfInput() {
  var x_self_inp_1 = parseFloat(document.getElementById('x_self_inp_1').value.replace(',','.').replace(/ /g,''));
  var x_self_inp_2 = parseFloat(document.getElementById('x_self_inp_2').value.replace(',','.').replace(/ /g,''));
  var result;

  if ( isNaN(x_self_inp_1) || isNaN(x_self_inp_2) )
    document.getElementById('x_self_inp').innerHTML='Błąd';
  else {
    result = 100 - (x_self_inp_1/x_self_inp_2)*100;
    if ( result < 0 )
      result = 0;
    if ( result > 100 )
      result = 100;
    document.getElementById('x_self_inp').innerHTML=(Math.round(result*100)/100)+'%';
  }
}

function infolinia_popup(ipWidth, ipHeight, ipFormName)
{
  ipFormName = typeof(ipFormName) != 'undefined' ? ipFormName : 'infolinia_popup_form';
  var nleft = (screen.width - ipWidth)/2;
  var ntop = (screen.height - ipHeight)/2;
  window.open("","infolinia_popup","toolbar=no,height="+ipHeight+"px,width="+ipWidth+"px,resizable=0,scrollbars=1,location=0,statusbar=0,menubar=0,left="+nleft+",top="+ntop).focus();
  var a = window.setTimeout("document."+ipFormName+".submit();",100);
}

function windowPopup(formName, targetName, ipWidth, ipHeight, ipShowScroll)
{
  ipShowScroll = typeof(ipShowScroll) != 'undefined' ? ipShowScroll : 0;
  ipShowScroll = ipShowScroll == 0 ? 0 : 1;

  var nleft = (screen.width - ipWidth)/2;
  var ntop = (screen.height - ipHeight)/2;
  window.open("",targetName,"height="+ipHeight+"px,width="+ipWidth+"px,status=0,toolbar=0,resizable=0,scrollbars="+ipShowScroll+",location=0,statusbar=0,menubar=0,left="+nleft+",top="+ntop).focus();
  var a = window.setTimeout("document."+formName+".submit();",100);
}

function setTarget(formName, targetName) {
  if ( targetName == '' )
    document.forms[formName].removeAttribute('target');
  else
    document.forms[formName].setAttribute('target', targetName);
}

function addOption(selectbox,text,value,def_val) {
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;
	optn.selected = ( value == def_val ) ? (true) : (false);
	optn.defaultSelected = ( value == def_val ) ? (true) : (false);
	id = selectbox.options.add(optn);
	if ( value == def_val )
		selectbox.selectedIndex = selectbox.length-1;
}

function displayRow(selectrow, visible) {
	if ( visible == false )
		selectrow.style.display = 'none';
	else {
		// dla IE
		if( navigator.appName == "Microsoft Internet Explorer" )
			selectrow.style.display = 'block';
		else
		// dla reszty
			selectrow.style.display = 'table-row';
	}
}

function changeProvince(prov_obj, city_obj, city_div, defaul_city, city_div2) {
	var province = parseInt(prov_obj.value);
	if ( !defaul_city )
		var defaul_city = ''; 

	displayRow(city_div, false);
	if ( city_div2 )
		displayRow(city_div2, false);
	displayRow(city_obj, true);
		
	switch ( province ) {
		case 1 : // dolnośląskie
						displayRow(city_div, true);
						if ( city_div2 )
							displayRow(city_div2, true);
						city_obj.innerHTML='';
						addOption(city_obj,'wybierz...','',defaul_city); 
						addOption(city_obj,'Jelenia Góra','Jelenia Góra',defaul_city); 
						addOption(city_obj,'Wrocław','Wrocław',defaul_city);
						break;
		case 2: // kujawsko-pomorskie
						city_obj.innerHTML='';
						addOption(city_obj,'Bydgoszcz','Bydgoszcz','Bydgoszcz'); 
						break;
		case 3: // lubelskie
						city_obj.innerHTML='';
						addOption(city_obj,'Lublin','Lublin','Lublin'); 
						break;
		case 4: // lubuskie
						city_obj.innerHTML='';
						addOption(city_obj,'Zielona Góra','Zielona Góra','Zielona Góra'); 
						break;
		case 5: // łódzkie
						city_obj.innerHTML='';
						addOption(city_obj,'Łódź','Łódź','Łódź'); 
						break;
		case 6: // mazowieckie
						displayRow(city_div, true);
						if ( city_div2 )
							displayRow(city_div2, true);
						city_obj.innerHTML='';
						addOption(city_obj,'wybierz...','',defaul_city); 
						addOption(city_obj,'Płock','Płock',defaul_city); 
						addOption(city_obj,'Radom','Radom',defaul_city);
						addOption(city_obj,'Warszawa','Warszawa',defaul_city);
						break;
		case 7: // małopolskie
						city_obj.innerHTML='';
						addOption(city_obj,'Kraków','Kraków','Kraków'); 
						break;
		case 8: // opolskie
						city_obj.innerHTML='';
						addOption(city_obj,'Opole','Opole','Opole'); 
						break;
		case 9: // podkarpackie
						city_obj.innerHTML='';
						addOption(city_obj,'Rzeszów','Rzeszów','Rzeszów'); 
						break;
		case 10: // podlaskie
						city_obj.innerHTML='';
						addOption(city_obj,'Białystok','Białystok','Białystok'); 
						break;
		case 11: // poomorskie
						displayRow(city_div, true);
						if ( city_div2 )
							displayRow(city_div2, true);
						city_obj.innerHTML='';
						addOption(city_obj,'wybierz...','',defaul_city); 
						addOption(city_obj,'Gdańsk','Gdańsk',defaul_city); 
						addOption(city_obj,'Gdynia','Gdynia',defaul_city);
						break;
		case 12: // śląskie
						city_obj.innerHTML='';
						addOption(city_obj,'Katowice','Katowice','Katowice'); 
						break;
		case 13: // świętokrzyskie
						city_obj.innerHTML='';
						addOption(city_obj,'Kielce','Kielce','Kielce'); 
						break;
		case 14: // warmińsko-mazurskie
						city_obj.innerHTML='';
						addOption(city_obj,'Olsztyn','Olsztyn','Olsztyn'); 
						break;
		case 15: // wielkopolskie
						city_obj.innerHTML='';
						addOption(city_obj,'Poznań','Poznań','Poznań'); 
						break;
		case 16: // zachodniopomorskie
						displayRow(city_div, true);
						if ( city_div2 )
							displayRow(city_div2, true);
						city_obj.innerHTML='';
						addOption(city_obj,'wybierz...','',defaul_city); 
						addOption(city_obj,'Kołobrzeg','Kołobrzeg',defaul_city); 
						addOption(city_obj,'Szczecin','Szczecin',defaul_city);
						addOption(city_obj,'Świnoujście','Świnoujście',defaul_city);
						break;
	}

	if ( city_obj.length > 1 )
		displayRow(city_obj, true);
	else
		displayRow(city_obj, false);
	//city_obj.value = default_city;
}