var root;var ratedObjects=[];var embeds="";var objects="";var corporateNavMoreLoaded=false;var ImageCounter=new Array();function initLib(){embeds=document.getElementsByTagName("embed");objects=document.getElementsByTagName("object");ratedObjects=document.getElementsByClassName("lib_rating");Browser.type=Browser.detect();}var User={login:function(){Overlay.show("loginBox","500","300");formFocus("FormLogin","Login");},getFavorites:function(){var A="/tools/getFavPortals";var B="username="+User.name;var C=new Ajax.Request(A,{method:"get",parameters:B,onSuccess:function(D){updateZines(D.responseXML);}});}};var Overlay={get:function(C,G,D,A){if(!User.name){User.login();return ;}if($(G)){Overlay.show(G,D,A);return ;}var F=$ce("div");F.id=G;document.body.appendChild(F);F.innerHTML="Loading...please wait...";this.show(G,D,A);var B=C;var E=new Ajax.Request(B,{method:"post",onSuccess:function(H){Overlay.insert(F.id,H.responseText);}});},insert:function(F,E){var D=$(F);D.innerHTML=E;var A=D.getElementsByTagName("script");var C="";for(var B=0;B<A.length;B++){C+=A[B].text;}if(D.id=="spmWrapper"){$("spmscript").text=C;}else{if(D.id=="easyaddplaceholder"){$("easyaddscript").text=C;}}},show:function(C,A,B){this.cleanEmbeds(1);this.mask("show");this.place(C,A,B);setOpacity(0,C);$Show(C);this.fade("in",C,0.7,0.99);},place:function(F,C,E){scrollTo(0,0);var B=$(F);var D=(Browser.getWidth()/2)-(C/2);var A=(Browser.getHeight()/2)-(E/2);B.style.top=A+"px";B.style.left=D+"px";B.style.zIndex="100";B.style.position="absolute";B.style.display="block";B.style.visibility="visible";},hide:function(A){this.cleanEmbeds(2);this.mask("hide");this.fade("out",A,0.7,0);if(A=="easyAddMain"){$Hide("easyaddplaceholder");}},mask:function(B,C){switch(B){case"display":return ;case"show":var A=$("mask");A.style.height=Browser.getScroll()+"px";A.style.zIndex="10";$Show("mask");setOpacity(0,"mask");this.fade("in","mask",0.7,0.8);return ;case"hide":this.fade("out","mask",0.7,0);return ;}},fade:function(D,C,F,J,E){switch(D){case"in":var G=document.getElementsByClassName("embeddedAd");if(G){G.invoke("hide");}var I=new Date().getTime();if(typeof (E)=="number"){}else{E=new Date().getTime();}if(typeof (C)=="object"){var H=C;}else{var H=$(C);}if(navigator.appName!="Microsoft Internet Explorer"){var B=1500;}else{var B=1000;}var A=(I-E)/B;if(A<F){var K=(A/F)*(A/F);if(K<J){setOpacity(K,C);setTimeout("Overlay.fade('"+D+"', '"+C+"',"+F+","+J+","+E+")",100);}else{setOpacity(J,C);return ;}}else{setOpacity(J,C);return ;}return ;case"out":var G=document.getElementsByClassName("embeddedAd");if(G){G.invoke("show");}var I=new Date().getTime();if(typeof (E)=="number"){}else{E=new Date().getTime();}var A=(I-E)/1000;if(A<F){var K=0.8-(A/F)*(A/F);if(K>0.1){setOpacity(K,C);setTimeout("Overlay.fade('"+D+"', '"+C+"',"+F+","+J+","+E+")",100);}else{$Hide(C);setOpacity(J,C);return ;}}else{$Hide(C);setOpacity(J,C);return ;}return ;}},cleanEmbeds:function(B){var A=Browser.type;if(embeds==""){embeds=document.getElementsByTagName("embed");objects=document.getElementsByTagName("object");}if((B==1)&&(embeds.length>0)){if((A=="fLinux")||(A=="IE")){for(i=0;i<embeds.length;i++){embeds[i].style.display="none";}}else{if(A=="Safari"){for(i=0;i<objects.length;i++){objects[i].style.visibility="hidden";}}else{if(A=="Other"){return ;}}}}else{if((B==2)&&(embeds.length>0)){if((A=="fLinux")||(A=="IE")){for(i=0;i<embeds.length;i++){embeds[i].style.display="block";}}else{if(A=="Safari"){for(i=0;i<objects.length;i++){objects[i].style.visibility="shown";}}else{if(A=="Other"){return ;}}}}else{if((A)&&(B==3)){$Hide("selectedVideo");}else{if((A)&&(B==4)){$Show("selectedVideo");}}}}}};var Browser={detect:function(){if((navigator.userAgent.indexOf("Firefox")>-1)&&(navigator.platform.indexOf("Linux")>-1)){return"fLinux";}else{if((navigator.userAgent.indexOf("MSIE")>-1)&&(navigator.platform.indexOf("Win")>-1)){return"IE";}else{if((navigator.userAgent.indexOf("Safari")>-1)&&(navigator.platform.indexOf("Mac")>-1)){return"Safari";}else{return"Other";}}}},getScroll:function(){if(isNaN(window.innerHeight+window.scrollMaxY)){var A=document.body.scrollHeight;}else{var A=window.innerHeight+window.scrollMaxY;}if(A<1600){A=A+1000;}return A;},getWidth:function(){if(typeof (window.innerWidth)=="number"){return window.innerWidth;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return document.documentElement.clientWidth;}else{return false;}}},getHeight:function(){if(typeof (window.innerWidth)=="number"){return window.innerHeight;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){return document.documentElement.clientHeight;}else{return false;}}},getPageScroll:function(){var B,A;if(self.pageYOffset){A=self.pageYOffset;B=self.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop;B=document.documentElement.scrollLeft;}else{if(document.body){A=document.body.scrollTop;B=document.body.scrollLeft;}}}return{x:B,y:A};},getPageSize:function(){var C,A;if(window.innerHeight&&window.scrollMaxY){C=document.body.scrollWidth;A=window.innerHeight+window.scrollMaxY;}else{if(document.body.scrollHeight>document.body.offsetHeight){C=document.body.scrollWidth;A=document.body.scrollHeight;}else{C=document.body.offsetWidth;A=document.body.offsetHeight;}}var B,D;if(self.innerHeight){B=self.innerWidth;D=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientWidth;D=document.documentElement.clientHeight;}else{if(document.body){B=document.body.clientWidth;D=document.body.clientHeight;}}}if(A<D){pageHeight=D;}else{pageHeight=A;}if(C<B){pageWidth=B;}else{pageWidth=C;}arrayPageSize=new Array(pageWidth,pageHeight,B,D);return arrayPageSize;}};Browser.New={initOverlay:function(C,B,A){this.showMask();this.placeOverlay(C,B,A);},showMask:function(){var A=$("mask");A.style.height=Browser.getScroll()+"px";setOpacity(0.35,"mask");$("mask").style.display="block";},placeOverlay:function(G,C,B){var F=$(G);var A=Browser.getPageScroll();var E=(Browser.getHeight()-B)/2+A.y;var D=(Browser.getWidth()-C)/2+A.x;F.style.left=Math.max(parseInt(D),100)+"px";F.style.top=Math.max(parseInt(E),100)+"px";F.style.display="block";},hideOverlay:function(A){$(A).style.display="none";$("mask").style.display="none";}};if(Browser.type=="fLinux"){document.write('<style type="text/css">object{z-index:1;-moz-opacity:.99;}</style>');}var Video={toggle:function(G,D){if(D=="1"){try{var F=$("B"+G);F.width="250";F.height="210";}catch(E){}var A=$("E"+G);A.width="250";A.height="210";var C=$("small"+G);C.className="optionLink selected";var B=$("large"+G);B.className="optionLink";}if(D=="2"){try{var F=$("B"+G);F.width="515";F.height="430";}catch(E){}var A=$("E"+G);A.width="515";A.height="430";var C=$("small"+G);C.className="optionLink";var B=$("large"+G);B.className="optionLink selected";}if(D=="3"){var F=$("B"+G);F.style.zIndex="5";F.style.position="absolute";F.style.left="50px;";F.style.top="50px;";F.width="800px";F.height="600px";var A=$("E"+G);A.width="425px";F.height="350px";var C=$("small"+G);C.className="optionLink";var B=$("large"+G);B.className="optionLink selected";}}};function flashObject(D,G,A,E,F,C,B){this.url=D;this.id=G;this.eid=B;this.height=A;this.width=E;this.color=C;this.wmode=F;this.type="application/x-shockwave-flash";this.variables=new Array();this.params=new Array();flashObject.prototype.addVariable=function(H,I){this.variables.push({"name":H,"value":I});};flashObject.prototype.addParam=function(H,I){this.params.push({"name":H,"value":I});};flashObject.prototype.writeobj=function(I){var H=document.getElementById(I);str='<object id="'+this.id+'" width="'+this.width+'" height="'+this.height+'" >';for(j in this.params){str+='<param name="'+this.params[j].name+'" value="'+this.params[j].value+'" ></param>';}str+='<embed src="'+this.url+'" id="'+this.eid+'" width="'+this.width+'" height="'+this.height+'" wmode="'+this.wmode+'" type="application/x-shockwave-flash" ></embed>';str+="</object>";document.write(str);};}var Photo={init:function(B,A){setOpacity(0.2,"prevPhoto"+B);if(A<=1){setOpacity(0.2,"nextPhoto"+B);}},next:function(D,E,K,H,I,J){var B=$(E);if(ImageCounter[D]>=H.length-1){ImageCounter[D]=(H.length-1);}else{var F=$(K[ImageCounter[D]]);F.className="hidden";var A=$("ps"+K[ImageCounter[D]]);A.className="hidden";B.src=H[++ImageCounter[D]];B.alt=J[ImageCounter[D]];B.title=J[ImageCounter[D]];B.parentNode.href=I[ImageCounter[D]];var G=$(K[ImageCounter[D]]);G.className="photoHeader shown";var C=$("ps"+K[ImageCounter[D]]);C.className="photoSource shown";if(ImageCounter[D]>=H.length-1){setOpacity(0.2,"nextPhoto"+D);}setOpacity(0.99,"prevPhoto"+D);}return false;},prev:function(D,E,K,H,I,J){var B=$(E);if(ImageCounter[D]<=0){ImageCounter[D]==0;}else{var F=$(K[ImageCounter[D]]);F.className="hidden";var A=$("ps"+K[ImageCounter[D]]);A.className="hidden";B.src=H[--ImageCounter[D]];B.alt=J[ImageCounter[D]];B.title=J[ImageCounter[D]];B.parentNode.href=I[ImageCounter[D]];var G=$(K[ImageCounter[D]]);G.className="photoHeader shown";var C=$("ps"+K[ImageCounter[D]]);C.className="photoSource shown";if(ImageCounter[D]==0){setOpacity(0.2,"prevPhoto"+D);}setOpacity(1,"nextPhoto"+D);}return false;}};var Message={init:function(A,B){$("link1").href="javascript:Message.hide();";$("username").value=B;$("recipient").innerHTML=B;$("easyUpdateMessage").innerHTML='  <p><a href="/member/'+B+'/messages?add=True">View the message</a> or <a href="javascript:Message.hide();">close</a></p>';Overlay.get("","mForm","500","300");},send:function(){if(document.mForm.message.value!=""){$Hide("easyUpdateMessage");$Hide("easyErrMessage");$Show("easyMessage");var A="/tools/ajaxMessages";var B=Form.serialize(document.mForm);var C=new Ajax.Request(A,{method:"post",parameters:B,requestHeaders:["Content-Type","application/x-www-form-urlencoded"],onSuccess:function(D){Message.respond(D.responseXML);}});}else{alert("Please type in a message");}},respond:function(A){root=A.documentElement;root=cleanWhitespace(root);stat=getNodeData("","type",root,0);$Hide("easyMessage");if(stat=="success"){document.mForm.message.value="";$Show("easyUpdateMessage");}else{if(stat=="error"){$Show("easyErrMessage");}}},hide:function(){Overlay.hide("mForm");setTimeout("$Hide('easyErrMessage')",400);setTimeout("$Hide('easyMessage')",400);setTimeout("$Hide('easyUpdateMessage')",400);}};var Kudo={type:"",requests:[],change:function(A){if(A==-1){A=1;}else{A=-1;}return A;},vote:function(user,id,value,total,count){if(this.requests[id]==1){return ;}this.requests[id]=1;eval(id+"_total = Number("+id+"_total) + Number("+id+"_value)");eval(id+"_value = Kudo.change(Number("+id+"_value))");for(var i=0;i<=count;i++){var oState=$(id+"_"+i+"_voteState");if(value==-1){oState.innerHTML="+&nbsp;Kudo";oState.style.color="#FF6600";}else{if(value==1){oState.innerHTML="-&nbsp;Kudo";oState.style.color="#AAAAAA";}else{alert(value);return ;}}var votes=$(id+"_"+i+"_votes");if(this.type!="side"){votes.innerHTML=(Number(total)+Number(value))+'<span class="rateme_descrip"> Kudos</span>';}else{votes.innerHTML=(Number(total)+Number(value))+'<span class="rateme_descrip_side"> Kudos</span>';}}if(Number(value)==-1){value=0;}var url="/tools/rateme";var pars="RID="+user+"&Rating="+Number(value);var myAjax=new Ajax.Request(url,{method:"post",parameters:pars,onSuccess:function(){Kudo.requests[id]=0;}});}};function roll_obj(F,E,B,D,A,C){this.Title=E;this.URL=B;this.Desc=D;this.ID=F;this.Keyword=A;this.SourceID=C;}var Roll={get:function(A){for(i=0;i<roll_array.length;i++){if(roll_array[i].ID==A){return roll_array[i];}}},edit:function(D,B){var A=Roll.get(D);var C=$("delete_link");Overlay.get("","mForm","500","300");document.forms["overlay_form"].elements["Name"].value=A.Title;document.forms["overlay_form"].elements["Desc"].value=A.Desc;document.forms["overlay_form"].action="/edit"+this.URL+D;$Show("delete_link");C.innerHTML='<a href="/delete'+this.URL+D+'">[Delete]</a>';if(this.URL.indexOf("trackers")!=-1){switchDiv("edit_tracker_sub","edit_tracker_main");$("zRID").value=D;}if((B)&&(B==5)){$Show("provider_option");$Show("provider_option_label");this.setProvider($("provider_option_dd"),A.SelectID);}else{$Hide("provider_option");$Hide("provider_option_label");}},setProvider:function(A,B){for(i=0;i<A.length;i++){if(A.options[i].value==B){A.options[i].selected=true;}}}};function $(A){return document.getElementById(A);}function $Show(B){if(typeof (B)=="object"){var A=B;}else{var A=$(B);}A.style.visibility="visible";A.style.display="block";}function $Hide(B){if(typeof (B)=="object"){var A=B;}else{var A=$(B);}if(A){A.style.visibility="hidden";if(B=="searchForm"){A.style.display="block";}else{(A.style.display="none");}}}function $ce(A){return document.createElement(A);}function $ac(A,B){return A.appendChild(B);}function formFocus(A,C){var B=$(A);if(B.parentNode.parentNode.style.display=="block"){B[C].focus();}}function toggleContent(B){var A=$(B);if(A!=null){if(A.style.visibility=="hidden"){A.style.visibility="visible";A.style.display="block";}else{A.style.visibility="hidden";A.style.display="none";}}}function showArray(A){if(A.length>0){for(i=0;i<A.length;i++){A[i].style.display="block";A[i].style.visibility="visible";}}}function hideArray(A){if(A.length>0){for(i=0;i<A.length;i++){A[i].style.display="none";A[i].style.visibility="hidden";}}}function switchDiv(C,A){var D=$(C);D.style.visibility="hidden";D.style.display="none";var B=$(A);B.style.visibility="visible";B.style.display="block";}function showGlow(B){var A=$(B);A.style.border="1px solid #F17800";}function hideGlow(B){var A=$(B);A.style.border="1px solid #EEE";}function pausecomp(C){var B=new Date();var A=null;do{A=new Date();}while(A-B<C);}function setOpacity(C,B){if(typeof (B)=="object"){var A=B;}else{var A=$(B);}if(A!=null&&A.style!=null&&A.style.MozOpacity!=null){A.style.MozOpacity=C;}if(A!=null&&A.style!=null&&A.style.opacity!=null){A.style.opacity=C;}if(A!=null&&A.style!=null&&A.style.filter!=null){A.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+(C*100)+")";}}var MONTHS=new Array("January","February","March","April","May","June","July","August","September","October","November","December");var SHORTMONTHS=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");var DAYSOFWEEK=new Array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");var SHORTMONTHS=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");function localTime(E){var C=new Date();C.setTime(Date.parse(E));var A=C.getHours();var B="am";if(A>=12){B="pm";}A=(A%12)||12;var D=C.getMinutes();if(D<10){D="0"+D;}var F=C.getYear()%100;if(!F){return"N/A";}if(F<10){F="0"+F;}return SHORTMONTHS[C.getMonth()]+"-"+C.getDate()+"-"+F+" "+A+":"+D+B;}function localDMY(B){var A=new Date();A.setTime(Date.parse(B)+3600000);var C=A.getYear()%100;if(!C){return"N/A";}if(C<10){C="0"+C;}return A.getDate()+"-"+SHORTMONTHS[A.getMonth()]+"-"+C;}function localMDY(B){var A=new Date();A.setTime(Date.parse(B)+3600000);var C=A.getFullYear();if(!C){return"N/A";}return MONTHS[A.getMonth()]+" "+A.getDate()+", "+C;}function cleanWhitespace(C){var D=/\S/;for(var A=0;A<C.childNodes.length;A++){var B=C.childNodes[A];if((B.nodeType==3)&&(!D.test(B.nodeValue))){C.removeChild(C.childNodes[A]);A--;}if(B.nodeType==1){cleanWhitespace(B);}}return C;}function removeChildren(B){var A=$(B);while(A.hasChildNodes()==true){A.removeChild(A.childNodes[0]);}}function getNodeData(E,D,B,C){if(D=="TID"){alert("parent="+B.nodeName+" index="+C);}var A="";try{A=B.getElementsByTagName(D)[C];}catch(F){}if(A){if(!A.firstChild){return A;}else{if(A.firstChild.childNodes.length==0){return A.firstChild.nodeValue;}else{if(A.firstChild.childNodes.length>0){return A;}}}}}function getFirstValue(C,B){var A=C.getElementsByTagName(B);if(A==null||A.length==0){return"";}if(A[0].firstChild&&A[0].firstChild.nodeValue){return A[0].firstChild.nodeValue;}return"";}function goBack(){if(document.referrer){window.location=document.referrer;}else{history.go(-1);}}function setAnchor(B){var A=window.location.href;if(A.indexOf("#")!=-1){A=A.split("#")[0];}window.location.replace(A+B);}var Ajax={Request:function(){}};document.getElementsByClassName=function(G,F){if(!F){F=document.getElementsByTagName("body")[0];}var A=[];var E=new RegExp("\\b"+G+"\\b");var D=F.getElementsByTagName("*");for(var C=0,B=D.length;C<B;C++){if(E.test(D[C].className)){A.push(D[C]);}}return A;};function showOverlay(C,A,B){Overlay.get("",C,A,B);}function hideOverlay(A){Overlay.hide(A);}function loadCorporateNavMore(){if(!corporateNavMoreLoaded){new Ajax.Updater("corporateNavMoreDiv","/html/moreNavAjax.html",{method:"GET",onSuccess:function(){corporateNavMoreLoaded=true;}});}return false;}function repositionCallToActionOptions(){if($("callToActionMain")&&$("callToActionOptions")){var B=curtop=0;var A=$("callToActionMain");if(A.offsetParent){do{if(A.id=="bodyFrameObj"){break;}B+=A.offsetLeft;curtop+=A.offsetTop;}while(A=A.offsetParent);}$("callToActionOptions").style.left=(B+12)+"px";$("callToActionOptions").style.top=(curtop+27)+"px";}}function repositionSectionNavMoreChoices(){if($("sectionNavMore")&&$("sectionNavMoreChoices")){var B=curtop=0;var A=$("sectionNavMore");if(A.offsetParent){do{if(A.id=="sectionHead"){break;}B+=A.offsetLeft;curtop+=A.offsetTop;}while(A=A.offsetParent);}if(navigator.appVersion.indexOf("MSIE 6.0")>=0){B+=6;curtop+=3;}$("sectionNavMoreChoices").style.left=(B)+"px";$("sectionNavMoreChoices").style.top=(curtop+20)+"px";}}function repositionCorporateNavPersonal(){var B=Position.cumulativeOffset($("bodycontainer"));var A=$("bodycontainer").getDimensions();var D=Position.cumulativeOffset($("corporateNavPersonal"));var C=$("corporateNavPersonal").getDimensions();var E=B[0]+A.width-114;$("corporateAccountTable").style.left=E+"px";$("corporateAccountTable").style.top=(D[1]+C.height+1)+"px";}function repositionCorporateNavMore(){var A=Position.cumulativeOffset($("corporateMoreHref"));var B=$("corporateMoreHref").getDimensions();$("corporateNavMoreTable").style.left=(A[0])+"px";$("corporateNavMoreTable").style.top=(A[1]+B.height+1)+"px";}function showMenu(A){if($(A).style.display=="none"){if(A=="callToActionOptions"){repositionCallToActionOptions();$(A).show();setTimeout("Event.observe(document.body, 'click', closeCallToActionOptions)",100);}if(A=="sectionNavMoreChoices"){repositionSectionNavMoreChoices();$(A).show();setTimeout("Event.observe(document.body, 'click', closeSectionNavMoreChoices)",100);}if(A=="corporateAccountDiv"){repositionCorporateNavPersonal();$(A).show();setTimeout("Event.observe(document.body, 'click', closeAccountMenu)",100);}if(A=="corporateNavMoreDiv"){repositionCorporateNavMore();$(A).show();setTimeout("Event.observe(document.body, 'click', closeMoreMenu)",100);}}else{$(A).hide();if(A=="corporateAccountDiv"){Event.stopObserving(document.body,"click",closeAccountMenu);}if(A=="corporateNavMoreDiv"){Event.stopObserving(document.body,"click",closeMoreMenu);}if(A=="callToActionOptions"){Event.stopObserving(document.body,"click",closeCallToActionOptions);}if(A=="sectionNavMoreChoices"){Event.stopObserving(document.body,"click",closeSectionNavMoreChoices);}}}function closeCallToActionOptions(B){var A=Event.findElement(B,"div");if(A==document||(A&&A.id!="callToActionOptions")&&A.className!="callToActionMore"){if($("callToActionOptions")){$("callToActionOptions").hide();}Event.stopObserving(document.body,"click",closeCallToActionOptions);}}function closeSectionNavMoreChoices(B){var A=Event.findElement(B,"div");if(A==document||(A&&A.id!="sectionNavMore"&&A.id!="sectionNavMoreChoices")){if($("sectionNavMoreChoices")){$("sectionNavMoreChoices").hide();}Event.stopObserving(document.body,"click",closeSectionNavMoreChoices);}}function closeAccountMenu(B){var A=Event.findElement(B,"table");if(A==document||(A&&A.id!="corporateAccountTable")){if($("corporateAccountDiv")){$("corporateAccountDiv").hide();}Event.stopObserving(document.body,"click",closeAccountMenu);}}function closeMoreMenu(B){var A=Event.findElement(B,"table");if(A==document||(A&&A.id!="corporateNavMoreTable")){$("corporateNavMoreDiv").hide();Event.stopObserving(document.body,"click",closeMoreMenu);}}function joinWikizine(A){url="/tools/dashModules?ZineSettings=addToFavorites&addToDashboard=1&zineid="+A;var B=new Ajax.Request(url,{method:"get",onSuccess:function(E){var D=cleanWhitespace(E.responseXML.documentElement);var C=D.getElementsByTagName("status")[0].childNodes[0].nodeValue;$("joinIcon").remove();var G=$("recent");var F=document.createElement("div");F.className="joinMessage";(C=="Error")?F.innerHTML="There was a problem handling your request.  Please try again later.":F.innerHTML="<strong>Done!</strong>";G.appendChild(F);}});}function joinWikizine2(A){url="/tools/dashModules?ZineSettings=addToFavorites&addToDashboard=1&zineid="+A;var B=new Ajax.Request(url,{method:"get",onSuccess:function(E){var D=cleanWhitespace(E.responseXML.documentElement);var C=D.getElementsByTagName("status")[0].childNodes[0].nodeValue;var F=$("sectionActionJoinDiv");if(F){(C=="Error")?F.innerHTML="Error":F.innerHTML="Done!";}}});}var Loader={counter:0,getScript:function(C,F){var D=document;var E=D.createElement("script");E.type="text/javascript";E.id="loadScript_"+Loader.counter++;if(F){if(Browser.type=="IE"){var B=F;E.onreadystatechange=function(){if(this.readyState=="complete"){B();}};}else{E.onload=F;}}E.src="/javascript/$"+importVersion+"."+C;var A=D.getElementsByTagName("head")[0];A.appendChild(E);},getCSS:function(B,E){var C=document;var D=C.createElement("link");D.href="/stylesheet/$"+importVersion+"."+B;D.type="text/css";D.rel="stylesheet";D.id="loadCSS_"+Loader.counter++;if(E){D.onload=E;}var A=C.getElementsByTagName("head")[0];A.appendChild(D);}};var Blog={Stack:new Array(),Ping:{status:false,id:"pingWrapper",desc:"pingDesc",shell:'<div class="menuTitle"><div class="menuTab" id="oBlogPingTitle">Ping Your Blog</div><div class="menuClose" onclick="Overlay.hide(\'pingWrapper\')">X</div><div class="clear"></div><div id="pingDesc" class="menuDirection"></div></div>',showDone:function(A){$(Blog.Ping.desc).innerHTML="We are pinging your blog...please wait...";document.location.href="/account/blog?blogsetting=4&feed="+encodeURIComponent(A);},build:function(){if(Blog.Stack.length==0){document.location.href="/linkblog";}else{if(Blog.Stack.length==1){Blog.Ping.showDone(Blog.Stack[0][0]);}else{if(Blog.Stack.length>1){var B="<span>Choose which blog you would like to ping:</span><br/>";for(var A=0;A<Blog.Stack.length;A++){B+="<div onclick=\"Blog.Ping.showDone('"+Blog.Stack[A][0]+"')\">"+Blog.Stack[A][1]+"</div>";}$(Blog.Ping.desc).innerHTML=B;Blog.Ping.status=true;}}}},init:function(){if(!Blog.Ping.status){var A=document.createElement("div");A.id=Blog.Ping.id;A.innerHTML=this.shell;document.body.appendChild(A);Blog.Ping.build();}Overlay.show(Blog.Ping.id,400,200);}}};var SO=new Array();var image_arr=new Array();function $ac(A,B){A.appendChild(B);}function sliderObject(name,xobjs,numshown,basewidth,objarr,target,type,config_id,refurl){this.config_id=config_id;this.side="left";this.type=type;this.name=name;this.num_objs=xobjs;this.curr_page=1;this.interval=1;this.numshown=numshown;this.numloaded=0;this.width=basewidth;this.refurl=refurl;this.num_pages=Math.ceil(xobjs/numshown);if(navigator.appName!="Microsoft Internet Explorer"){this.m_left_iter=20;}else{this.m_left_iter=10;}this.Container=document.createElement("div");this.Container.style.paddingTop="3px";this.Container.style.paddingBottom="3px";this.Container.style.overflow="hidden";this.Container.style.width=basewidth+"px";this.target=target;this.Container.id="zSliderContainer";this.Holder=document.createElement("div");this.Holder.style.width=((basewidth*this.num_pages)+10)+"px";this.Holder.style.padding="0px 0px 0px 5px";if(this.numshown==5){this.Holder.style.marginTop="3px";}else{this.Holder.style.marginTop="0px";}this.Holder.style.marginBottom="10px";$ac(this.Container,this.Holder);var div_clear=$ce("div");div_clear.className="clear";$ac(this.Container,div_clear);this.Objects=new Array();this.childobjects=new Array();this.obj_arr=objarr;sliderObject.prototype.getbaseitems=function(obj){if(this.num_objs>(2*numshown)){this.loadbaseitemrange(obj,0,(2*numshown));}else{this.loadbaseitemrange(obj,0,this.num_objs);}};sliderObject.prototype.loadbaseitemrange=function(obj,start,stop){this.curr_page=1;var str="";var end=this.numshown;if(stop<this.numshown){end=stop;}for(var i=start;i<stop;i++){this.addItem(i);this.numloaded++;}var div=document.createElement("div");div.className="clear";if(end!=this.numshown){var i=this.numshown-end;this.Holder.style.width=(this.width*this.numshown)+"px";for(i;i>start;i--){var div2=$ce("div");div2.innerHTML="Click to <br/>Add Video";div2.className="zRailHeader";var tempstr=this.config_id;var url=this.refurl;div2.onclick=function(){if(!User.name){User.login();return ;}EasyAdd.get(url,tempstr,8);};div2.style.width="124px";div2.style.height="59px";div2.style.paddingTop="35px";div2.style.marginTop="0px";var in_div=$ce("div");in_div.style.textAlign="center";in_div.verticalAlign="top";in_div.style.cursor="pointer";in_div.style.cssFloat="left";in_div.style.styleFloat="left";in_div.style.padding="3px";in_div.style.border="1px solid #CCC";in_div.style.marginRight="10px";in_div.style.marginBottom="10px";$ac(in_div,div2);$ac(this.Holder,in_div);}}$ac(this.Container,div);$ac(obj,this.Container);};sliderObject.prototype.setPosition=function(num){var obj=this.Holder;obj.style.marginLeft=(Number(obj.style.marginLeft.replace("px",""))+num)+"px";};sliderObject.prototype.scrollright=function(times){if(times<=0){return true;}else{if(times<this.m_left_iter){this.setPosition(-times);}else{this.setPosition(-this.m_left_iter);}setTimeout(this.name+".scrollright("+(times-this.m_left_iter)+")",this.interval);}return false;};sliderObject.prototype.scrollleft=function(times){if(times<=0){return true;}else{if(times<this.m_left_iter){this.setPosition(times);}else{this.setPosition(this.m_left_iter);}setTimeout(this.name+".scrollleft("+(times-this.m_left_iter)+")",this.interval);}return false;};sliderObject.prototype.setpage=function(num){if(this.num_pages==1||this.num_pages==0){return false;}if((this.curr_page==1&&num==-1)||(this.curr_page==this.num_pages&&num==1)){return false;}else{this.clearHighlight();if(num==-1){this.scrollleft(this.width);}else{this.scrollright(this.width);}this.curr_page+=num;if(this.curr_page*numshown>=this.numloaded){var loadmax=(this.curr_page+1)*numshown;if(loadmax>this.num_objs){loadmax=this.num_objs;}for(var i=this.curr_page*numshown;i<loadmax;i++){this.addItem(i);this.numloaded++;}}}if(this.curr_page==1){$(this.target+"_tPrev").style.color="#555";setOpacity(0.2,this.target+"_tPrev");}else{$(this.target+"_tPrev").style.color="#0A3C74";setOpacity(1,this.target+"_tPrev");}if(this.curr_page==this.num_pages){$(this.target+"_tNext").style.color="#555";setOpacity(0.2,this.target+"_tNext");}else{$(this.target+"_tNext").style.color="#0A3C74";setOpacity(1,this.target+"_tNext");}};sliderObject.prototype.addItem=function(num){var obj_div=document.createElement("div");var img=document.createElement("img");obj_div.style.textAlign="center";obj_div.style.cssFloat="left";obj_div.style.styleFloat="left";obj_div.style.fontWeight="bold";obj_div.style.verticalAlign="top";obj_div.style.marginRight="10px";img.src=decodeURIComponent(unescape(this.obj_arr[num].ThumbURL));if(this.target=="mugshot_0"){obj_div.style.width="98px";img.title="Click to change this to your mugshot.";img.id="image_0_"+this.obj_arr[num].id;}else{obj_div.style.width="138px";img.title="Click to play - "+decodeURIComponent(unescape(this.obj_arr[num].Name));}img.className="";img.style.padding="3px";img.style.cursor="pointer";img.style.border="1px solid #CCC";if(this.target!="mugshot_0"){img.style.width="130px";img.style.height="97px";}img.onmouseover=function(){this.style.border="1px solid #F17800";};img.onmouseout=function(){if(this.className!="setimg"){this.style.border="1px solid #CCC";}else{this.style.border="1px solid #105CB6";}};var tempobj=this;img.onclick=function(e){if(!e){e=window.event;}var myWidth=0,myHeight=0;if(typeof (window.innerWidth)=="number"){myWidth=window.innerWidth;myHeight=window.innerHeight;}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){myWidth=document.documentElement.clientWidth;myHeight=document.documentElement.clientHeight;}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){myWidth=document.body.clientWidth;myHeight=document.body.clientHeight;}}}if((e.clientX+600)>myWidth){tempobj.side="right";}else{tempobj.side="left";}tempobj.setItem(num);};img.onerror=function(){this.src="/images/no-video.gif";};this.childobjects.push(img);$ac(obj_div,img);var div=$ce("div");div.className="clear";$ac(obj_div,div);if(this.target!="mugshot_0"){var div_text=$ce("div");div_text.innerHTML="<?cs var:mod.Config.ShowRatings ?>";$ac(obj_div,div_text);}if(typeof (this.obj_arr[num].Name)!="undefined"){var titlenode=$ce("div");titlenode.style.fontSize="12px";titlenode.style.fontFamily="Arial";titlenode.style.fontWeight="bold";titlenode.innerHTML=decodeURIComponent(unescape(this.obj_arr[num].ShortName));$ac(obj_div,titlenode);}$ac(this.Holder,obj_div);this.Objects.push(obj_div);};sliderObject.prototype.setItem=function(sel){if(this.numshown!=1&&this.numshown!=2){if(this.target!="mugshot_0"){showVideo(this,this.target,this.obj_arr[sel],sel);}else{for(var i=0;i<this.obj_arr.length;i++){var temp=$(eval('"image_0_'+this.obj_arr[i].id+'"'));if(i!=sel){temp.style.border="1px solid #CCC";temp.className="";}else{document.images.mugshot.src=this.obj_arr[sel].URL;$("baseimg").value=this.obj_arr[sel].id;temp.className="setimg";}}}}else{var obj=$(this.target);$Show(this.target);obj.style.zIndex="9";if(this.side=="left"){if(navigator.appName!="Microsoft Internet Explorer"){if(this.type=="spside"){obj.style.marginLeft=(this.width+20)+"px";}else{obj.style.marginLeft=(this.width+20)+"px";}}else{if(this.type=="spside"){obj.style.marginLeft=(this.width-45)+"px";}else{obj.style.marginLeft=(this.width-45)+"px";}}}else{if(this.side=="right"){var t=$(this.target);document.body.appendChild(t);var offset=Position.cumulativeOffset($(this.target.split("_")[2]));t.style.left=offset[0]-470+"px";t.style.top=offset[1]-30+"px";}}var tempstr=this.target.split("_");var mod=$(tempstr[2]);if(this.type=="spside"){if(mod){mod.onmouseover="";}}showVideo(this,this.target,this.obj_arr[sel],sel);}document.location.href="#"+this.target+"_anchor";};sliderObject.prototype.clearHighlight=function(){for(var i=0;i<this.childobjects.length;i++){setOpacity(0.99,this.childobjects[i]);}};sliderObject.prototype.highlight=function(sel){var obj=this.childobjects[sel];setOpacity(0.99,obj);for(var i=0;i<this.childobjects.length;i++){if(i!=sel){setOpacity(0.4,this.childobjects[i]);this.Objects[i].style.fontColor="#EEE";}}obj.style.fontColor="#CCC";};sliderObject.prototype.getContainer=function(){return this.Container;};sliderObject.prototype.showPlayer=function(sel){for(i=1;i<=1100;i++){setTimeout("stretch("+i+",'"+this.target+"')",i);}};sliderObject.prototype.closePlayer=function(sel){$Hide(this.target);var obj=$(this.target+"_disp");obj.innerHTML="";if(this.type=="spside"){var mod=$(sel);if(mod){mod.onmouseover=function(){showGlow(sel);};}}};}function stretch(C,B){var A=$(B);A.style.height=C/3+"px";}function closeMainPlayer(A){$Hide(A);}function closePlayer(B){$Hide("sidePlayer_"+B);var A=$(B);A.onmouseover=function(){showGlow(B);};}function showCode(B,A){var C='&lt;div id="zimbio_player"&gt; &lt;/div&gt;';C+='&lt;div class="zimbio_outline"&gt; &lt;a href="http://'+A+'"&gt; &lt;img class="z_logo" src="http://'+B+'/images/zLogoPilot.gif" /&gt; &lt;/a&gt;';C+='&lt;script type="text/javascript" src="http://'+A+'/json"&gt; &lt;/script&gt;&lt;/div&gt;';return C;}function showVideo(A,E,C,B){var D=$(E+"_disp");var F=$(E+"_title");F.innerHTML=decodeURIComponent(unescape(C.Name));D.innerHTML="";if(navigator.appName=="Microsoft Internet Explorer"){D.innerHTML='<object width="425" height="350" type="application/x-shockwave-flash"><param name="movie" value="'+decodeURIComponent(unescape(C.videoURL))+'"></param><param name="wmode" value="transparent"></param></object>';}else{D.innerHTML='<object width="425" height="350"><param name="movie" value="'+decodeURIComponent(unescape(C.videoURL))+'"></param><param name="wmode" value="transparent"></param>';D.innerHTML+='<embed src="'+decodeURIComponent(unescape(C.videoURL))+'" type="application/x-shockwave-flash" width="425" height="350" wmode="transparent"></embed>';D.innerHTML+="</object>";}$Show(E);A.highlight(B);}function Rating(A){this.id=guid();this.idString=A.id;this.setCommunityRating(new Number(A.avg_rating));this.setUserRating(new Number(A.user_rating));}Rating.iconWidth=12,Rating.iconHeight=12,Rating.numIcons=5,Rating.maxRating=5,Rating.ratingWidth=60,Rating.blurb="Click to rate",Rating.blurbPrefix='Click to rate this - "',Rating.blurbSuffix='"',Rating.ratingsBlurbs={1:Rating.prefix+"Worthless"+Rating.suffix,2:Rating.prefix+"Eh.."+Rating.suffix,3:Rating.prefix+"Not Bad"+Rating.suffix,4:Rating.prefix+"Good Stuff"+Rating.suffix,5:Rating.prefix+"Love It!"+Rating.suffix},Rating.sliderIDPrefix="slider_",Rating.frameIDPrefix="rating_box",Rating.cssClass="rating_slider",Rating.userClass="user_rating",Rating.communityClass="community_rating",Rating.frameClass="rating_box";Rating.prototype.setUserRating=function(A){this.userRating=(A>Rating.maxRating)?Rating.maxRating:A;if(this.showUserRating()){this.setSliderWidth(this.userRating);}};Rating.prototype.setCommunityRating=function(A){this.communityRating=(A>Rating.maxRating)?Rating.maxRating:A;if(!this.showUserRating()){this.setSliderWidth(this.communityRating);}};Rating.prototype.getRating=function(){return(this.userRating>0)?this.userRating:this.communityRating;};Rating.prototype.getCSSClass=function(){return(this.userRating>0)?Rating.userClass:Rating.communityClass;};Rating.prototype.setCSSClass=function(A){var B=this.getSliderElement();if(!B){return false;}if(B.className!=A){B.className=A;}return true;};Rating.prototype.setSliderWidth=function(A){if(!A){var A=this.getRating();}this.sliderWidth=(A*Rating.iconWidth);var B=this.getSliderElement();if(!B){return false;}B.style.width=(this.sliderWidth)+"px";};Rating.prototype.getSliderWidth=function(){return this.sliderWidth||0;};Rating.prototype.getFrameID=function(){return(Rating.frameClass+this.id);};Rating.prototype.showUserRating=function(){return(this.userRating>0);};Rating.prototype.getElement=function(){var B=this.getMainElement();if(B){return B;}B=document.createElement("DIV");B.className=Rating.frameClass;B.id=this.getFrameID();B.onmousemove=this.fc_onmousemove();B.onmouseout=this.fc_onmouseout();B.onmouseover=this.fc_onmouseover();B.onclick=this.fc_onclick();B.title=Rating.blurb;var A=document.createElement("DIV");A.className=this.getCSSClass();A.id=Rating.sliderIDPrefix+this.id;A.style.height=Rating.iconHeight+"px";A.style.width=this.getSliderWidth()+"px";this.elementID=B.id;B.appendChild(A);return B;};Rating.prototype.updateRating=function(B){if(B!=this.userRating){this.setUserRating(B);var A="/tools/rateit/js?RID="+this.idString+"&Rating="+B;RPC(A,"GET",doNothing);}};function doNothing(){}Rating.prototype.getMainElement=function(){return document.getElementById(this.getFrameID());};Rating.prototype.getSliderElement=function(){return document.getElementById(Rating.sliderIDPrefix+this.id);};Rating.prototype.redraw=function(){var C=this.getSliderElement();if(!C){return false;}var B=this.getRating();var A=this.getCSSClass();if(C.className!=A){C.className=A;}C.style.width=(Rating.ratingWidth*(B/Rating.maxRating))+"px";};Rating.prototype.getMouseRating=function(A){var B=A.offsetX||A.layerX||0;return(Math.floor((Rating.iconWidth+B)/Rating.iconWidth));};Rating.prototype.fc_onmousemove=function(){var A=this;return function(C){var B=A.getMouseRating(C||window.event);A.setSliderWidth(B);};};Rating.prototype.fc_onmouseover=function(A){var B=this;return function(){B.setCSSClass(Rating.userClass);};};Rating.prototype.fc_onmouseout=function(A){var B=this;return function(C){B.redraw();};};Rating.prototype.fc_onclick=function(A){var B=this;return function(D){var C=B.getMouseRating(D||window.event);B.updateRating(C);};};function getChildrenByClass(C,E){var A=new Array();for(var B=0;B<C.childNodes.length;B++){var D=C.childNodes[B];if(D.className){if(D.className==E){A.push(D);}}if(D.hasChildNodes()){A=A.concat(getChildrenByClass(D,E));}}return A;}function guid(){if(!window.__id){window.__id=0;}return ++window.__id;}function RPC(B,A,E){var C=cx();var D=RPC_createHandler(C,E);C.onreadystatechange=D;C.open(A,B,true);C.send(null);}function RPC_createHandler(B,A){return function(){if(B.readyState==4){A(B);}};}function cx(){try{return new XMLHttpRequest();}catch(A){return new ActiveXObject("Msxml2.XMLHTTP");}}function mixin(C,B,A){if(!A){var A=true;}for(index in B){if(!C[index]||A){C[index]=B[index];}}}function library_rater(){var C=ratedObjects;for(i=0;i<C.length;i++){var D=C[i];var E=D.id.split(";");var B={id:E[0],avg_rating:E[1],user_rating:E[2]};var A=new Rating(B).getElement();D.appendChild(A);}}var News={keywordNum:3,feedNum:2,errorMessage:"No Feeds were found at this URL.  Please check your URL and try again.",resultsMessage:"<div>The following news feeds are available at this URL:</div>",submitForm:function(){$("newsForm").submit();},addKeyword:function(){var A=Builder.node("div",{id:"keywordRow_"+News.keywordNum,className:"keywordRow"},[Builder.node("input",{className:"newsKeyword",type:"text",name:"keyword."+News.keywordNum}),Builder.node("a",{className:"optionRemove",href:"javascript:News.removeKeyword("+News.keywordNum+")"},"Remove"),]);$("keywordChain").appendChild(A);A.down().focus();News.keywordNum++;$("num_keywords").value=News.keywordNum;},removeKeyword:function(A){$("keywordRow_"+A).remove();},buildOverlay:function(){var B=$ce("div");B.id="news_wrapper";B.className="zLay";B.style.display="none";var A="";A+='<div class="menuTitle">';A+='<div class="menuTab" id="iNewsTitle">Add News Source</div>';A+='<div class="menuClose" onclick="Browser.New.hideOverlay(\'news_wrapper\');">X</div>';A+='<div style="clear:both"></div>';A+="</div>";A+='<div class="menuBox">';A+="<div>here is my overlay</div>";A+="</div>";document.body.appendChild(B);B.innerHTML=A;},show:function(){Browser.New.initOverlay("news_wrapper","600","400");$("news_wrapper").style.display="block";},showResults:function(json){var Result=eval(json);if(Result.count==0){$("loadingFeed").innerHTML=News.errorMessage;}else{News.hideLoading();var chain=$("feedResults");chain.innerHTML=News.resultsMessage;for(var i=0;i<Result.results.length;i++){var ne=Builder.node("div",{id:"results_"+i,className:""},[Builder.node("div",{className:"feedTitle"},Result.results[i].title),Builder.node("div",{className:"feedFullURL"},Result.results[i].feedUrl),Builder.node("div",{className:"feedDesc"},Result.results[i].desc),Builder.node("a",{className:"optionAdd addFeed",href:"javascript:News.addFeed('"+Result.results[i].title+"', '"+Result.results[i].feedUrl+"')"},"+ Add This Feed"),Builder.node("div",{className:"clear"}),]);chain.appendChild(ne);}chain.style.display="block";}},showLoading:function(){var A=$("loadingFeed");A.innerHTML="Loading...please wait...";A.style.display="block";$("feedResults").style.display="none";},hideLoading:function(){$("loadingFeed").style.display="none";},getFeed:function(){News.showLoading();var D=$("FeedURL").value;if(D==""){alert(1);return ;}var A="/tools/rssinfo";var B="url="+encodeURIComponent(D);var C=new Ajax.Request(A,{method:"get",parameters:B,onSuccess:function(E){News.showResults(E.responseText);}});},addFeed:function(B,A){var C=Builder.node("div",{id:"feedRow_"+News.feedNum,className:"feedRow"},[Builder.node("div",{},[Builder.node("a",{className:"newsFeed",target:"_new",href:A},B)]),Builder.node("input",{className:"newsFeed",type:"hidden",name:"feed."+News.feedNum,value:A}),Builder.node("a",{className:"optionRemoveFeed",href:"javascript:News.removeFeed("+News.feedNum+")"},"Remove"),Builder.node("div",{className:"clear"})]);$("feedChain").appendChild(C);News.feedNum++;$("num_feeds").value=News.feedNum;Browser.New.hideOverlay("news_wrapper");},removeFeed:function(A){$("feedRow_"+A).remove();},toggleZimbio:function(){var B=$("backfill");var A=$("optionZimbio");if(B.value==1){B.value=0;A.innerHTML="Enable";setOpacity(0.25,"newsFeedZimbio");}else{B.value=1;A.innerHTML="Disable";setOpacity(0.99,"newsFeedZimbio");}},setProvider:function(){toggleContent("pickProvider");var B=$("providerSelect");var A=B.options[B.options.selectedIndex];var C=$("providerText");if(B.value==""){C.innerHTML="No News Partner Selected";}else{C.innerHTML="Stories From "+A.text;}},setImageSize:function(C){var B=$(C);var A=new Image();A.src=B.src;if(A.width){if(A.width>160){B.style.width="160px";B.style.display="block";}if(Math.min(A.width,A.height)<50){B.up("div").style.display="none";}}}};var Prototype={Version:"1.5.0_rc1",BrowserFeatures:{XPath:!!document.evaluate},ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)",emptyFunction:function(){},K:function(A){return A;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(A,C){for(var B in C){A[B]=C[B];}return A;};Object.extend(Object,{inspect:function(A){try{if(A===undefined){return"undefined";}if(A===null){return"null";}return A.inspect?A.inspect():A.toString();}catch(B){if(B instanceof RangeError){return"...";}throw B;}},keys:function(A){var B=[];for(var C in A){B.push(C);}return B;},values:function(B){var A=[];for(var C in B){A.push(B[C]);}return A;},clone:function(A){return Object.extend({},A);}});Function.prototype.bind=function(){var A=this,C=$A(arguments),B=C.shift();return function(){return A.apply(B,C.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(C){var A=this,B=$A(arguments),C=B.shift();return function(D){return A.apply(C,[(D||window.event)].concat(B).concat($A(arguments)));};};Object.extend(Number.prototype,{toColorPart:function(){var A=this.toString(16);if(this<16){return"0"+A;}return A;},succ:function(){return this+1;},times:function(A){$R(0,this,true).each(A);return this;}});var Try={these:function(){var C;for(var B=0;B<arguments.length;B++){var A=arguments[B];try{C=A();break;}catch(D){}}return C;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(B,A){this.callback=B;this.frequency=A;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},stop:function(){if(!this.timer){return ;}clearInterval(this.timer);this.timer=null;},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback(this);}finally{this.currentlyExecuting=false;}}}};Object.extend(String.prototype,{gsub:function(E,C){var A="",D=this,B;C=arguments.callee.prepareReplacement(C);while(D.length>0){if(B=D.match(E)){A+=D.slice(0,B.index);A+=(C(B)||"").toString();D=D.slice(B.index+B[0].length);}else{A+=D,D="";}}return A;},sub:function(C,A,B){A=this.gsub.prepareReplacement(A);B=B===undefined?1:B;return this.gsub(C,function(D){if(--B<0){return D[0];}return A(D);});},scan:function(B,A){this.gsub(B,A);return this;},truncate:function(B,A){B=B||30;A=A===undefined?"...":A;return this.length>B?this.slice(0,B-A.length)+A:this;},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var B=new RegExp(Prototype.ScriptFragment,"img");var A=new RegExp(Prototype.ScriptFragment,"im");return(this.match(B)||[]).map(function(C){return(C.match(A)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(script){return eval(script);});},escapeHTML:function(){var B=document.createElement("div");var A=document.createTextNode(this);B.appendChild(A);return B.innerHTML;},unescapeHTML:function(){var A=document.createElement("div");A.innerHTML=this.stripTags();return A.childNodes[0]?A.childNodes[0].nodeValue:"";},toQueryParams:function(){var A=this.strip().match(/[^?]*$/)[0];if(!A){return{};}var B=A.split("&");return B.inject({},function(F,C){var E=C.split("=");var D=E[1]?decodeURIComponent(E[1]):undefined;F[decodeURIComponent(E[0])]=D;return F;});},toArray:function(){return this.split("");},camelize:function(){var C=this.split("-");if(C.length==1){return C[0];}var A=this.indexOf("-")==0?C[0].charAt(0).toUpperCase()+C[0].substring(1):C[0];for(var B=1,E=C.length;B<E;B++){var D=C[B];A+=D.charAt(0).toUpperCase()+D.substring(1);}return A;},inspect:function(B){var A=this.replace(/\\/g,"\\\\");if(B){return'"'+A.replace(/"/g,'\\"')+'"';}else{return"'"+A.replace(/'/g,"\\'")+"'";}}});String.prototype.gsub.prepareReplacement=function(B){if(typeof B=="function"){return B;}var A=new Template(B);return function(C){return A.evaluate(C);};};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(A,B){this.template=A.toString();this.pattern=B||Template.Pattern;},evaluate:function(A){return this.template.gsub(this.pattern,function(B){var C=B[1];if(C=="\\"){return B[2];}return C+(A[B[3]]||"").toString();});}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(B){var A=0;try{this._each(function(D){try{B(D,A++);}catch(E){if(E!=$continue){throw E;}}});}catch(C){if(C!=$break){throw C;}}return this;},eachSlice:function(C,B){var A=-C,D=[],E=this.toArray();while((A+=C)<E.length){D.push(E.slice(A,A+C));}return D.collect(B||Prototype.K);},all:function(B){var A=true;this.each(function(D,C){A=A&&!!(B||Prototype.K)(D,C);if(!A){throw $break;}});return A;},any:function(B){var A=false;this.each(function(D,C){if(A=!!(B||Prototype.K)(D,C)){throw $break;}});return A;},collect:function(B){var A=[];this.each(function(D,C){A.push(B(D,C));});return A;},detect:function(B){var A;this.each(function(D,C){if(B(D,C)){A=D;throw $break;}});return A;},findAll:function(B){var A=[];this.each(function(D,C){if(B(D,C)){A.push(D);}});return A;},grep:function(C,B){var A=[];this.each(function(F,E){var D=F.toString();if(D.match(C)){A.push((B||Prototype.K)(F,E));}});return A;},include:function(A){var B=false;this.each(function(C){if(C==A){B=true;throw $break;}});return B;},inGroupsOf:function(C,B){B=B||null;var A=this.eachSlice(C);if(A.length>0){(C-A.last().length).times(function(){A.last().push(B);});}return A;},inject:function(A,B){this.each(function(D,C){A=B(A,D,C);});return A;},invoke:function(B){var A=$A(arguments).slice(1);return this.collect(function(C){return C[B].apply(C,A);});},max:function(B){var A;this.each(function(D,C){D=(B||Prototype.K)(D,C);if(A==undefined||D>=A){A=D;}});return A;},min:function(B){var A;this.each(function(D,C){D=(B||Prototype.K)(D,C);if(A==undefined||D<A){A=D;}});return A;},partition:function(C){var B=[],A=[];this.each(function(E,D){((C||Prototype.K)(E,D)?B:A).push(E);});return[B,A];},pluck:function(B){var A=[];this.each(function(D,C){A.push(D[B]);});return A;},reject:function(B){var A=[];this.each(function(D,C){if(!B(D,C)){A.push(D);}});return A;},sortBy:function(A){return this.collect(function(C,B){return{value:C,criteria:A(C,B)};}).sort(function(E,D){var C=E.criteria,B=D.criteria;return C<B?-1:C>B?1:0;}).pluck("value");},toArray:function(){return this.collect(Prototype.K);},zip:function(){var B=Prototype.K,A=$A(arguments);if(typeof A.last()=="function"){B=A.pop();}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D));});},inspect:function(){return"#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(D){if(!D){return[];}if(D.toArray){return D.toArray();}else{var B=[];for(var A=0,C=D.length;A<C;A++){B.push(D[A]);}return B;}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(B){for(var A=0,C=this.length;A<C;A++){B(this[A]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(A){return A!=undefined||A!=null;});},flatten:function(){return this.inject([],function(B,A){return B.concat(A&&A.constructor==Array?A.flatten():[A]);});},without:function(){var A=$A(arguments);return this.select(function(B){return !A.include(B);});},indexOf:function(A){for(var B=0,C=this.length;B<C;B++){if(this[B]==A){return B;}}return -1;},reverse:function(A){return(A!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(){return this.inject([],function(B,A){return B.include(A)?B:B.concat([A]);});},clone:function(){return[].concat(this);},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";}});Array.prototype.toArray=Array.prototype.clone;var Hash={_each:function(B){for(var A in this){var C=this[A];if(typeof C=="function"){continue;}var D=[A,C];D.key=A;D.value=C;B(D);}},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},merge:function(A){return $H(A).inject(this,function(B,C){B[C.key]=C.value;return B;});},toQueryString:function(){return this.map(function(A){if(!A.value&&A.value!==0){A[1]="";}if(!A.key){return ;}return A.map(encodeURIComponent).join("=");}).join("&");},inspect:function(){return"#<Hash:{"+this.map(function(A){return A.map(Object.inspect).join(": ");}).join(", ")+"}>";}};function $H(A){var B=Object.extend({},A||{});Object.extend(B,Enumerable);Object.extend(B,Hash);return B;}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(C,A,B){this.start=C;this.end=A;this.exclusive=B;},_each:function(A){var B=this.start;while(this.include(B)){A(B);B=B.succ();}},include:function(A){if(A<this.start){return false;}if(this.exclusive){return A<this.end;}return A<=this.end;}});var $R=function(C,A,B){return new ObjectRange(C,A,B);};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(A){this.responders._each(A);},register:function(A){if(!this.include(A)){this.responders.push(A);}},unregister:function(A){this.responders=this.responders.without(A);},dispatch:function(D,B,C,A){this.each(function(E){if(typeof E[D]=="function"){try{E[D].apply(E,[B,C,A]);}catch(F){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(A){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:""};Object.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();this.options.parameters=$H(typeof this.options.parameters=="string"?this.options.parameters.toQueryParams():this.options.parameters);}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(B,A){this.transport=Ajax.getTransport();this.setOptions(A);this.request(B);},request:function(B){var D=this.options.parameters;if(D.any()){D["_"]="";}if(!["get","post"].include(this.options.method)){D["_method"]=this.options.method;this.options.method="post";}this.url=B;if(this.options.method=="get"&&D.any()){this.url+=(this.url.indexOf("?")>=0?"&":"?")+D.toQueryString();}try{Ajax.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method.toUpperCase(),this.url,this.options.asynchronous,this.options.username,this.options.password);if(this.options.asynchronous){setTimeout(function(){this.respondToReadyState(1);}.bind(this),10);}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();var A=this.options.method=="post"?(this.options.postBody||D.toQueryString()):null;this.transport.send(A);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange();}}catch(C){this.dispatchException(C);}},onStateChange:function(){var A=this.transport.readyState;if(A>1){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var D={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};if(this.options.method=="post"){D["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){D["Connection"]="close";}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(typeof C.push=="function"){for(var B=0;B<C.length;B+=2){D[C[B]]=C[B+1];}}else{$H(C).each(function(E){D[E.key]=E.value;});}}for(var A in D){this.transport.setRequestHeader(A,D[A]);}},success:function(){return !this.transport.status||(this.transport.status>=200&&this.transport.status<300);},respondToReadyState:function(A){var C=Ajax.Request.Events[A];var E=this.transport,B=this.evalJSON();if(C=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(E,B);}catch(D){this.dispatchException(D);}}try{(this.options["on"+C]||Prototype.emptyFunction)(E,B);Ajax.Responders.dispatch("on"+C,this,E,B);}catch(D){this.dispatchException(D);}if(C=="Complete"){if((this.getHeader("Content-type")||"").strip().match(/^(text|application)\/(x-)?(java|ecma)script(;.*)?$/i)){this.evalResponse();}this.transport.onreadystatechange=Prototype.emptyFunction;}},getHeader:function(A){try{return this.transport.getResponseHeader(A);}catch(B){return null;}},evalJSON:function(){try{var json=this.getHeader("X-JSON");return json?eval("("+json+")"):null;}catch(e){return null;}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},dispatchException:function(A){(this.options.onException||Prototype.emptyFunction)(this,A);Ajax.Responders.dispatch("onException",this,A);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(A,C,B){this.container={success:(A.success||A),failure:(A.failure||(A.success?null:A))};this.transport=Ajax.getTransport();this.setOptions(B);var D=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(F,E){this.updateContent();D(F,E);}).bind(this);this.request(C);},updateContent:function(){var B=this.container[this.success()?"success":"failure"];var A=this.transport.responseText;if(!this.options.evalScripts){A=A.stripScripts();}if(B=$(B)){if(this.options.insertion){new this.options.insertion(B,A);}else{B.update(A);}}if(this.success()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10);}}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(A,C,B){this.setOptions(B);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=A;this.url=C;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(A){if(this.options.decay){this.decay=(A.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=A.responseText;}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});function $(B){if(arguments.length>1){for(var A=0,D=[],C=arguments.length;A<C;A++){D.push($(arguments[A]));}return D;}if(typeof B=="string"){B=document.getElementById(B);}return Element.extend(B);}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(F,B){var D=[];var E=document.evaluate(F,$(B)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var C=0,A=E.snapshotLength;C<A;C++){D.push(E.snapshotItem(C));}return D;};}document.getElementsByClassName=function(D,A){if(Prototype.BrowserFeatures.XPath){var G=".//*[contains(concat(' ', @class, ' '), ' "+D+" ')]";return document._getElementsByXPath(G,A);}else{var C=($(A)||document.body).getElementsByTagName("*");var F=[],H;for(var B=0,E=C.length;B<E;B++){H=C[B];if(Element.hasClassName(H,D)){F.push(Element.extend(H));}}return F;}};if(!window.Element){var Element=new Object();}Element.extend=function(C){if(!C){return ;}if(_nativeExtensions||C.nodeType==3){return C;}if(!C._extended&&C.tagName&&C!=window){var B=Object.clone(Element.Methods),A=Element.extend.cache;if(C.tagName=="FORM"){Object.extend(B,Form.Methods);}if(["INPUT","TEXTAREA","SELECT"].include(C.tagName)){Object.extend(B,Form.Element.Methods);}for(var E in B){var D=B[E];if(typeof D=="function"){C[E]=A.findOrStore(D);}}var B=Object.clone(Element.Methods.Simulated),A=Element.extend.cache;for(var E in B){var D=B[E];if("function"==typeof D&&!(E in C)){C[E]=A.findOrStore(D);}}}C._extended=true;return C;};Element.extend.cache={findOrStore:function(A){return this[A]=this[A]||function(){return A.apply(null,[this].concat($A(arguments)));};}};Element.Methods={visible:function(A){return $(A).style.display!="none";},toggle:function(A){A=$(A);Element[Element.visible(A)?"hide":"show"](A);return A;},hide:function(A){$(A).style.display="none";return A;},show:function(A){$(A).style.display="";return A;},remove:function(A){A=$(A);A.parentNode.removeChild(A);return A;},update:function(B,A){A=typeof A=="undefined"?"":A.toString();$(B).innerHTML=A.stripScripts();setTimeout(function(){A.evalScripts();},10);return B;},replace:function(C,B){C=$(C);if(C.outerHTML){C.outerHTML=B.stripScripts();}else{var A=C.ownerDocument.createRange();A.selectNodeContents(C);C.parentNode.replaceChild(A.createContextualFragment(B.stripScripts()),C);}setTimeout(function(){B.evalScripts();},10);return C;},inspect:function(B){B=$(B);var A="<"+B.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(F){var E=F.first(),C=F.last();var D=(B[E]||"").toString();if(D){A+=" "+C+"="+D.inspect(true);}});return A+">";},recursivelyCollect:function(A,C){A=$(A);var B=[];while(A=A[C]){if(A.nodeType==1){B.push(Element.extend(A));}}return B;},ancestors:function(A){return $(A).recursivelyCollect("parentNode");},descendants:function(A){A=$(A);return $A(A.getElementsByTagName("*"));},previousSiblings:function(A){return $(A).recursivelyCollect("previousSibling");},nextSiblings:function(A){return $(A).recursivelyCollect("nextSibling");},siblings:function(A){A=$(A);return A.previousSiblings().reverse().concat(A.nextSiblings());},match:function(B,A){B=$(B);if(typeof A=="string"){A=new Selector(A);}return A.match(B);},up:function(B,C,A){return Selector.findElement($(B).ancestors(),C,A);},down:function(B,C,A){return Selector.findElement($(B).descendants(),C,A);},previous:function(B,C,A){return Selector.findElement($(B).previousSiblings(),C,A);},next:function(B,C,A){return Selector.findElement($(B).nextSiblings(),C,A);},getElementsBySelector:function(){var A=$A(arguments),B=$(A.shift());return Selector.findChildElements(B,A);},getElementsByClassName:function(A,B){A=$(A);return document.getElementsByClassName(B,A);},getHeight:function(A){A=$(A);return A.offsetHeight;},classNames:function(A){return new Element.ClassNames(A);},hasClassName:function(A,B){if(!(A=$(A))){return ;}var C=A.className;if(C.length==0){return false;}if(C==B||C.match(new RegExp("(^|\\s)"+B+"(\\s|$)"))){return true;}return false;},addClassName:function(A,B){if(!(A=$(A))){return ;}Element.classNames(A).add(B);return A;},removeClassName:function(A,B){if(!(A=$(A))){return ;}Element.classNames(A).remove(B);return A;},observe:function(){Event.observe.apply(Event,arguments);return $A(arguments).first();},stopObserving:function(){Event.stopObserving.apply(Event,arguments);return $A(arguments).first();},cleanWhitespace:function(B){B=$(B);var C=B.firstChild;while(C){var A=C.nextSibling;if(C.nodeType==3&&!/\S/.test(C.nodeValue)){B.removeChild(C);}C=A;}return B;},empty:function(A){return $(A).innerHTML.match(/^\s*$/);},childOf:function(B,A){B=$(B),A=$(A);while(B=B.parentNode){if(B==A){return true;}}return false;},scrollTo:function(B){B=$(B);var A=B.x?B.x:B.offsetLeft,C=B.y?B.y:B.offsetTop;window.scrollTo(A,C);return B;},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?A.getPropertyValue(C):null;}else{if(B.currentStyle){D=B.currentStyle[C.camelize()];}}}if(window.opera&&["left","top","right","bottom"].include(C)){if(Element.getStyle(B,"position")=="static"){D="auto";}}return D=="auto"?null:D;},setStyle:function(B,C){B=$(B);for(var A in C){B.style[A.camelize()]=C[A];}return B;},getDimensions:function(B){B=$(B);if(Element.getStyle(B,"display")!="none"){return{width:B.offsetWidth,height:B.offsetHeight};}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};},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;}}return A;},undoPositioned:function(A){A=$(A);if(A._madePositioned){A._madePositioned=undefined;A.style.position=A.style.top=A.style.left=A.style.bottom=A.style.right="";}return A;},makeClipping:function(A){A=$(A);if(A._overflow){return A;}A._overflow=A.style.overflow||"auto";if((Element.getStyle(A,"overflow")||"visible")!="hidden"){A.style.overflow="hidden";}return A;},undoClipping:function(A){A=$(A);if(!A._overflow){return A;}A.style.overflow=A._overflow=="auto"?"":A._overflow;A._overflow=null;return A;}};Element.Methods.Simulated={hasAttribute:function(A,B){return $(A).getAttributeNode(B).specified;}};if(document.all){Element.Methods.update=function(C,B){C=$(C);B=typeof B=="undefined"?"":B.toString();var A=C.tagName.toUpperCase();if(["THEAD","TBODY","TR","TD"].indexOf(A)>-1){var D=document.createElement("div");switch(A){case"THEAD":case"TBODY":D.innerHTML="<table><tbody>"+B.stripScripts()+"</tbody></table>";depth=2;break;case"TR":D.innerHTML="<table><tbody><tr>"+B.stripScripts()+"</tr></tbody></table>";depth=3;break;case"TD":D.innerHTML="<table><tbody><tr><td>"+B.stripScripts()+"</td></tr></tbody></table>";depth=4;}$A(C.childNodes).each(function(E){C.removeChild(E);});depth.times(function(){D=D.firstChild;});$A(D.childNodes).each(function(E){C.appendChild(E);});}else{C.innerHTML=B.stripScripts();}setTimeout(function(){B.evalScripts();},10);return C;};}Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){["","Form","Input","TextArea","Select"].each(function(B){var C="HTML"+B+"Element";if(window[C]){return ;}var A=window[C]={};A.prototype=document.createElement(B?B.toLowerCase():"div").__proto__;});}Element.addMethods=function(A){Object.extend(Element.Methods,A||{});function B(F,D,C){C=C||false;var E=Element.extend.cache;for(var H in F){var G=F[H];if(!C||!(H in D)){D[H]=E.findOrStore(G);}}}if(typeof HTMLElement!="undefined"){B(Element.Methods,HTMLElement.prototype);B(Element.Methods.Simulated,HTMLElement.prototype,true);B(Form.Methods,HTMLFormElement.prototype);[HTMLInputElement,HTMLTextAreaElement,HTMLSelectElement].each(function(C){B(Form.Element.Methods,C.prototype);});_nativeExtensions=true;}};var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(A){this.adjacency=A;};Abstract.Insertion.prototype={initialize:function(B,C){this.element=$(B);this.content=C.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(D){var A=this.element.tagName.toLowerCase();if(A=="tbody"||A=="tr"){this.insertContent(this.contentFromAnonymousTable());}else{throw D;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.insertContent([this.range.createContextualFragment(this.content)]);}setTimeout(function(){C.evalScripts();},10);},contentFromAnonymousTable:function(){var A=document.createElement("div");A.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(A.childNodes[0].childNodes[0].childNodes);}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(A){A.each((function(B){this.element.parentNode.insertBefore(B,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(A){A.reverse(false).each((function(B){this.element.insertBefore(B,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(A){A.each((function(B){this.element.appendChild(B);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(A){A.each((function(B){this.element.parentNode.insertBefore(B,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(A){this.element=$(A);},_each:function(A){this.element.className.split(/\s+/).select(function(B){return B.length>0;})._each(A);},set:function(A){this.element.className=A;},add:function(A){if(this.include(A)){return ;}this.set($A(this).concat(A).join(" "));},remove:function(A){if(!this.include(A)){return ;}this.set($A(this).without(A).join(" "));},toString:function(){return $A(this).join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(A){this.params={classNames:[]};this.expression=A.toString().strip();this.parseExpression();this.compileMatcher();},parseExpression:function(){function G(H){throw"Parse error in selector: "+H;}if(this.expression==""){G("empty expression");}var F=this.params,E=this.expression,B,A,D,C;while(B=E.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){F.attributes=F.attributes||[];F.attributes.push({name:B[2],operator:B[3],value:B[4]||B[5]||""});E=B[1];}if(E=="*"){return this.params.wildcard=true;}while(B=E.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){A=B[1],D=B[2],C=B[3];switch(A){case"#":F.id=D;break;case".":F.classNames.push(D);break;case"":case undefined:F.tagName=D.toUpperCase();break;default:G(E.inspect());}E=C;}if(E.length>0){G(E.inspect());}},buildMatchExpression:function(){var D=this.params,C=[],B;if(D.wildcard){C.push("true");}if(B=D.id){C.push("element.id == "+B.inspect());}if(B=D.tagName){C.push("element.tagName.toUpperCase() == "+B.inspect());}if((B=D.classNames).length>0){for(var A=0;A<B.length;A++){C.push("Element.hasClassName(element, "+B[A].inspect()+")");}}if(B=D.attributes){B.each(function(F){var G="element.getAttribute("+F.name.inspect()+")";var E=function(H){return G+" && "+G+".split("+H.inspect()+")";};switch(F.operator){case"=":C.push(G+" == "+F.value.inspect());break;case"~=":C.push(E(" ")+".include("+F.value.inspect()+")");break;case"|=":C.push(E("-")+".first().toUpperCase() == "+F.value.toUpperCase().inspect());break;case"!=":C.push(G+" != "+F.value.inspect());break;case"":case undefined:C.push(G+" != null");break;default:throw"Unknown operator "+F.operator+" in selector";}});}return C.join(" && ");},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false; return "+this.buildMatchExpression());},findElements:function(D){var C;if(C=$(this.params.id)){if(this.match(C)){if(!D||Element.childOf(C,D)){return[C];}}}D=(D||document).getElementsByTagName(this.params.tagName||"*");var B=[];for(var A=0,E=D.length;A<E;A++){if(this.match(C=D[A])){B.push(Element.extend(C));}}return B;},toString:function(){return this.expression;}};Object.extend(Selector,{matchElements:function(B,C){var A=new Selector(C);return B.select(A.match.bind(A)).collect(Element.extend);},findElement:function(B,C,A){if(typeof C=="number"){A=C,C=false;}return Selector.matchElements(B,C||"*")[A||0];},findChildElements:function(A,B){return B.map(function(C){return C.strip().split(/\s+/).inject([null],function(E,F){var D=new Selector(F);return E.inject([],function(H,G){return H.concat(D.findElements(G||A));});});}).flatten();}});function $$(){return Selector.findChildElements(document,$A(arguments));}var Form={reset:function(A){$(A).reset();return A;},serializeElements:function(A){return A.inject([],function(D,C){var B=Form.Element.serialize(C);if(B){D.push(B);}return D;}).join("&");}};Form.Methods={serialize:function(A){return Form.serializeElements($(A).getElements());},getElements:function(A){return $A($(A).getElementsByTagName("*")).inject([],function(B,C){if(Form.Element.Serializers[C.tagName.toLowerCase()]){B.push(Element.extend(C));}return B;});},getInputs:function(G,C,D){G=$(G);var A=G.getElementsByTagName("input");if(!C&&!D){return A;}var H=new Array();for(var E=0,F=A.length;E<F;E++){var B=A[E];if((C&&B.type!=C)||(D&&B.name!=D)){continue;}H.push(Element.extend(B));}return H;},disable:function(A){A=$(A);A.getElements().each(function(B){B.blur();B.disabled="true";});return A;},enable:function(A){A=$(A);A.getElements().each(function(B){B.disabled="";});return A;},findFirstElement:function(A){return $(A).getElements().find(function(B){return B.type!="hidden"&&!B.disabled&&["input","select","textarea"].include(B.tagName.toLowerCase());});},focusFirstElement:function(A){A=$(A);A.findFirstElement().activate();return A;}};Object.extend(Form,Form.Methods);Form.Element={focus:function(A){$(A).focus();return A;},select:function(A){$(A).select();return A;}};Form.Element.Methods={serialize:function(B){B=$(B);if(B.disabled){return"";}var D=B.tagName.toLowerCase();var C=Form.Element.Serializers[D](B);if(C){var A=encodeURIComponent(C[0]);if(A.length==0){return ;}if(C[1].constructor!=Array){C[1]=[C[1]];}return C[1].map(function(E){return A+"="+encodeURIComponent(E);}).join("&");}},getValue:function(A){A=$(A);var C=A.tagName.toLowerCase();var B=Form.Element.Serializers[C](A);if(B){return B[1];}},clear:function(A){$(A).value="";return A;},present:function(A){return $(A).value!="";},activate:function(A){A=$(A);A.focus();if(A.select){A.select();}return A;},disable:function(A){A=$(A);A.disabled=true;return A;},enable:function(A){A=$(A);A.blur();A.disabled=false;return A;}};Object.extend(Form.Element,Form.Element.Methods);var Field=Form.Element;Form.Element.Serializers={input:function(A){switch(A.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(A);default:return Form.Element.Serializers.textarea(A);}return false;},inputSelector:function(A){if(A.checked){return[A.name,A.value];}},textarea:function(A){return[A.name,A.value];},select:function(A){return Form.Element.Serializers[A.type=="select-one"?"selectOne":"selectMany"](A);},selectOne:function(C){var D="",B,A=C.selectedIndex;if(A>=0){B=Element.extend(C.options[A]);D=B.hasAttribute("value")?B.value:B.text;}return[C.name,D];},selectMany:function(C){var D=[];for(var B=0;B<C.length;B++){var A=Element.extend(C.options[B]);if(A.selected){D.push(A.hasAttribute("value")?A.value:A.text);}}return[C.name,D];}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(A,B,C){this.frequency=B;this.element=$(A);this.callback=C;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(A,B){this.element=$(A);this.callback=B;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var A=this.getValue();if(this.lastValue!=A){this.callback(this.element,A);this.lastValue=A;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback.bind(this));},registerCallback:function(A){if(A.type){switch(A.type.toLowerCase()){case"checkbox":case"radio":Event.observe(A,"click",this.onElementEvent.bind(this));break;default:Event.observe(A,"change",this.onElementEvent.bind(this));break;}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,element:function(A){return A.target||A.srcElement;},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)));},pointerX:function(A){return A.pageX||(A.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(A){return A.pageY||(A.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(A){if(A.preventDefault){A.preventDefault();A.stopPropagation();}else{A.returnValue=false;A.cancelBubble=true;}},findElement:function(C,B){var A=Event.element(C);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode;}return A;},observers:false,_observeAndCache:function(D,C,B,A){if(!this.observers){this.observers=[];}if(D.addEventListener){this.observers.push([D,C,B,A]);D.addEventListener(C,B,A);}else{if(D.attachEvent){this.observers.push([D,C,B,A]);D.attachEvent("on"+C,B);}}},unloadCache:function(){if(!Event.observers){return ;}for(var A=0,B=Event.observers.length;A<B;A++){Event.stopObserving.apply(this,Event.observers[A]);Event.observers[A][0]=null;}Event.observers=false;},observe:function(D,C,B,A){D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.attachEvent)){C="keydown";}Event._observeAndCache(D,C,B,A);},stopObserving:function(D,C,B,A){D=$(D);A=A||false;if(C=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||D.detachEvent)){C="keydown";}if(D.removeEventListener){D.removeEventListener(C,B,A);}else{if(D.detachEvent){try{D.detachEvent("on"+C,B);}catch(E){}}}}});if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false);}var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(B){var A=0,C=0;do{A+=B.scrollTop||0;C+=B.scrollLeft||0;B=B.parentNode;}while(B);return[C,A];},cumulativeOffset:function(B){var A=0,C=0;do{A+=B.offsetTop||0;C+=B.offsetLeft||0;B=B.offsetParent;}while(B);return[C,A];},positionedOffset:function(B){var A=0,D=0;do{A+=B.offsetTop||0;D+=B.offsetLeft||0;B=B.offsetParent;if(B){if(B.tagName=="BODY"){break;}var C=Element.getStyle(B,"position");if(C=="relative"||C=="absolute"){break;}}}while(B);return[D,A];},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;},within:function(B,A,C){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(B,A,C);}this.xcomp=A;this.ycomp=C;this.offset=this.cumulativeOffset(B);return(C>=this.offset[1]&&C<this.offset[1]+B.offsetHeight&&A>=this.offset[0]&&A<this.offset[0]+B.offsetWidth);},withinIncludingScrolloffsets:function(B,A,D){var C=this.realOffset(B);this.xcomp=A+C[0]-this.deltaX;this.ycomp=D+C[1]-this.deltaY;this.offset=this.cumulativeOffset(B);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+B.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+B.offsetWidth);},overlap:function(B,A){if(!B){return 0;}if(B=="vertical"){return((this.offset[1]+A.offsetHeight)-this.ycomp)/A.offsetHeight;}if(B=="horizontal"){return((this.offset[0]+A.offsetWidth)-this.xcomp)/A.offsetWidth;}},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{if(!window.opera||B.tagName=="BODY"){A-=B.scrollTop||0;C-=B.scrollLeft||0;}}while(B=B.parentNode);return[C,A];},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";}},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";},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;}};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];};}Element.addMethods();
