isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && ((navigator.userAgent.indexOf('Netscape')!=-1) || (navigator.userAgent.indexOf('Mozilla')!=-1) || (navigator.userAgent.indexOf('Firefox')!=-1))?true:false;

var lang = "ru", LAr = new Array();
LAr["fr"] = "passer au panier";
LAr["ru"] = "перейти в корзину";
LAr["en"] = "view shopping basket";

function echo_Param(formObj, step){
var result, tab = "";
for (var i in formObj) {result += "." + i + " = " + formObj[i] + " | ";}
return result;}

function dr_tree(obj, limit, step){
var result = "";
for(i = 0; i < obj.length; i++){
result += obj.childNodes[i].nodeName+"<br>";
if(limit > step+1 && obj.childNodes[i].length > 0){
result += dr_tree(obj.childNodes[i], limit, step+1);
}}
return result;}

function brname(Xname){
if(IE4plus){return top.document.all[Xname];}
else if(NS4){return top.document[Xname];}
else if(NS6){return top.document.getElementById(Xname);}}

function init(){
lang = (top.location.pathname.substr(1, 2) == "fr" || top.location.pathname.substr(1, 2) == "en") ? top.location.pathname.substr(1, 2) : "ru";
ab = brname("All");
if(document.body.scrollWidth <= 1000){
ab.style.width = 1000;
}else{
ab.style.width = document.body.scrollWidth;
}
ac = (IE4plus) ? ab.childNodes[0].childNodes[0].childNodes : ab.childNodes[1].childNodes[0].childNodes;
var z = 0;
var step = (document.body.scrollWidth-750)/2;
for(i=0; i<ac.length; i++){
if(ac[i].nodeName == "TD"){
if(z == 0){ac[i].style.width = step+500;}else if(z == 1){ac[i].style.width = 26;}else if(z == 2){ac[i].style.width = step+224;}
z++;
}}
ab = brname("TopL");
ab.style.width = step+500;
}

function _basket_add(id, cost){
lang = (top.location.pathname.substr(1, 2) == "fr" || top.location.pathname.substr(1, 2) == "en") ? top.location.pathname.substr(1, 2) : "ru";
_req.sendGET("/hide/basket/send/"+id+"/");
var ab = brname("id"+id);
var ac = brname("bGoods");
var ad = brname("bCost");
ArGoods++;
ArCost += cost;
//ab.class = "LinkBuy";
ab.innerHTML = LAr[lang];
ab.href = '/'+lang+'/basket/';
ab.onclick = "";
ac.innerHTML = ArGoods;
ad.innerHTML = ArCost;
}

onload = init;
onresize = init;