Element.ExtraMethods={removeChildren:function(A){A=$(A);while(A.firstChild){A.removeChild(A.firstChild)}},extendBuilderWithTagsnames:function(A){$w(A).each(function(B){window["$"+B]=function(){var H,C={},F=$A();for(var E=0;E<arguments.length;E++){var G=arguments[E];if(typeof G=="string"){F.push(document.createTextNode(G))}else{if(G.nodeType==1){F.push(G)}else{if(G.constructor==Array){F=F.concat(G)}else{if(typeof G=="object"){C=G}}}}}var D=new Element(B,C);F.each(function(I){D.appendChild(I)});return D}})},setText:function(B,C){if(B.firstChild){var A=B.firstChild;A.data=C}else{var A=document.createTextNode(C);B.appendChild(A)}return $(B)}};Object.extend(Element,Element.ExtraMethods);var stereolabels=Class.create();stereolabels.prototype={labels:[],initialize:function(A){this.options=Object.extend({className:"inside"},A||{});this.labels=$$("label."+this.options.className);$A(this.labels).each(function(B){this.initLabel(B)}.bind(this));$A(document.forms).each(function(B){Event.observe(B,"submit",function(){this.uninit()}.bind(this))}.bind(this))},uninit:function(){$A(this.labels).each(function(A){var B=$(A.htmlFor);if(B&&B.value==B._labeltext){this.hide(B)}}.bind(this))},initLabel:function(B){try{var A=$(B.htmlFor);if(typeof ispopup=="undefined"&&A.id=="popup_login_password"){return }var D=A.tagName.toLowerCase();var C=A.type;if(D=="textarea"||(C=="text"||C=="password")){Element.setStyle(B,{position:"absolute",visibility:"hidden"});Object.extend(A,{_labeltext:B.childNodes[0].nodeValue,_type:C});Event.observe(A,"focus",this.focused.bind(this));Event.observe(A,"blur",this.blurred.bind(this));this.blurred({target:A})}else{Element.setStyle(B,{position:"static",visibility:"visible"})}}catch(E){Element.setStyle(B,{position:"static",visibility:"visible"})}},focused:function(B){var A=Event.element(B);if(A.value==A._labeltext){A=this.hide(A)}A.select()},blurred:function(B){var A=B.target?B.target:Event.element(B);if(A.value==""){A=this.show(A)}},hide:function(A){if(A._type=="password"){A=this.setInputType(A,"password")}A.value="";Element.removeClassName(A,this.options.className);return A},show:function(A){if(A._type=="password"){A=this.setInputType(A,"text")}Element.addClassName(A,this.options.className);A.value=A._labeltext;return A},setInputType:function(B,A){try{B.type=A;if(B.type=="password"){B.focus()}return B}catch(C){var D=document.createElement("input");D.type=A;for(prop in B){try{if(prop!="type"&&prop!="height"&&prop!="width"){D[prop]=B[prop]}}catch(C){}}Event.observe(D,"focus",this.focused.bind(this));Event.observe(D,"blur",this.blurred.bind(this));B.parentNode.replaceChild(D,B);if(D.type=="password"){D.focus()}return D}}};Event.observe(window,"load",stereolabelsInit,false);var myLabels=null;function stereolabelsInit(){myLabels=new stereolabels()};