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;

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 zoom(id, w, h){
ab = brname("Zoom");
ab.style.display = "block";
ab.style.top = document.body.scrollTop+"px";
ab = brname("ZoomImage");
ab.style.left = ((document.body.clientWidth - w - 20)/2)+"px";
ab.style.top = (document.body.scrollTop+((document.body.clientHeight - h - 40)/2))+"px";
ab.innerHTML = '<img src="/_show_/files/'+id+'" width="'+w+'" height="'+h+'"><a href="#" onclick="closeZoom(); return false;">закрыть X</a>';
ab.style.display = "block";
document.body.style.overflow = "hidden";
}

function closeZoom(){
ab = brname("Zoom");
ab.style.display = "none";
ab = brname("ZoomImage");
ab.style.display = "none";
document.body.style.overflow = "auto";
}

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);}}
