//\/////
//\  coolTip Debug Plugin
//\  This file requires coolTip 1.00 or later.
//\  Modified June 9, 2005
//\
//\  You may not remove or change this notice.
//\  Copyright Robert E Boughner 2005. All rights reserved.
//\  
//\  This plugin is governed by the same restrictions set forth
//\  in the prologue to cCore.js.
//\/////
//\  THIS IS A VERY MODIFIED VERSION. DO NOT EDIT OR PUBLISH. GET THE ORIGINAL!
if(typeof cInfo==cUdf||!cInfo.meets(1.00))alert('coolTip 1.00 or later is required for the Debug Plugin.');else{registerCommands('allowdebug');var cZindex;
function parseDebugExtras(pf,i,ar){var k=i,v;if(k<ar.length){if(ar[k]==ALLOWDEBUG){v=ar[k+1];if(typeof v=='string'){v=ar[++k];if(pf!='cd_')setCanShowParm(v);} return k;}}
return-1;}
function showProperties(){var args=arguments,isXml,sho,shoObj,vis,lvl=0,istrt=0,theDiv='showProps',txt='';if(args.length){if(args.length % 2&&typeof args[0]=='string'){istrt=1;theDiv=args[0];}
sho=createDivContainer(theDiv);if(cNs4){shoObj=sho;txt+='<table cellpadding="1" cellspacing="0" border="0" bgcolor="#000000"><tr><td>';}else{with(sho.style){backgroundColor='#ffffcc';padding='5px';border='1px #000000 solid';}
shoObj=sho.style;}
lvl=getLayerLevel(theDiv);if(typeof sho.position==cUdf){sho.position=new Pagelocation(10+lvl*20,10,1);if(typeof cZindex==cUdf)cZindex=getDivZindex();shoObj.zIndex=cZindex+1+lvl;}
txt+='<table cellpadding="5" border="0" cellspacing="0"'+(cNs4?' bgcolor="#ffffcc"':'')+'>';txt+='<tr><td><strong><A HREF="javascript:moveToBack(\''+theDiv+'\');" title="Move to back">'+theDiv+'</A></strong></td><td align="RIGHT"><strong><a href="javascript:closeLayer(\''+theDiv+'\');" TITLE="Close Layer'+(!cNs4?'" style="background-color: #CCCCCC;border:2px #333369 outset;padding: 2px;':'')+'">X</a></strong></td></tr>';txt+='<tr><td style="text-decoration: underline;"><strong>Item</strong></td><td style="text-decoration: underline;"><strong>Value</strong></td></tr>';for(var i=istrt;i<args.length-1;i++)
txt+='<tr><td align="right"><strong>'+args[i]+':&nbsp;</strong></td><td>'+args[++i]+'</td></tr>';txt+='</table>'+(cNs4?'</td></tr></table>':'');if(cNs4){sho.document.open();sho.document.write(txt);sho.document.close();}else{isXml=isXmlCode(txt,sho);if(!isXml){if(cIe5&&isMac)sho.innerHTML='';sho.innerHTML=txt;}}
showAllVisibleLayers();}}
function getLayerLevel(lyr){var i=0;if(typeof document.debugIDs==cUdf){document.debugIDs=new Array(lyr);}else{var l=document.debugIDs;for(i=0;i<l.length;i++)if(lyr==l[i])break;if(i==l.length)l[l.length++]=lyr;}
return i;}
function getDivZindex(id){id=(id||'ctDiv');var obj;obj=(fetchObjectLyr(id)||createDivContainer(id));obj=(cNs4?obj:obj.style);return obj.zIndex;}
function setCanShowParm(debugID){var lyr,pLyr;if(typeof debugID=='string'){pLyr=debugID.split(',');for(var i=0;i<pLyr.length;i++){lyr=fetchObjectLyr(pLyr[i]);if(lyr!=null&&typeof lyr.position!=cUdf)lyr.position.canShow=1;}}}
function Pagelocation(x,y,canShow){this.x=x;this.y=y;this.canShow=(canShow==null)?0:canShow;}
function showAllVisibleLayers(){var lyr,lyrObj,l=document.debugIDs;for(var i=0;i<l.length;i++){lyr=fetchObjectLyr(l[i]);lyrObj=(cNs4?lyr:lyr.style);if(lyr.position.canShow){positionLayer(lyrObj,lyr.position.x,lyr.position.y);lyrObj.visibility='visible';}}}
function positionLayer(Obj,x,y){Obj.left=x+(cIe4?eval(docRoot+'.scrollLeft'):window.pageXOffset)+(cNs4?0:'px');Obj.top=y+(cIe4?eval(docRoot+'.scrollTop'):window.pageYOffset)+(cNs4?0:'px');}
function closeLayer(lyrID){var lyr=fetchObjectLyr(lyrID);lyr.position.canShow=0;lyr=(cNs4?lyr:lyr.style);lyr.visibility='hidden';}
function moveToBack(layer){var l=document.debugIDs,lyr,obj,i,x=10,y=10,dx=20,z=cZindex+1;if(l.length>1){lyr=fetchObjectLyr(layer);lyr.position.x=x;lyr.position.y=y;obj=(cNs4?lyr:lyr.style);obj.zIndex=z;for(i=0;i<l.length;i++){if(layer==l[i])continue;lyr=fetchObjectLyr(l[i]);if(lyr.position.canShow==0)continue;obj=(cNs4?lyr:lyr.style);obj.zIndex+=1;lyr.position.x+=dx;lyr.position.y=y;}
showAllVisibleLayers();}}
function rawTxt(txt){if(typeof txt=='string')return txt.replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");}
function isXmlCode(txt,obj){if(!(cNs4||cIe4)){var h=cFrame.document.documentElement,hA;if(h)hA=h.getAttribute('xmlns');if(cTip&&typeof cTip.pop.xml!=cUdf||(h&&hA&&hA.indexOf('http://www.w3.org/1999/xhtml')!=-1)){if(typeof setPluginXmlCode!=cUdf)setPluginXmlCode(txt,obj,4);return true;}}
return false;}
registerCmdLineFunction(parseDebugExtras);
}
