1 /* Faux Console by Chris Heilmann http://wait-till-i.com */
5 console.d=document.createElement('div');
6 document.body.appendChild(console.d);
7 var a=document.createElement('a');
8 a.href='javascript:console.hide()';
10 console.d.appendChild(a);
11 var a=document.createElement('a');
12 a.href='javascript:console.clear();';
14 console.d.appendChild(a);
16 if(!document.getElementById(id)){
20 var st = document.createElement('style');
24 var cssStr = "div {color:blue;}";
25 var style = document.createElement("style");
26 style.setAttribute("type", "text/css");
28 style.styleSheet.cssText = "\n" +
30 ' position:absolute;' +
34 ' border:1px solid #999;'+
35 ' font-family:courier,monospace;'+
40 'html>body #fauxconsole{'+
46 ' padding-bottom:.5em;'+
51 document.getElementsByTagName("head")[0].appendChild(st);
56 console.d.style.display='none';
59 console.d.style.display='block';
62 console.d.innerHTML+='<br/>'+o;
66 console.d.parentNode.removeChild(console.d);
70 /*Simon Willison rules*/
71 addLoadEvent:function(func){
72 var oldonload=window.onload;
73 if(typeof window.onload!='function'){
76 window.onload=function(){
85 console.addLoadEvent(console.init);