jQuery.fn.nifty=function(a){if((document.getElementById&&document.createElement&&Array.prototype.push)==false){return}a=a||"";h=(a.indexOf("fixed-height")>=0)?this.offsetHeight:0;this.each(function(){var l,n="",b="";if(a!=""){a=a.replace("left","tl bl");a=a.replace("right","tr br");a=a.replace("top","tr tl");a=a.replace("bottom","br bl");a=a.replace("transparent","alias");if(a.indexOf("tl")>=0){n="both";if(a.indexOf("tr")==-1){n="left"}}else{if(a.indexOf("tr")>=0){n="right"}}if(a.indexOf("bl")>=0){b="both";if(a.indexOf("br")==-1){b="left"}}else{if(a.indexOf("br")>=0){b="right"}}}if(n==""&&b==""&&a.indexOf("none")==-1){n="both";b="both"}if(this.currentStyle!=null&&this.currentStyle.hasLayout!=null&&this.currentStyle.hasLayout==false){jQuery(this).css("display","inline-block")}if(n!=""){var m=document.createElement("b"),f=4,k="",c,l,e="r",g,j;jQuery(m).css("marginLeft","-"+_niftyGP(this,"Left")+"px");jQuery(m).css("marginRight","-"+_niftyGP(this,"Right")+"px");if(a.indexOf("alias")>=0||(j=_niftyBC(this))=="transparent"){j="transparent";g="transparent";k=_niftyPBC(this);e="t"}else{g=_niftyPBC(this);k=_niftyMix(j,g)}jQuery(m).css("background",g);m.className="niftycorners";c=_niftyGP(this,"Top");if(a.indexOf("small")>=0){jQuery(m).css("marginBottom",(c-2)+"px");e+="s";f=2}else{if(a.indexOf("big")>=0){jQuery(m).css("marginBottom",(c-10)+"px");e+="b";f=8}else{jQuery(m).css("marginBottom",(c-5)+"px")}}for(l=1;l<=f;l++){jQuery(m).append(CreateStrip(l,n,j,k,e))}jQuery(this).css("paddingTop","0px");jQuery(this).prepend(m)}if(b!=""){var m=document.createElement("b"),f=4,k="",c,l,e="r",g,j;jQuery(m).css("marginLeft","-"+_niftyGP(this,"Left")+"px");jQuery(m).css("marginRight","-"+_niftyGP(this,"Right")+"px");if(a.indexOf("alias")>=0||(j=_niftyBC(this))=="transparent"){j="transparent";g="transparent";k=_niftyPBC(this);e="t"}else{g=_niftyPBC(this);k=_niftyMix(j,g)}jQuery(m).css("background",g);m.className="niftycorners";c=_niftyGP(this,"Bottom");if(a.indexOf("small")>=0){jQuery(m).css("marginTop",(c-2)+"px");e+="s";f=2}else{if(a.indexOf("big")>=0){jQuery(m).css("marginTop",(c-10)+"px");e+="b";f=8}else{jQuery(m).css("marginTop",(c-5)+"px")}}for(l=f;l>0;l--){jQuery(m).append(CreateStrip(l,b,j,k,e))}jQuery(this).css("paddingBottom","0");jQuery(this).append(m)}});if(a.indexOf("height")>=0){this.each(function(){if(this.offsetHeight>h){h=this.offsetHeight}jQuery(this).css("height","auto");var c=h-this.offsetHeight;if(c>0){var b=document.createElement("b");b.className="niftyfill";jQuery(b).css("height",c+"px");nc=this.lastChild;nc.className=="niftycorners"?this.insertBefore(b,nc):jQuery(this).append(b)}})}return this};function CreateStrip(d,e,b,c,f){var a=document.createElement("b");a.className=f+d;jQuery(a).css("backgroundColor",b).css("borderColor",c);if(e=="left"){jQuery(a).css("borderRightWidth","0").css("marginRight","0")}else{if(e=="right"){jQuery(a).css("borderLeftWidth","0").css("marginLeft","0")}}return(a)}function _niftyPBC(a){var b=a.parentNode,d;while(b.tagName.toUpperCase()!="HTML"&&(d=_niftyBC(b))=="transparent"){b=b.parentNode}if(d=="transparent"){d="#FFFFFF"}return(d)}function _niftyBC(a){var j=jQuery(a).css("backgroundColor");if(j==null||j=="transparent"||j.indexOf("rgba(0, 0, 0, 0)")>=0){return("transparent")}if(j.indexOf("rgb")>=0){var f="";var g=/([0-9]+)[, ]+([0-9]+)[, ]+([0-9]+)/;var e=g.exec(j);for(var d=1;d<4;d++){var b=parseInt(e[d]).toString(16);if(b.length==1){f+="0"+b}else{f+=b}}j="#"+f}return(j)}function _niftyGP(a,b){var c=jQuery(a).css("padding"+b);if(c==null||c.indexOf("px")==-1){return(0)}return(parseInt(c))}function _niftyMix(f,e){var d,c,b,a,j,g=new Array(3);f.length==4?c=1:c=2;e.length==4?b=1:b=2;if(f=="white"){f="#ffffff"}if(e=="white"){e="#ffffff"}if(f=="black"){f="#000000"}if(e=="black"){e="#000000"}for(d=0;d<3;d++){a=parseInt(f.substr(1+c*d,c),16);if(c==1){a=16*a+a}j=parseInt(e.substr(1+b*d,b),16);if(b==1){j=16*j+j}g[d]=Math.floor((a*50+j*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])};