function GE(name){
	if(document.getElementById(name)){
		obj=document.getElementById(name);
		return(obj);
	}
	else{
		return(false);
	}
}
function evalScript(src){
   var script = document.createElement("SCRIPT");
   script.type = "text/javascript";
   script.src = src;
   head = document.getElementsByTagName("HEAD")[0];
   head.appendChild(script);
}
function ppp(src,w,h,scrolling){
   if(!w){w=600;}
   if(!h){h=500;}
   if(!scrolling){scrolling=0;}
   if(!ppp.opened){
      window.open(src,'ppp','location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,scrollbars='+scrolling+',width='+w+',height='+h);
   }
}
function BC(imgname,imgsrc){GE(imgname).src=imgsrc;}

function eT(td){
	r = document.getElementById('tr'+td);
	var d,s;
	var img	= document.getElementById('img'+td);
	if (r.style.display == ''){d='none';s=img.src="/pics/tree_plus.gif";}
	else {d='';s=img.src="/pics/tree_minus.gif";}
	r.style.display=d;
	img.src	= s;
	return true;
}

function ffPos(o){
 var curleft=curtop=0;
 if(o.offsetParent){do{curleft+=o.offsetLeft;curtop+=o.offsetTop;}while (o=o.offsetParent);}
 return [curleft,curtop];
}

function hError(msg,url,l){
var txt="ffCMS: Поймана ошибка выполнения сценария:\n";
txt+="Сообщение: " + msg + "\n";
txt+="Адрес ошибки: " + url + "\n";
txt+="Линия: " + l + "\n";
alert(txt);
//if(!document.getElementById('javascriptErrorConsole')){
	//var errorDiv=document.createElement("div");errorDiv.setAttribute("id","javascriptErrorConsole");errorDiv.setAttribute("style","position:absolute;display:block;right:1px;bottom:1px;width:30%;height:150px;text-overflow:scroll;opacity:.3;filter:alpha(opacity=30);border:solid black 1px;background-color:grey;z-index:1001;font-family:verdana;font-size:9px;padding:5px;");
//document.getElementById('ffcmsDocumentBody').appendChild(errorDiv);
//}
//ed=document.getElementById('javascriptErrorConsole');
//ed.innerHTML='<p style="font-family:verdana;font-size:9px;color:red;">ОШИБКА СЦЕНАРИЯ:<br />'+txt+'</p>'+ed.innerHTML;
//window.setTimeout("document.getElementById('javascriptErrorConsole').style.display='';", 5000);
return true;
}
window.onerror = hError;
