var calcWidth=640;function protStart(){protTabStart()}function calcTabRow(a,b){var d=document.createElement("div");d.className="calc-tab-row";d.style.left=a+px;d.style.zIndex=5+b;d.id="divCR_"+b;document.body.appendChild(d);return d}function protTabStart(){if(BrowserDetect.browser=="Konqueror"){return}var x,t,E;E=Y.util.Dom.getRegion(document.body);var q=(E.right-E.left-290-160-20);if(q<300){q=300}else{if(q>640){q=640}}calcWidth=q;if(!(x=document.getElementById("divCalcTabs"))){return}var j=document.createElement("div");j.id="divCalcTabContainer";x.parentNode.replaceChild(j,x);if(!(oD=document.getElementById("divCalcSp"))){return}t=Y.util.Dom.getRegion(oD);var z=t.bottom;var m=t.left;var v=[];var s=[];var p=[];var G;for(var J=0;J<x.childNodes.length;J++){if(x.childNodes[J].nodeType==3){continue}v.push(x.childNodes[J].innerHTML.replace("&nbsp;"," "));p.push(x.childNodes[J].href)}var I=0;var F,C;t=Y.util.Dom.getRegion(j);F=t.left;C=t.top;var M,L,f;s.push(calcTabRow(m,s.length));var u;var l,i;var y=0;while(G=v.shift()){l=document.createElement("span");l.className="calc-tab";l.innerHTML=G.replace(" ","&nbsp;");l.id="sCT_"+y;oH=document.createComment(p.shift().replace("about:blank",""));Event.addListener(l,"click",protTabClick);if(s[s.length-1].childNodes.length>0){i=document.createElement("span");i.className="calc-tab-space";i.innerHTML="&nbsp;";s[s.length-1].appendChild(i)}l.appendChild(oH);s[s.length-1].appendChild(l);t=Y.util.Dom.getRegion(s[s.length-1]);var n=t.right-t.left;if(n>calcWidth){var K=s[s.length-1].lastChild;s[s.length-1].removeChild(s[s.length-1].lastChild);s[s.length-1].removeChild(s[s.length-1].lastChild);t=Y.util.Dom.getRegion(s[s.length-1]);M=t.left;L=t.top;f=t.bottom-t.top;s.push(calcTabRow(m,s.length));s[s.length-1].style.top=L+f+px;if(isie6){M-=1}M=m;s[s.length-1].style.left=M+px;s[s.length-1].appendChild(K)}y++}tabRowsZ=s.length;t=Y.util.Dom.getRegion(s[s.length-1]);var B=t.bottom-t.top;var p=[];t=Y.util.Dom.getRegion(s[s.length-1].firstChild);B=2;var b=[];for(J=s.length-1;J>-1;J--){for(E=0;E<s[J].childNodes.length;E++){s[J].childNodes[E].style.paddingBottom=B+px}t=Y.util.Dom.getRegion(s[J].firstChild);b[J]=t.top;s[J].style.height=B+30+px;B=(t.bottom-t.top-((isie6)?-1:2))}var a=b[0];for(J=0;J<b.length;J++){s[J].style.top=z+b[J]-a+px}if(typeof pg=="number"){protTabSet(pg)}t=Y.util.Dom.getRegion(s[s.length-1]);x=document.getElementById("divCalc");x.style.paddingTop=t.bottom-z+15+px}function protTabRow(a,b){var d=document.createElement("div");d.className="calc-tab-row";d.style.left=a+px;d.style.zIndex=5+b;d.id="divCR_"+b;document.body.appendChild(d);return d}function protTabSet(g){var e,f,d,b,a;if(!(e=document.getElementById("sCT_"+g))){return}b=parseInt(e.parentNode.id.split("_")[1]);if((b+1)<tabRowsZ){protFlipRows(g)}d=document.getElementsByTagName("span");for(f=0;f<d.length;f++){if(d[f].id.match(/^sCT/)){d[f].className="calc-tab"}}e.className="calc-tab-selected"}function protTabClick(a){a=EventUtil.getEvent();go(a.target.lastChild.nodeValue.replace("about:/",""))}function protFlipRows(f){var d;if(!(d=document.getElementById("sCT_"+f))){return}var i,h,g,e,q,p,b,a,m,l;o1=d.parentNode;o2=document.getElementById("divCR_"+(tabRowsZ-1));i=o1.id;h=o2.id;g=Y.util.Dom.getRegion(o1.firstChild);e=Y.util.Dom.getRegion(o2.firstChild);h1=parseInt(getStyle(o1.firstChild,"paddingBottom"));h2=parseInt(getStyle(o2.firstChild,"paddingBottom"));m=o1.style.zIndex;l=o2.style.zIndex;b=o1.innerHTML;a=o2.innerHTML;var k=(isie6)?-2:1;o1.style.top=e.top+k+px;o2.style.top=g.top+k+px;o1.id="_X";o2.id=i;o1.id=h;for(c=0;c<o1.childNodes.length;c++){o1.childNodes[c].style.paddingBottom=2+px}for(c=0;c<o2.childNodes.length;c++){o2.childNodes[c].style.paddingBottom=h1+px}o1.style.zIndex=l;o2.style.zIndex=m;g=Y.util.Dom.getRegion(o1.firstChild);e=Y.util.Dom.getRegion(o2.firstChild);o1.style.height=g.bottom-g.top+px;o2.style.height=e.bottom-e.top+px}function cti(b){b=EventUtil.getEvent();var g=b.target;var e=g;var f=1;while(e=e.nextSibling){e.style.backgroundColor="#ccc";f++}g.style.backgroundColor="#ff207e";g.style.color="#fff";e=g;while(e=e.previousSibling){if(e.tagName.toLowerCase()!="td"){break}e.style.backgroundColor="#ccc"}var d=g.parentNode;e=d;var a=d.childNodes.length-f;var i=0;var a=f;var h=d.childNodes.length;while(e=e.previousSibling){a=e.childNodes.length-f;e.childNodes[a].style.backgroundColor="#ccc"}e=d;while(e=e.nextSibling){a=e.childNodes.length-f;e.childNodes[a].style.backgroundColor="#ccc"}}function cto(b){b=EventUtil.getEvent();var g=b.target;var e=g;var f=1;while(e=e.nextSibling){e.style.backgroundColor="#fff";f++}g.style.backgroundColor="#fff";g.style.color="#000";e=g;while(e=e.previousSibling){if(e.tagName.toLowerCase()!="td"){break}e.style.backgroundColor="#fff"}var d=g.parentNode;e=d;var a=d.childNodes.length-f;var i=0;var a=f;var h=d.childNodes.length;while(e=e.previousSibling){a=e.childNodes.length-f;e.childNodes[a].style.backgroundColor="#fff"}e=d;while(e=e.nextSibling){a=e.childNodes.length-f;e.childNodes[a].style.backgroundColor="#fff"}};
