var sid="";var Biotest=Class.create();Biotest.prototype={initialize:function(){this.shows=new Array()},require:function(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')},loadSrcDeps:function(a,b){try{$A(document.getElementsByTagName("script")).findAll(function(d){return(d.src&&d.src.match(b))}).each(function(d){var e=d.src.replace(b,"");a.split(",").each(function(f){bio.require(e+f+".js")})})}catch(c){alert("loadSrcDeps: "+c)}},showDiv:function(a){try{var c=$(a);c.style.visibility="visible";c.style.display="block";this.shows[a]=true}catch(b){alert(b)}},hideDiv:function(a){try{var c=$(a);c.style.visibility="hidden";c.style.display="none";this.shows[a]=false}catch(b){alert(b)}},toggleDiv:function(a){if(this.shows[a]){this.hideDiv(a)}else{this.showDiv(a)}},shL:function(){bio.showDiv("loadingDiv")
},hiL:function(){bio.hideDiv("loadingDiv")},fd:function(a,d){var b="";try{b=a.getElementsByTagName(d)[0].firstChild.data}catch(c){}return b},getCookieValue:function(d){var b=document.cookie;var c=b.indexOf(" "+d+"=");if(c==-1){c=b.indexOf(d+"=")}if(c==-1){b=null}else{c=b.indexOf("=",c)+1;var a=b.indexOf(";",c);if(a==-1){a=b.length}b=unescape(b.substring(c,a))}return b},setCookie:function(d,a){a=escape(a);var c=new Date();c.setMonth(c.getMonth()+6);var b=c.toGMTString();document.cookie=d+"="+a+";expires="+b+";Path=/"},selectItem:function(a,c){var d=$(a);if(d!=null&&d!=undefined){for(var b=0;b<d.options.length;b++){if(d.options[b].value==c){d.selectedIndex=b}}}},clearSelect:function(a){var b=$(a);while(b.firstChild){b.removeChild(b.firstChild)}},updateSelectOption:function(b,d,a,j){try{var k=false;var c=$(b).options;
for(var f=0;f<c.length;f++){if(c[f].value==d){k=true;c[f].innerHTML=a}}if(!k){var g=document.createElement("option");g.value=d;g.innerHTML=a;$(b).appendChild(g)}}catch(h){alert(h)}},rmSelectOption:function(b,d){try{var c=$(b).options;for(var a=0;a<c.length;a++){if(c[a].value==d){$(b).removeChild(c[a])}}}catch(f){alert(f)}},selectLink:function(d,c,b){try{if(d==0){this.selectItem(b,$F(c))}else{this.selectItem(c,$F(b))}}catch(a){alert(a)}},replaceAll:function(c,a,b){while(c.search(a)>-1){c=c.replace(a,b)}return c},sanitize:function(a){a=this.replaceAll(a,"&","%26");a=this.replaceAll(a,"=","%3D");a=this.replaceAll(a,"'","%27");a=this.replaceAll(a,'"',"%22");a=this.replaceAll(a,/\+/,"%2B");a=this.replaceAll(a,"%","%25");return a},shorten:function(b,a){if(b.length>a){b=b.substring(0,a)+"..."}return b},accessDenied:function(d){var a=d.responseXML;
var c=a.getElementsByTagName("accessDenied");if(c!=null&&c!=undefined&&c.length>0){var b=this.fd(a,"login");if(b){this.showLoginBox()}else{this.showAccessDenied()}bio.hiL();return true}return false},showLoginBox:function(){this.showDiv("loginBox")},showAccessDenied:function(){alert("Access Denied.")},login:function(e){var a=$F("loginUsername");var c=$F("loginPassword");var d=function(j){var f=j.responseXML;var h=fd(f,"error");if(h.length>0){alert(h)}else{sid=fd(f,"sid");var g=fd(f,"userId");var i=fd(f,"cookieValue");bio.setCookie("vAwxYq",i);bio.hideDiv("loginBox");alert("Welcome, "+a)}bio.hiL()};var b="username="+this.sanitize(a);b+="&password="+this.sanitize(c);new Ajax.Request("/login.xml"+sid,{onComplete:d,method:"post",postBody:b});this.shL()},formatMoney:function(c){c=Math.floor(c*100+0.50000000001);
var a=(c%100);c=Math.floor(c/100).toString();if(a<10){a="0"+a}for(var b=0;b<Math.floor((c.length-(1+b))/3);b++){c=c.substring(0,c.length-(4*b+3))+","+c.substring(c.length-(4*b+3))}return"$"+c+"."+a}};function fd(b,c){return bio.fd(b,c)}function logError(a){error(a)}var bio=new Biotest();