var req;
function loadXMLDoc(key,file,loc,tmp) {
var url=file+"?"+key;
if (tmp) {getObject(loc).innerHTML = '<div style="margin: 10px;"><img style="vertical-align:middle" src="images/loading.gif">&nbsp;Czekaj...</div>';}
try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e) {
try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
catch(oc) { req = null; }
}
if (!req && typeof XMLHttpRequest != "undefined") { req = new XMLHttpRequest(); }
  if (req != null) {
    req.onreadystatechange=function(){if(req.readyState!=4)return;if(req.status==200){getObject(loc).innerHTML = req.responseText}};
    req.open("GET", url, true);
    req.send(null);
  }
}

//var bestsellers_product_img_load = '';
//for(i=0; i < bestsellers_product_link.length; i++) { bestsellers_product_img_load += bestsellers_product_img[i]; }

//document.write('<div style="display: none">' + bestsellers_product_img_load + '</div>');


function bestsellers_product(id) {

//for(i=0; i < bestsellers_product_link.length; i++) {
//document.getElementById('bestsellers_box_' + i).className = 'bestsellers_box';
//}

//document.getElementById('bestsellers_box_s').style.top = bestsellers_over_s[id];
//document.getElementById('bestsellers_box_' + id).className = 'bestsellers_box_over';
//document.getElementById('bestsellers_box_image').innerHTML = '<a href="' + bestsellers_product_link[id] + '">' + //bestsellers_product_img[id] + '</a>';

}

document.write('<div style="display: none"><div class="chmurka"><b><i></i><div></div></b></div></div>');

function chmurka(e,v){
  if(v.title){
    var t=document.createElement("div");
    t.className="chmurka";
    t.style.cursor="hand;"
    titl=v.title;
    s=v.title;
    t.innerHTML="<b><i>"+s+"</i><div></div></b>";
    v.title="";
    v.move=function(e){
      t.style.cursor="hand;"
      e=e||event;
      t.style.left=e.clientX+document.body.scrollLeft+-20+"px";
      t.style.top=e.clientY+25+document.body.scrollTop+"px";
    }
    v.move(e);
    document.body.appendChild(t);
    v.onmousemove=function(e){v.move(e);}
    v.onmouseout=function(e){
      s=t.innerHTML;
      document.body.removeChild(t);
      v.title=titl;
    }
}
}

function more_box_menu(id) {

for(i=1; i < 6; i++) {
document.getElementById('more_box_menu_'+i).style.backgroundPosition = 'top left';
document.getElementById('more_box_desc_'+i).style.display = 'none';
}

document.getElementById('more_box_menu_'+id).style.backgroundPosition = 'top right';
document.getElementById('more_box_desc_'+id).style.display = 'block';

}

function more_box_menu2(id) {
for(i=1; i < 6; i++) {
if (document.getElementById('more_box_menu_'+i)) {
       document.getElementById('more_box_menu_'+i).style.backgroundPosition = 'top left';
}
if (document.getElementById('more_box_desc_'+i)) {
       document.getElementById('more_box_desc_'+i).style.display = 'none';
}
}

if (document.getElementById('more_box_menu_'+id)) {
       document.getElementById('more_box_menu_'+id).style.backgroundPosition = 'top right';
}
if (document.getElementById('more_box_desc_'+id)) {
       document.getElementById('more_box_desc_'+id).style.display = 'block';
}

}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)          //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)         //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)       // IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}
