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

