Object.debug=function(B){var A=[];if(typeof B in ["string","number"]){return B}else{for(property in B){if(typeof B[property]!="function"){A.push(property+" => "+(typeof B[property]=="string"?'"'+B[property]+'"':B[property]))}}}return("'"+B+"' #"+typeof B+": {"+A.join(", ")+"}")};String.prototype.toArray=function(){var B=[];for(var A=0;A<this.length;A++){B.push(this.charAt(A))}return B};var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(A){A=A.toUpperCase();var E=this.NODEMAP[A]||"div";var B=document.createElement(E);B.innerHTML="<"+A+"></"+A+">";var D=B.firstChild||null;if(D&&(D.tagName!=A)){D=D.getElementsByTagName(A)[0]}if(!D){D=document.createElement(A)}if(!D){return }if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)){this._children(D,arguments[1])}else{var C=this._attributes(arguments[1]);if(C.length){B.innerHTML="<"+A+" "+C+"></"+A+">";D=B.firstChild||null;if(!D){D=document.createElement(A);for(attr in arguments[1]){D[attr=="class"?"className":attr]=arguments[1][attr]}}if(D.tagName!=A){D=B.getElementsByTagName(A)[0]}}}}if(arguments[2]){this._children(D,arguments[2])}return D},_text:function(A){return document.createTextNode(A)},_attributes:function(A){var B=[];for(attribute in A){B.push((attribute=="className"?"class":attribute)+'="'+A[attribute].toString().escapeHTML()+'"')}return B.join(" ")},_children:function(B,A){if(typeof A=="object"){A.flatten().each(function(C){if(typeof C=="object"){B.appendChild(C)}else{if(Builder._isStringOrNumber(C)){B.appendChild(Builder._text(C))}}})}else{if(Builder._isStringOrNumber(A)){B.appendChild(Builder._text(A))}}},_isStringOrNumber:function(A){return(typeof A=="string"||typeof A=="number")}};String.prototype.camelize=function(){var D=this.split("-");if(D.length==1){return D[0]}var B=this.indexOf("-")==0?D[0].charAt(0).toUpperCase()+D[0].substring(1):D[0];for(var C=1,A=D.length;C<A;C++){var E=D[C];B+=E.charAt(0).toUpperCase()+E.substring(1)}return B};Element.getStyle=function(B,C){B=$(B);var D=B.style[C.camelize()];if(!D){if(document.defaultView&&document.defaultView.getComputedStyle){var A=document.defaultView.getComputedStyle(B,null);D=(A!=null)?A.getPropertyValue(C):null}else{if(B.currentStyle){D=B.currentStyle[C.camelize()]}}}if(window.opera&&(C=="left"||C=="top"||C=="right"||C=="bottom")){if(Element.getStyle(B,"position")=="static"){D="auto"}}if(D=="auto"){D=null}return D};String.prototype.parseColor=function(){color="#";if(this.slice(0,4)=="rgb("){var B=this.slice(4,this.length-1).split(",");var A=0;do{color+=parseInt(B[A]).toColorPart()}while(++A<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var A=1;A<4;A++){color+=(this.charAt(A)+this.charAt(A)).toLowerCase()}}if(this.length==7){color=this.toLowerCase()}}}return(color.length==7?color:(arguments[0]||this))};Element.makePositioned=function(A){A=$(A);var B=Element.getStyle(A,"position");if(B=="static"||!B){A._madePositioned=true;A.style.position="relative";if(window.opera){A.style.top=0;A.style.left=0}}};Element.undoPositioned=function(A){A=$(A);if(typeof A._madePositioned!="undefined"){A._madePositioned=undefined;A.style.position="";A.style.top="";A.style.left="";A.style.bottom="";A.style.right=""}};Element.makeClipping=function(A){A=$(A);if(typeof A._overflow!="undefined"){return }A._overflow=A.style.overflow;if((Element.getStyle(A,"overflow")||"visible")!="hidden"){A.style.overflow="hidden"}};Element.undoClipping=function(A){A=$(A);if(typeof A._overflow=="undefined"){return }A.style.overflow=A._overflow;A._overflow=undefined};Element.collectTextNodesIgnoreClass=function(D,E){var C=$(D).childNodes;var F="";var B=new RegExp("^([^ ]+ )*"+E+"( [^ ]+)*$","i");for(var A=0;A<C.length;A++){if(C[A].nodeType==3){F+=C[A].nodeValue}else{if((!C[A].className.match(B))&&C[A].hasChildNodes()){F+=Element.collectTextNodesIgnoreClass(C[A],E)}}}return F};Element.setContentZoom=function(A,B){A=$(A);A.style.fontSize=(B/100)+"em";if(navigator.appVersion.indexOf("AppleWebKit")>0){window.scrollBy(0,0)}};Element.getOpacity=function(B){var A;if(A=Element.getStyle(B,"opacity")){return parseFloat(A)}if(A=(Element.getStyle(B,"filter")||"").match(/alpha\(opacity=(.*)\)/)){if(A[1]){return parseFloat(A[1])/100}}return 1};Element.setOpacity=function(B,C){B=$(B);var A=B.style;if(C==1){A.opacity="0.999999";if(/MSIE/.test(navigator.userAgent)){A.filter=Element.getStyle(B,"filter").replace(/alpha\([^\)]*\)/gi,"")}}else{if(C<0.00001){C=0}A.opacity=C;if(/MSIE/.test(navigator.userAgent)){A.filter=Element.getStyle(B,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+C*100+")"}}};Element.getInlineOpacity=function(A){A=$(A);var B;B=A.style.opacity;if(typeof B!="undefined"&&B!=""){return B}return""};Element.setInlineOpacity=function(B,C){B=$(B);var A=B.style;A.opacity=C};Element.getDimensions=function(B){B=$(B);if(Element.getStyle(B,"display")=="none"){var A=B.style;var E=A.visibility;var C=A.position;A.visibility="hidden";A.position="absolute";A.display="";var F=B.clientWidth;var D=B.clientHeight;A.display="none";A.position=C;A.visibility=E;return{width:F,height:D}}return{width:B.offsetWidth,height:B.offsetHeight}};Position.positionedOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent;if(B){p=Element.getStyle(B,"position");if(p=="relative"||p=="absolute"){break}}}while(B);return[C,A]};if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}B=B.offsetParent}while(B);return[C,A]}}Position.page=function(D){var A=0,C=0;var B=D;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;if(B.offsetParent==document.body){if(Element.getStyle(B,"position")=="absolute"){break}}}while(B=B.offsetParent);B=D;do{A-=B.scrollTop||0;C-=B.scrollLeft||0}while(B=B.parentNode);return[C,A]};Position.offsetParent=function(A){if(A.offsetParent){return A.offsetParent}if(A==document.body){return A}while((A=A.parentNode)&&A!=document.body){if(Element.getStyle(A,"position")!="static"){return A}}return document.body};Position.clone=function(C,E){var A=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});C=$(C);var D=Position.page(C);E=$(E);var F=[0,0];var B=null;if(Element.getStyle(E,"position")=="absolute"){B=Position.offsetParent(E);F=Position.page(B)}if(B==document.body){F[0]-=document.body.offsetLeft;F[1]-=document.body.offsetTop}if(A.setLeft){E.style.left=(D[0]-F[0]+A.offsetLeft)+"px"}if(A.setTop){E.style.top=(D[1]-F[1]+A.offsetTop)+"px"}if(A.setWidth){E.style.width=C.offsetWidth+"px"}if(A.setHeight){E.style.height=C.offsetHeight+"px"}};Position.absolutize=function(B){B=$(B);if(B.style.position=="absolute"){return }Position.prepare();var D=Position.positionedOffset(B);var F=D[1];var E=D[0];var C=B.clientWidth;var A=B.clientHeight;B._originalLeft=E-parseFloat(B.style.left||0);B._originalTop=F-parseFloat(B.style.top||0);B._originalWidth=B.style.width;B._originalHeight=B.style.height;B.style.position="absolute";B.style.top=F+"px";B.style.left=E+"px";B.style.width=C+"px";B.style.height=A+"px"};Position.relativize=function(A){A=$(A);if(A.style.position=="relative"){return }Position.prepare();A.style.position="relative";var C=parseFloat(A.style.top||0)-(A._originalTop||0);var B=parseFloat(A.style.left||0)-(A._originalLeft||0);A.style.top=C+"px";A.style.left=B+"px";A.style.height=A._originalHeight;A.style.width=A._originalWidth};Element.Class={toggle:function(A,B){if(Element.Class.has(A,B)){Element.Class.remove(A,B);if(arguments.length==3){Element.Class.add(A,arguments[2])}}else{Element.Class.add(A,B);if(arguments.length==3){Element.Class.remove(A,arguments[2])}}},get:function(A){return $(A).className.split(" ")},remove:function(B){B=$(B);var A=arguments;$R(1,arguments.length-1).each(function(C){B.className=B.className.split(" ").reject(function(D){return(D==A[C])}).join(" ")})},add:function(B){B=$(B);for(var A=1;A<arguments.length;A++){Element.Class.remove(B,arguments[A]);B.className+=(B.className.length>0?" ":"")+arguments[A]}},has:function(C){C=$(C);if(!C||!C.className){return false}var D;for(var B=1;B<arguments.length;B++){if((typeof arguments[B]=="object")&&(arguments[B].constructor==Array)){for(var A=0;A<arguments[B].length;A++){D=new RegExp("(^|\\s)"+arguments[B][A]+"(\\s|$)");if(!D.test(C.className)){return false}}}else{D=new RegExp("(^|\\s)"+arguments[B]+"(\\s|$)");if(!D.test(C.className)){return false}}}return true},has_any:function(C){C=$(C);if(!C||!C.className){return false}var D;for(var B=1;B<arguments.length;B++){if((typeof arguments[B]=="object")&&(arguments[B].constructor==Array)){for(var A=0;A<arguments[B].length;A++){D=new RegExp("(^|\\s)"+arguments[B][A]+"(\\s|$)");if(D.test(C.className)){return true}}}else{D=new RegExp("(^|\\s)"+arguments[B]+"(\\s|$)");if(D.test(C.className)){return true}}}return false},childrenWith:function(C,D){var B=$(C).getElementsByTagName("*");var E=new Array();for(var A=0;A<B.length;A++){if(Element.Class.has(B[A],D)){E.push(B[A])}}return E}};