function Debug(f,b){this.m=function(j,h){for(var i in h){j[i]=h[i]}return j};this.createDataTable=function(j){var i=new Table();i.addRow([this.t("Key"),this.t("Type"),this.t("Value")],true);for(var h in j){i.addRow([this.t(h),this.t(this.getType(j[h])),this.processData(j[h])])}return i.element};this.processData=function(h){if((this.getType(h)=="object"||this.getType(h)=="array")&&b.counter++<b.depth){return this.createDataTable(h)}else{return this.t(h)}};this.getType=function(i){var h=typeof i;if(h==="object"){if(i){if(typeof i.length==="number"&&!(i.propertyIsEnumerable("length"))&&typeof i.splice==="function"){h="array"}}else{h="null"}}return h};this.t=function(h){return document.createTextNode(h)};b=this.m({element:"javascriptDebugPanel","return":false,addStyle:true,height:"500px",depth:1,show:true},b||{});b.counter=0;if(!document.getElementById(b.element)){this.element=document.createElement("div");this.element.id=b.element;var g=document.createElement("p");g.id=b.element+"_header";var a=document.createElement("a");a.onclick=function(){var h=document.getElementById(b.element);if(h.style.height=="20px"){h.style.height=b.height}else{h.style.height="20px"}return false};a.appendChild(this.t("Toggle"));g.appendChild(a);this.element.appendChild(g);document.body.appendChild(this.element);if(b.addStyle){var d="body {\n  padding-bottom: "+b.height+";\n}\ndiv.javascriptDebug {\n  overflow-y: scroll;\n  height: "+b.height+";\n  border-top: 1px solid #666;\n position: fixed;\n  bottom: 0px;\n  left: 0px;\n  background: #efefef;\n  width: 100%;\n}\n\ndiv.javascriptDebug * {\n  font-family: monospace;\n}\n\ndiv.javascriptDebug table {\n  width: 100%;\n  margin: 0 0 10px;\n  border: 1px solid #666;\n  border-collapse: collapse;\n}\n\ndiv.javascriptDebug table th {\n  border: 1px solid #666;\n  font-size: 11px;\n  background: #666;\n  color: #efefef;\n}\n\ndiv.javascriptDebug table td {\n  padding: 5px;\n border: 1px solid #666;\n  font-family: monospace;\n  font-size: 11px;\n  color: #666;\n  background: #efefef;\n}\n\ndiv.javascriptDebug p {\n  margin: 0;\n  padding: 3px;\n  text-align: right;\n}\n\ndiv.javascriptDebug p a {\n  color: #00f;\n  cursor: pointer;\n}\n";var c=document.createElement("style");c.setAttribute("type","text/css");if(c.styleSheet){c.styleSheet.cssText=d}else{c.appendChild(this.t(d))}document.getElementsByTagName("head")[0].appendChild(c)}}else{this.element=document.getElementById(b.element)}this.element.className="javascriptDebug";var e=new Table();e.addRow([this.t("Type"),this.t("Value")],true);e.addRow([this.t(this.getType(f)),this.processData(f)]);if(this.element.style.height=="20px"&&b.show){this.element.style.height=b.height}if(b["return"]){return e}else{this.element.insertBefore(e.element,document.getElementById(b.element+"_header").nextSibling)}}var Table=function(b){this.element=document.createElement("table");this.body=document.createElement("tbody");this.element.appendChild(this.body);if(b){for(var a=0;a<b.length;a++){this.addRow(b[a])}}};Table.prototype.addRow=function(f,h){var d="tr";var g=(h)?"th":"td";var e=document.createElement(d);for(var b=0;b<f.length;b++){var a=document.createElement(g);a.appendChild(f[b]);e.appendChild(a)}this.body.appendChild(e)};