var debugWindow=null;
function debug(_1,_2){
if(debugWindow==null){
return;
}
time="-";
if(_2){
$("debug").innerHTML=time+" "+_1+"<br>"+$("debug").innerHTML;
debugWindow.getContent().scrollTop=0;
}else{
$("debug").innerHTML+=time+" "+_1+"<br>";
debugWindow.getContent().scrollTop=10000;
}
};
function hideDebug(){
if(debugWindow){
debugWindow.destroy();
debugWindow=null;
}
};
function showDebug(_3){
if(debugWindow==null){
debugWindow=new Window("debug_window",{className:"extentech",width:250,height:100,right:4,bottom:42,zIndex:1000,opacity:0.9,showEffect:Element.show,resizable:true,title:"Debug"});
debugWindow.getContent().innerHTML="<style>#debug_window .dialog_content {color:#FFFFFF; font-size:9pt; background:#000;}</style> <div id='debug'></div>";
date=new Date;
date.setMonth(date.getMonth()+3);
}
if(typeof _3=="undefined"||_3){
debugWindow.show();
}
};
function clearDebug(){
if(debugWindow==null){
return;
}
$("debug").innerHTML="";
};
function $E(_4){
var el;
if("string"==typeof _4){
el=document.createTextNode(_4);
}else{
el=document.createElement(_4.tag);
delete (_4.tag);
if("undefined"!=typeof _4.children){
if("string"==typeof _4.children||"undefined"==typeof _4.children.length){
el.appendChild($E(_4.children));
}else{
for(var i=0,_7=null;"undefined"!=typeof (_7=_4.children[i]);i++){
el.appendChild($E(_7));
}
}
delete (_4.children);
}
for(attr in _4){
el[attr]=_4[attr];
}
}
return el;
};
var Debug={inspectOutput:function(_8,_9){
_9=_9||debugWindow.getContent();
if(debugWindow==null){
return;
}
_9.appendChild(_8);
},inspect:function(_a){
var _b=$E({tag:"div",className:"inspector"});
Debug.inspectObj(_a,_b);
debugWindow.getContent().appendChild(_b);
},inspectObj:function(_c,_d){
for(prop in _c){
Debug.inspectOutput(Debug.inspectable(_c,prop),_d);
}
},inspectable:function(_e,_f){
cont=$E({tag:"div",className:"inspectable",children:[_f+" value: "+_e[_f]]});
cont.toInspect=_e[_f];
Event.observe(cont,"click",Debug.inspectClicked,false);
return cont;
},inspectClicked:function(e){
Debug.inspectContained(Event.element(e));
Event.stop(e);
},inspectContained:function(_11){
if(_11.opened){
_11.parentNode.removeChild(_11.opened);
delete (_11.opened);
}else{
sibling=_11.parentNode.insertBefore($E({tag:"div",className:"child"}),_11.nextSibling);
if(_11.toInspect){
Debug.inspectObj(_11.toInspect,sibling);
}
_11.opened=sibling;
}
}};
var inspect=Debug.inspect;
