var niftyOk=(document.getElementById&&document.createElement&&Array.prototype.push);var niftyCss=false;String.prototype.find=function(a){return(this.indexOf(a)>=0?true:false)};var oldonload=window.onload;if(typeof(NiftyLoad)!="function"){NiftyLoad=function(){}}if(typeof(oldonload)=="function"){window.onload=function(){oldonload();AddCss();NiftyLoad()}}else{window.onload=function(){AddCss();NiftyLoad()}}function AddCss(){niftyCss=true;var a=CreateEl("link");a.setAttribute("type","text/css");a.setAttribute("rel","stylesheet");a.setAttribute("href","/CSS/niftyCorners.css");a.setAttribute("media","screen");document.getElementsByTagName("head")[0].appendChild(a)}function Nifty(a,c){if(niftyOk==false){return}if(niftyCss==false){AddCss()}var d,b=a.split(","),e=0;if(c==null){c=""}if(c.find("fixed-height")){e=getElementsBySelector(b[0])[0].offsetHeight}for(d=0;d<b.length;d++){Rounded(b[d],c)}if(c.find("height")){SameHeight(a,e)}}function Rounded(a,d){var e,f="",c="",b=new Array();if(d!=""){d=d.replace("left","tl bl");d=d.replace("right","tr br");d=d.replace("top","tr tl");d=d.replace("bottom","br bl");d=d.replace("transparent","alias");if(d.find("tl")){f="both";if(!d.find("tr")){f="left"}}else{if(d.find("tr")){f="right"}}if(d.find("bl")){c="both";if(!d.find("br")){c="left"}}else{if(d.find("br")){c="right"}}}if(f==""&&c==""&&!d.find("none")){f="both";c="both"}b=getElementsBySelector(a);for(e=0;e<b.length;e++){FixIE(b[e]);if(f!=""){AddTop(b[e],f,d)}if(c!=""){AddBottom(b[e],c,d)}}}function AddTop(c,l,m){var k=CreateEl("b"),e=4,h="",a,j,b="r",f,g;k.style.marginLeft="-"+getPadding(c,"Left")+"px";k.style.marginRight="-"+getPadding(c,"Right")+"px";if(m.find("alias")||(g=getBk(c))=="transparent"){g="transparent";f="transparent";h=getParentBk(c);b="t"}else{f=getParentBk(c);h=Mix(g,f)}k.style.background=f;k.className="niftycorners";a=getPadding(c,"Top");if(m.find("small")){k.style.marginBottom=(a-2)+"px";b+="s";e=2}else{if(m.find("big")){k.style.marginBottom=(a-10)+"px";b+="b";e=8}else{k.style.marginBottom=(a-5)+"px"}}for(j=1;j<=e;j++){k.appendChild(CreateStrip(j,l,g,h,b))}c.style.paddingTop="0";c.insertBefore(k,c.firstChild)}function AddBottom(c,l,m){var k=CreateEl("b"),e=4,h="",a,j,b="r",f,g;k.style.marginLeft="-"+getPadding(c,"Left")+"px";k.style.marginRight="-"+getPadding(c,"Right")+"px";if(m.find("alias")||(g=getBk(c))=="transparent"){g="transparent";f="transparent";h=getParentBk(c);b="t"}else{f=getParentBk(c);h=Mix(g,f)}k.style.background=f;k.className="niftycorners";a=getPadding(c,"Bottom");if(m.find("small")){k.style.marginTop=(a-2)+"px";b+="s";e=2}else{if(m.find("big")){k.style.marginTop=(a-10)+"px";b+="b";e=8}else{k.style.marginTop=(a-5)+"px"}}for(j=e;j>0;j--){k.appendChild(CreateStrip(j,l,g,h,b))}c.style.paddingBottom=0;c.appendChild(k)}function CreateStrip(d,e,b,c,f){var a=CreateEl("b");a.className=f+d;a.style.backgroundColor=b;a.style.borderColor=c;if(e=="left"){a.style.borderRightWidth="0";a.style.marginRight="0"}else{if(e=="right"){a.style.borderLeftWidth="0";a.style.marginLeft="0"}}return(a)}function CreateEl(a){return(document.createElement(a))}function FixIE(a){if(a.currentStyle!=null&&a.currentStyle.hasLayout!=null&&a.currentStyle.hasLayout==false){a.style.display="inline-block"}}function SameHeight(a,d){var g,b=a.split(","),f,c,e=[],h;for(g=0;g<b.length;g++){f=getElementsBySelector(b[g]);e=e.concat(f)}for(g=0;g<e.length;g++){if(e[g].offsetHeight>d){d=e[g].offsetHeight}e[g].style.height="auto"}for(g=0;g<e.length;g++){h=d-e[g].offsetHeight;if(h>0){f=CreateEl("b");f.className="niftyfill";f.style.height=h+"px";nc=e[g].lastChild;if(nc.className=="niftycorners"){e[g].insertBefore(f,nc)}else{e[g].appendChild(f)}}}}function getElementsBySelector(d){var h,g,b="",n="",x=d,t="",r,e,m,q,w=[],p=[],o;if(d.find("#")){if(d.find(" ")){w=d.split(" ");var l=w[0].split("#");if(l.length==1){return(p)}m=document.getElementById(l[1]);if(m){u=m.getElementsByTagName(w[1]);for(h=0;h<u.length;h++){p.push(u[h])}}return(p)}else{w=d.split("#");x=w[0];b=w[1];if(b!=""){m=document.getElementById(b);if(m){p.push(m)}return(p)}}}if(d.find(".")){w=d.split(".");x=w[0];n=w[1];if(n.find(" ")){w=n.split(" ");n=w[0];t=w[1]}}var u=document.getElementsByTagName(x);if(n==""){for(h=0;h<u.length;h++){p.push(u[h])}return(p)}for(h=0;h<u.length;h++){o=u[h].className.split(" ");for(g=0;g<o.length;g++){if(o[g]==n){if(t==""){p.push(u[h])}else{r=u[h].getElementsByTagName(t);for(e=0;e<r.length;e++){p.push(r[e])}}}}}return(p)}function getParentBk(a){var b=a.parentNode,d;while(b.tagName.toUpperCase()!="HTML"&&(d=getBk(b))=="transparent"){b=b.parentNode}if(d=="transparent"){d="#FFFFFF"}return(d)}function getBk(a){var b=getStyleProp(a,"backgroundColor");if(b==null||b=="transparent"||b.find("rgba(0, 0, 0, 0)")){return("transparent")}if(b.find("rgb")){b=rgb2hex(b)}return(b)}function getPadding(a,b){var c=getStyleProp(a,"padding"+b);if(c==null||!c.find("px")){return(0)}return(parseInt(c))}function getStyleProp(a,b){if(a.currentStyle){return(a.currentStyle[b])}if(document.defaultView.getComputedStyle){return(document.defaultView.getComputedStyle(a,"")[b])}return(null)}function rgb2hex(f){var d="",a,c,b;var e=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var c=e.exec(f);for(b=1;b<4;b++){a=parseInt(c[b]).toString(16);if(a.length==1){d+="0"+a}else{d+=a}}return("#"+d)}function Mix(f,e){var d,c,b,a,h,g=new Array(3);if(f.length==4){c=1}else{c=2}if(e.length==4){b=1}else{b=2}for(d=0;d<3;d++){a=parseInt(f.substr(1+c*d,c),16);if(c==1){a=16*a+a}h=parseInt(e.substr(1+b*d,b),16);if(b==1){h=16*h+h}g[d]=Math.floor((a*50+h*50)/100);g[d]=g[d].toString(16);if(g[d].length==1){g[d]="0"+g[d]}}return("#"+g[0]+g[1]+g[2])};