var debugTabString="  ";var cEscapeMap={"\n":"\\n","\t":"\\t","'":"\\''","\b":"\\b","\r":"\\r","\f":"\\f","\\":"\\\\"};var gPendingOutput="";function cEscape(c){var e="";for(var a=0;a<c.length;++a){var b=c.charAt(a);var f=c.charCodeAt(a);var d=cEscapeMap[b];if(d!==undefined){b=d}else{if(f<32){e+=("\\"+f.toString(8))}else{if(f>126){e+=("\\u"+("0000"+f.toString(16)).slice(-4))}else{e+=b}}}}return e}function cUnescape(a){throw Unimplemented}function convertTextForHTML(a){a=a.replace(/&/g,"&amp;");a=a.replace(/</g,"&lt;");a=a.replace(/\n/g,"<br/>");a=a.replace(/ /g,"&nbsp;");return a}function debugPrintDiv(){var b=$("debugDiv");if(b===null){if(document.body!==null){b=$(document.createElement("div"));if(b){var a=document.createElement("div");a.id="debugDivWrapper";b.id="debugDiv";var c=document.createElement("input");c.title="Clear Debug Area";c.value="Clear";c.type="button";c.onclick=debugClear;b.innerHTML=gPendingOutput;a.appendChild(c);a.appendChild(b);document.body.appendChild(a)}}}if(b&&b.initialized!=true){b.setStyle({textAlign:"left",zOrder:0,backgroundColor:"#ffff99",marginTop:"10px",opacity:"1.0",fontFamily:"Courier",fontSize:"10pt",border:"2px solid red"});b.initialized=true}return b}function debugRelocateDiv(){var a=$("debugDiv");if(a!=null){a.parentNode.removeChild(a);document.body.appendChild(a)}}function debugClear(){var a=$("debugDiv");if(a){a.innerHTML=""}}function debugPrintHtml(b){var a=debugPrintDiv();if(a){a.innerHTML=a.innerHTML+b}else{gPendingOutput+=b+"<br/>"}}var debugPrintUsesNSLog=true;function debugPrint(b){if(debugPrintUsesNSLog&&window.console&&window.console.NSLog){window.console.NSLog(b)}else{b=convertTextForHTML(String(b));var a=debugPrintDiv();if(a){a.innerHTML=a.innerHTML+b+"<br/>"}else{gPendingOutput+=b+"<br/>"}}}function Undefined(){}Undefined.prototype.toString=function(){return"undefined"};function asObject(a){if(typeof a=="number"){return Number(a)}if(typeof a=="object"){return a}if(typeof a=="string"){return a}if(typeof a=="boolean"){return Boolean(a)}if(typeof a=="undefined"){return new Undefined()}debugPrint("### didn't wrap value of type "+typeof a);return null}function stringWithFormat(){var b="";for(var c=0;c<arguments.length;++c){var a=asObject(arguments[c]);var d="null";if(a!==null){if(a===undefined){d="<arg "+c+" undefined>"}else{if(a.toString!==undefined){d=a.toString()}else{d="<arg "+c+" does not define toString()>"}}}var e=b.indexOf("%s");if(e>=0){b=b.substr(0,e)+d+b.substr(e+"%s".length)}else{if(c>0){b+=" "}b+=d}}return b}var trace=function(){};function print(){debugPrint(stringWithFormat.apply(this,arguments))}function valueTypeString(a){if(a===null){return"null"}var b=typeof a;if(b=="object"){if(a.constructor==Array){return"Array"}if(a.constructor==Number){return"Number"}if(a.constructor==String){return"String"}return"Object"}return b}function isObject(a){return a&&typeof a=="object"}function isArray(a){return isObject(a)&&a.constructor==Array}function isArrayLike(a){return isObject(a)&&a.constructor===undefined&&a.length!==undefined&&a.item!==undefined}function debugObjectToString(a,g){var h="";if(arguments.length==1){g=arguments[0];a=""}else{a+=" = "}if(g===undefined){h+=stringWithFormat("%s(undefined)\n",a)}else{if(g===null){h+=stringWithFormat("%snull\n",a)}else{if((g.constructor)&&g.constructor==Function){h+=stringWithFormat("%s(function)\n",a)}else{if(isArray(g)){h+=stringWithFormat("%sarray of %s %s [\n",a,g.length,g.length==1?"item":"items");for(var b=0;b<g.length;++b){h+=stringWithFormat("  %s : %s,\n",b,debugValueToString(g[b]))}h+=stringWithFormat("]\n")}else{if(isArrayLike(g)){h+=stringWithFormat("%s'array' of %s %s [\n",a,g.length,g.length==1?"item":"items");for(var b=0;b<g.length;++b){h+=stringWithFormat("  %s : %s,\n",b,debugValueToString(g[b]))}h+=stringWithFormat("]\n")}else{if(isObject(g)){h+=stringWithFormat("%sobject {\n",a);try{var c=0;var d=$H(g).keys().sort();$A(d).each(function(e){c=Math.max(c,e.length)});$A(d).each(function(j){var i=j;attrStr=(i+"                               ").substring(0,c);try{h+=stringWithFormat("  %s : %s\n",attrStr,debugValueToString(g[i]))}catch(k){print(k);print("  !!!attr=",i,"(type is %s)",typeof g[i])}})}catch(f){debugPrintException(f);print("  ## can't enumerate object contents. Might be IE 7.")}h+=stringWithFormat("}\n")}else{h+=stringWithFormat("%s%s(%s)\n",a,valueTypeString(g),debugValueToString(g))}}}}}}return h}function debugPrintObject(a,g){if(arguments.length==1){g=arguments[0];a=""}else{a+=" = "}if(g===undefined){print("%s(undefined)",a)}else{if(g===null){print("%snull",a)}else{if((g.constructor)&&g.constructor==Function){print("%s(function)",a)}else{if(isArray(g)){print("%sarray of %s %s [",a,g.length,g.length==1?"item":"items");for(var b=0;b<g.length;++b){print("  %s : %s,",b,debugValueToString(g[b]))}print("]")}else{if(isArrayLike(g)){print("%s'array' of %s %s [",a,g.length,g.length==1?"item":"items");for(var b=0;b<g.length;++b){print("  %s : %s,",b,debugValueToString(g[b]))}print("]")}else{if(isObject(g)){print("%sobject {",a);try{var c=0;var d=$H(g).keys().sort();$A(d).each(function(e){c=Math.max(c,e.length)});$A(d).each(function(i){var h=i;attrStr=(h+"                               ").substring(0,c);try{print("  %s : %s",attrStr,debugValueToString(g[h]))}catch(j){print(j);print("  !!!attr=",h,"(type is %s)",typeof g[h])}})}catch(f){debugPrintException(f);print("  ## can't enumerate object contents. Might be IE 7.")}print("}")}else{print("%s%s(%s)",a,valueTypeString(g),debugValueToString(g))}}}}}}}var printObject=debugPrintObject;function debugPrintException(b){print("# Exception: %s",b.name);print("# Message  : %s",b.message);if(b.sourceURL){var a=b.sourceURL.match(/[^\/]*$/);if(a!==null){print("# File     : %s, Line:%s",a[0],b.line)}}}function indentHtmlString(a){var b=debugTabString+a;b=b.replace(/<br\/>/g,"<br/>"+debugTabString);return b}function indentString(a){var b=debugTabString+a;b=b.replace(/\n/g,"\n"+debugTabString);return b}function debugValueToString(n,b,k,d,m){var p="";var e=valueTypeString(n);if(arguments.length==1){b=800}if(k===undefined){k=[]}if(d===undefined){d=["this"]}if(m===undefined){m={value:"this"}}if(e=="null"){p="null"}else{if(e=="function"){p="(function)"}else{if(e=="undefined"){p="(undefined)"}else{if(e=="Object"){if(k.length>2){p="..."}else{var j=true;var h=0;var o=$H(n).keys().sort();$A(o).each(function(i){h=Math.max(h,i.length)});var c=k.concat(n);$A(o).each(function(u){var w=b-p.length-2-(u.length+2);var r;var t=n[u];if(typeof t!="function"){if(!j){p=p+", "}j=false;if(typeof t=="object"&&c.contains(t)){var q=$A(c).indexOf(n[u]);r="#cycle("+d[q]+")"}else{if(typeof t=="object"&&m[t]!==undefined){r="#ref("+m[t]+")"}else{try{var y=d[d.length-1]+"."+u;var x=d.concat(y);m[n[u]]=y;r=debugValueToString(n[u],w,c,x,m)}catch(s){r="#exception"}}}var i=p+u+": "+r;if(i.length>b){p+="..."}else{p=i}}})}p="{"+p+"}"}else{if(e=="Array"){var f=n.length;for(var g=0;g<f;++g){if(g!==0){p=p+", "}var l=b-p.length;var a=p+debugValueToString(n[g],l);if(a.length>b){p+="...";break}p=a}p="["+p+"]"}else{if(e=="number"){p=n.toString()}else{if(e=="boolean"){p=n.toString()}else{if(e=="string"){p='"'+n.toString()+'"'}else{p="(UNKNOWN TYPE: "+e+")"}}}}}}}}return p}var gFadeElement;var gFadeDelta=0;var gFadeTimeout=0;function nextFadeStep(){var a=(gFadeElement.style.opacity-0);if(((gFadeDelta>0)&&(a<gFadeTarget))||((gFadeDelta<0)&&(a>gFadeTarget))){var b=gFadeDelta+a;gFadeElement.style.opacity=b;setTimeout(nextFadeStep,gFadeTimeout)}else{gFadeDelta=0}}function startFadeIn(a){if(gFadeDelta===0){setTimeout(nextFadeStep,gFadeTimeout)}gFadeElement=a;gFadeTimeout=20;gFadeTarget=1;gFadeDelta=0.1}function startFadeOut(a){if(gFadeDelta===0){setTimeout(nextFadeStep,gFadeTimeout)}gFadeElement=a;gFadeTimeout=20;gFadeTarget=0;gFadeDelta=-0.1}function onMouseOverDebugMenu(){if(window.event.shiftKey){var a=$("debugMenu");a.setStyle({height:"",width:""});startFadeIn(a)}}function documentResourceURL(b){resourceUrl="";htmlUrl=document.URL;while((htmlUrl.length>0)&&(htmlUrl.slice(-5)!=".html")){htmlUrl=htmlUrl.slice(0,-1)}if(htmlUrl.length>0){var c=htmlUrl.split("/");var a=c.pop();a=a.slice(0,-5);var d=a+"_files";c.push(d);c.push(a+b);resourceUrl=c.join("/")}return resourceUrl}function showCSS(){cssUrl=documentResourceURL(".css");if(cssUrl.length>0){window.open(cssUrl,"CSS")}}function showJavaScript(){cssUrl=documentResourceURL(".js");if(cssUrl.length>0){window.open(cssUrl,"JavaScript")}}function closeDebugMenu(){var a=$("debugMenu");a.setStyle({height:"10px",width:"10px"});startFadeOut(a)}function dumpEntryData(){var b="not defined";try{b=entryData}catch(a){}debugPrintObject(b)}function dumpEntryURLs(){var b="not defined";try{b=entryURLs}catch(a){}debugPrintObject(b)}function jsEvalClick(){try{var text=$("jstext").value;debugPrint(text);eval(text)}catch(e){debugPrint("** Exception **");debugPrintObject(e)}}function scriptNodes(){var b=[];var a=document.body;debugPrint(a.tagName);var e=a.parentNode;debugPrint(e.tagName);var d=$$("head");for(var c=0;c<d.childNodes.length;++c){var f=d.childNodes[c];if(f.nodeName=="SCRIPT"){b.push(f)}}return b}function showAllScripts(){var a=scriptNodes();var b=[];for(var c=0;c<a.length;++c){if(a[c].src!==""){b.push(a[c].src)}}debugPrintHtml("<br/><b>Scripts used on this page:</b><br/>");for(c=0;c<b.length;++c){url=b[c];var d='<a href="%url%" target="code">%url%</a><br/>';d=d.replace(/%url%/g,url);debugPrintHtml(d)}}var gVariables={};var gVariableCount=0;var gRenderItemCount=0;var gRootVariables=[];function addInspectorVariable(a){gRootVariables.push(a);renderInspector()}function inspect(a){addInspectorVariable(a)}function getVariableId(b){for(v in gVariables){if(gVariables[v].object===b){return v}}var a="vid"+gVariableCount++;record={};record.object=b;record.id=a;record.open=false;record.showFunctions=false;gVariables[a]=record;return a}function clickItem(a){gVariables[a].open=!gVariables[a].open;renderInspector()}function toggleFuncs(a){gVariables[a].showFunctions=!gVariables[a].showFunctions;renderInspector()}function clickDelete(a){for(var b in gRootVariables){if(gRootVariables[b]==a){gRootVariables.splice(b,1);renderInspector();return}}}function makeControlSpan(a,e,b,d,f){var c=document.createElement("span");c.setAttribute("onclick",e+"('"+a+"');");c.innerText=b?d:f;return c}function renderInspectorItem(b,l,j,g){gRenderItemCount++;var a=$(document.createElement("div"));a.setStyle({left:"30px",position:"relative"});var k=document.createElement("span");var m=" "+b+" = ";var i;if(typeof l=="object"){if(l.constructor==Array){m+="array["+l.length+"] "+debugValueToString(l)}else{m+="object "+debugValueToString(l)}i=getVariableId(l);k=makeControlSpan(i,"clickItem",gVariables[i].open,"-","+")}else{k.innerText="-";m+=debugValueToString(l)}var d=document.createTextNode(m);a.appendChild(k);a.appendChild(d);var c=null;if(gRootVariables.contains(b)){c=makeControlSpan(b,"clickDelete",true,"[X]","[X]");a.appendChild(c)}if(typeof l=="object"){if((gVariables[i].open)&&!g.contains(l)){var f=makeControlSpan(i,"toggleFuncs",gVariables[i].showFunctions,"[F]","[f]");a.insertBefore(f,c);try{$H(l).keys().sort().each(function(e){if((typeof l[e]!="function")||(gVariables[i].showFunctions)){renderInspectorItem(e,l[e],a,g.concat(l[e]))}})}catch(h){}}}j.appendChild(a)}function renderInspector(){gRenderItemCount=0;var inspectorDiv=$("inspect");if(inspectorDiv===null){inspectorDiv=$(document.createElement("div"));inspectorDiv.id="inspect";inspectorDiv.setStyle({backgroundColor:"#d8d8d8",fontFamily:"Courier",fontSize:"10pt"});document.body.appendChild(inspectorDiv)}while(inspectorDiv.childNodes.length>0){inspectorDiv.removeChild(inspectorDiv.childNodes[0])}var emptyArray=[];for(var index in gRootVariables){if(emptyArray[index]===undefined){var thing=eval(gRootVariables[index]);renderInspectorItem(gRootVariables[index],eval(gRootVariables[index]),inspectorDiv,[])}}}function evalOnKeyUp(a){if(a.keyIdentifier=="Enter"){jsEvalClick()}}function iWebDebugPanelInit(){var headerLayer=document.body;var debugMenu=$(document.createElement("div"));debugMenu.id="debugMenu";debugMenu.setStyle({backgroundColor:"#ffff99",position:"fixed",left:0,top:0,width:"10px",height:"10px",padding:"10px",opacity:0,fontFamily:"Lucida Grande",fontSize:"10px",zIndex:100,overflow:"hidden",border:"1px solid black"});debugMenu.onmouseover=onMouseOverDebugMenu;headerLayer.appendChild(debugMenu);var myCommentsVersion="not defined";try{myCommentsVersion=commentJavascriptVersion}catch(e){}debugMenu.innerHTML="<b><u>JavaScript Debug Options</u></b><div style='float:right'><a href='#' onclick='closeDebugMenu();'>Close</a></div><br/><br/><a href='#' onclick='showCSS();'>Show Page CSS</a><br/><a href='#' onclick='showJavaScript();'>Show Page JavaScript</a><br/><a href='#' onclick='showAllScripts();'>List all scripts</a><br/><br/><a href='#' onclick='dumpEntryData();'>Show comment entryData</a><br/><a href='#' onclick='dumpEntryURLs();'>Show comment summaryData</a><br/><a href='#' onclick='debugClear();'>Clear debug output</a><br/><br/><textarea id='jstext' cols='40' rows='4'/>inspect(window);</textarea><br/><br/><hr/>Comment js version: "+myCommentsVersion;var textArea=$("jstext");if(textArea){textArea.onkeyup=function(e){if(e.keyIdentifier=="Enter"){try{var text=$("jstext").value;debugPrintHtml(text.bold()+"<br/>");eval(text)}catch(e){debugPrint("** Exception **");debugPrintObject(e)}if(textArea.setSelectionRange){textArea.setSelectionRange(0,textArea.value.length)}e.cancelBubble=true}}}renderInspector()};