//\/////
//\  coolTip XML Plugin
//\  This file requires coolTip 1.40 or later.
//\  Modified November 9, 2005, November 13, 2006
//\
//\  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.40))alert('coolTip 1.40 or later is required for XML Plugin.');else{registerCommands('xml');var XCORE=1;
setDefaultVariables('xml|0');
function setXMLVariables(obj){obj.xml=cd_xml;}
function parseXMLExtras(pf,i,ar){var k=i;if(k<ar.length){if(ar[k]==XML){eval(pf+'xml=('+pf+'xml==1)?0:1');return k;}}
return-1;}
function createXmlCode(txt,pNode){var d=cFrame.document,len=txt.length,node1=null,tagRe=/<[a-z]+[0-9]?/i,fN,tN,oTag,jE,j,l,k,Txt;var tgBeg,tgEnd,tgBegRe,tgEndRe;do {fN=txt.match(tagRe);if(fN){l=txt.indexOf(fN);if(!l){tN=fN[0].substring(1);node1=d.createElement(tN);k=txt.indexOf('>');oTag=txt.substring(0,k+1);node1=addAttributeValues(oTag,node1);if(!/textarea|colgroup|frameset/i.test(tN)&&/area|base|br|col|frame|hr|img|input|isindex|link|meta|param/i.test(tN))txt=txt.substring(k+1);else{jE=2;tgBegRe='/'+fN[0]+'/ig';tgBegRe=eval(tgBegRe);tgEndRe='/<\\/'+tN+'/ig';tgEndRe=eval(tgEndRe);do {jE=txt.indexOf('</'+tN,jE);jE+=(tN.length+3);Txt=txt.substring(0,jE);tgBeg=Txt.match(tgBegRe);tgEnd=Txt.match(tgEndRe);} while(tgBeg.length!=tgEnd.length);Txt=txt.substring(k+1,jE-(tN.length+3));txt=txt.substring(jE);if(Txt)node1=createXmlCode(Txt,node1);}
}else if(txt){node1=getText(txt.substring(0,l),d);txt=txt.substring(l);}
}else{node1=getText(txt,d);txt='';}
if(node1)pNode.appendChild(node1);len=txt.length;} while(len);return pNode;}
function conditionText(txt){return txt.replace(/&nbsp;/g,' ').replace(/&qout;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&lt;/g,'<').replace(/&gt;/g,'>');}
function getText(txt,d){d=(d||cFrame.document);return d.createTextNode(txt);}
function addAttributeValues(open_tag,node){var aN,aV,l,fM,attrRe=/[a-z]+\s?=\s?("[^"]+?"|'[^']+?')/ig;fM=open_tag.match(attrRe);if(fM){for(var i=0;i<fM.length;i++){if((l=fM[i].indexOf('='))!=-1){aN=fM[i].substring(0,l);aV=fM[i].substring(l+1)
aV=aV.replace(/^\s*("|')/,'').replace(/("|')\s*$/,'');if(aV)node.setAttribute(aN,aV);}}}
return node;}
function checkXml(pf,args){if(!(cNs4||cIe4)){var h=cFrame.document.documentElement,hA;if(h)hA=h.getAttribute('xmlns');if(cTip&&cTip.pop.xml||(h&&hA&&hA.indexOf('http://www.w3.org/1999/xhtml')!=-1)){cTip.pop.xml=1;runHook('setDoXml',FCHAIN);}}
return true;}
function resetXml(obj){if(!(cNs4||cIe4))runHook('cleanUpXml',FCHAIN,obj);}
function setDoXml_core(){with(cTip.pop){if(xml){doXml|=XCORE;}}
return void(0);}
function cleanUpXml_core(obj){with(obj.pop){if(doXml&&!(cNs4||cIe4)){if(doXml&XCORE)doXml^=XCORE;}}
return void(0);}
function removeChildren(pNode){while(pNode.hasChildNodes()){pNode.removeChild(pNode.lastChild);}}
function resetNodeContents(txt,parentnode){if(txt){removeChildren(parentnode);if(/&nbsp;|</.test(txt))txt=conditionText(txt);txt=wellFormed(txt);parentnode=createXmlCode(txt,parentnode);}
return parentnode;}
function wellFormed(txt){var tgBeg,tgEnd,fB,fE,tN,bgTags,endTags,tagRe=/<[a-z]+[0-9]?/g,tagEndRe=/<\/[a-z]+[0-9]?/g;var badTxt="<strong>Not well-formed input!</strong>";fB=txt.match(tagRe);fE=txt.match(tagEndRe);if(fB){bgTags=fB.length;endTags=(fE)?fE.length:0;for(var i=0;i<fB.length;i++){tN=fB[i].substring(1);if(!/textarea|colgroup|frameset/i.test(tN)&&/area|base|br|col|frame|hr|img|input|isindex|link|meta|param/i.test(tN))bgTags--;}
return(bgTags==endTags)?txt:badTxt;}else if(fE)return badTxt;}
function setPluginXmlCode(txt,pNode,bType){pNode=(pNode||cTip),bType=(bType||0);var i,nN,nodes=new Array();for(i=0;i<pNode.childNodes.length;i++)nodes[i]=pNode.childNodes[i];pNode=resetNodeContents(txt,pNode);if(bType<4){switch(bType){case 1:
if(!/roundcorners|quotation/.test(cTip.pop.bubbletype))nN=pNode.getElementsByTagName('div')[1];else nN=pNode.getElementsByTagName('table')[0].getElementsByTagName('td')[4];break;case 2:
nN=pNode.getElementsByTagName('div')[0];break;case 3:
for(i=0;i<pNode.childNodes.length;i++){if(pNode.childNodes[i].id!='ptrContent')continue;nN=pNode.childNodes[i];break;}
break;default:
nN=pNode.childNodes[1];}
for(i=0;i<nodes.length;i++)nN=nN.appendChild(nodes[i]);}}
registerRunTimeFunction(setXMLVariables);registerCmdLineFunction(parseXMLExtras);registerPostParseFunction(checkXml);registerHook("hideObject",resetXml,FBEFORE);registerHook("cleanUpXml",cleanUpXml_core,FCHAIN);registerHook("setDoXml",setDoXml_core,FCHAIN);if(cInfo.meets(1.40))registerNoParameterCommands('xml');}
