function NiftyCheck(){if(!document.getElementById||!document.createElement){return(false)}isXHTML=/html\:/.test(document.getElementsByTagName("body")[0].nodeName);if(Array.prototype.push==null){Array.prototype.push=function(){this[this.length]=arguments[0];return(this.length)}}return(true)}function Rounded(D,O,B,E,A){var I,J,L,N="r",G="",F=false,H="",M=false,Q=false;if(E=="transparent"){N=N+"x";G=B;B="transparent"}else{if(A&&A.indexOf("border")>=0){var K=A.split(" ");for(I=0;I<K.length;I++){if(K[I].indexOf("#")>=0){G=K[I]}}if(G==""){G="#666"}N+="e";F=true}else{if(A&&A.indexOf("smooth")>=0){N+="a";G=Mix(B,E)}}}if(A&&A.indexOf("small")>=0){N+="s"}J=N;L=N;if(O.indexOf("all")>=0){Q=true;M=true}else{if(O.indexOf("top")>=0){Q="true"}else{if(O.indexOf("tl")>=0){Q="true";if(O.indexOf("tr")<0){J+="l"}}else{if(O.indexOf("tr")>=0){Q="true";J+="r"}}}}if(O.indexOf("bottom")>=0){M=true}else{if(O.indexOf("bl")>=0){M="true";if(O.indexOf("br")<0){L+="l"}}else{if(O.indexOf("br")>=0){M="true";L+="r"}}}var P=getElementsBySelector(D);var C=P.length;for(I=0;I<C;I++){if(F){AddBorder(P[I],G)}if(Q){AddTop(P[I],B,E,G,J)}if(M){AddBottom(P[I],B,E,G,L)}}}function AddBorder(C,D){var B;if(!C.passed){if(C.childNodes.length==1&&C.childNodes[0].nodeType==3){var A=C.firstChild.nodeValue;C.removeChild(C.lastChild);var E=CreateEl("span");E.style.display="block";E.appendChild(document.createTextNode(A));C.appendChild(E)}for(B=0;B<C.childNodes.length;B++){if(C.childNodes[B].nodeType==1){C.childNodes[B].style.borderLeft="1px solid "+D;C.childNodes[B].style.borderRight="1px solid "+D}}}C.passed=true}function AddTop(A,C,D,F,I){var E,B=4,G=CreateEl("b");if(I.indexOf("s")>=0){B=2}if(F){G.className="artop"}else{G.className="rtop"}G.style.backgroundColor=C;for(E=1;E<=B;E++){var H=CreateEl("b");H.className=I+E;H.style.backgroundColor=D;if(F){H.style.borderColor=F}G.appendChild(H)}A.style.paddingTop=0;A.insertBefore(G,A.firstChild)}function AddBottom(A,C,D,F,I){var E,B=4,G=CreateEl("b");if(I.indexOf("s")>=0){B=2}if(F){G.className="artop"}else{G.className="rtop"}G.style.backgroundColor=C;for(E=B;E>0;E--){var H=CreateEl("b");H.className=I+E;H.style.backgroundColor=D;if(F){H.style.borderColor=F}G.appendChild(H)}A.style.paddingBottom=0;A.appendChild(G)}function CreateEl(A){if(isXHTML){return(document.createElementNS("http://www.w3.org/1999/xhtml",A))}else{return(document.createElement(A))}}function getElementsBySelector(B){var C,A="",E="",H=B,F,J=[],I=[];if(B.indexOf(" ")>0){J=B.split(" ");var D=J[0].split("#");if(D.length==1){return(I)}F=document.getElementById(D[1]);if(F){return(F.getElementsByTagName(J[1]))}return(I)}if(B.indexOf("#")>0){J=B.split("#");H=J[0];A=J[1]}if(A!=""){F=document.getElementById(A);if(F){I.push(F)}return(I)}if(B.indexOf(".")>0){J=B.split(".");H=J[0];E=J[1]}var G=document.getElementsByTagName(H);if(E==""){return(G)}for(C=0;C<G.length;C++){if(G[C].className.indexOf(E)>=0){I.push(G[C])}}return(I)}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)}return("#"+G[0].toString(16)+G[1].toString(16)+G[2].toString(16))}