function getbyid(A){if(document.getElementById){return document.getElementById(A)}else{if(document.all){return document.all[A]}else{if(document.layers){return document.layers[A]}else{return null}}}}function leadingZeros(B,A){var C=new String(B);while(C.length<A){C="0"+C}return C}function check_date(H,D,C){var A,B=/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{2})/;if((A=B.exec(H))){var E=new Date;try{E.setYear(A[1]);E.setMonth(A[2]-1);E.setDate(A[3]);E.setHours(A[4]);E.setMinutes(A[5]);var G=new Date;E.setMilliseconds(D-E.getTimezoneOffset()*60000)}catch(F){}}else{}}function getTipDiv(C){if(getbyid("xspace-tipDiv")){B=getbyid("xspace-tipDiv")}else{var B=document.createElement("DIV");B.id="xspace-tipDiv";document.body.appendChild(B)}B.className="xspace-ajaxdiv";B.style.cssText="width:400px;";var I=4;var H=4;var A=0;var J=0;var G=0;var F=0;var E=0;var D=0;if(window.innerWidth){A=window.innerWidth-18}else{if(document.documentElement&&document.documentElement.clientWidth){A=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){A=document.body.clientWidth}}}if(window.innerHeight){J=window.innerHeight-18}else{if(document.documentElement&&document.documentElement.clientHeight){J=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){J=document.body.clientHeight}}}if(typeof window.pageXOffset=="number"){G=window.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollLeft){G=document.documentElement.scrollLeft}else{if(document.body&&document.body.scrollLeft){G=document.body.scrollLeft}else{if(window.scrollX){G=window.scrollX}}}}if(typeof window.pageYOffset=="number"){F=window.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){F=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){F=document.body.scrollTop}else{if(window.scrollY){F=window.scrollY}}}}E=C.pageX?C.pageX:C.clientX+G;D=C.pageY?C.pageY:C.clientY+F;if(E+B.offsetWidth+I>A+G){E=E-B.offsetWidth-I;if(E<0){E=0}}else{E=E+I}if(D+B.offsetHeight+H>J+F){D=D-B.offsetHeight-H;if(D<F){D=J+F-B.offsetHeight}}else{D=D+H}B.style.left=E+"px";B.style.top=D+"px"}function tagshow(C,B){getTipDiv(C);var A=new Ajax("statusid","XML");A.get(siteUrl+"/batch.tagshow.php?tagname="+B,function(D){divElement=getbyid("xspace-tipDiv");divElement.innerHTML=D.lastChild.firstChild.nodeValue})}function joinfriend(C,B){var A=new Ajax("statusid","XML");if(parseInt(B)>0){B="&referuid="+parseInt(B)}A.get(siteUrl+"/batch.common.php?action=joinfriend&uid="+C+"&referuid="+B,function(D){alert(D.lastChild.firstChild.nodeValue)})}function deletetrack(B){var A=new Ajax("statusid","XML");A.get(siteUrl+"/batch.track.php?action=delete&itemid="+B,function(C){alert(C.lastChild.firstChild.nodeValue)})}function taghide(){var A=getbyid("xspace-tipDiv");A.style.display="none"}function addFirstTag(){var A=new Array;A=document.getElementsByTagName("ul");for(i=0;i<A.length;i++){A[i].firstChild.className+=" first-child"}}function setTab(C,E){var D=document.getElementById(C);var B=D.childNodes;for(i=0;i<B.length;i++){if(B[i].className=="tabcontent"){B[i].style.display="none"}}document.getElementById(E).style.display="";var A=document.getElementById(C+"tabs").getElementsByTagName("span");for(i=0;i<A.length;i++){A[i].className=""}document.getElementById(E+"tab").className="active"}function ColExpIntro(B){var A=B.parentNode.getElementsByTagName("p")[0];if(A.style.display=="none"){A.style.display=""}else{A.style.display="none"}}function ColExpAllIntro(C){var B=document.getElementById("ColExpAllIntroText");var A=C.parentNode.parentNode.getElementsByTagName("p");if(B.innerHTML=="顯示摘要"){B.innerHTML="隱藏摘要";for(i=0;i<A.length;i++){A[i].style.display=""}}else{B.innerHTML="顯示摘要";for(i=0;i<A.length;i++){A[i].style.display="none"}}}function OpenWindow(C,B,D,A){xposition=0;yposition=0;if((parseInt(navigator.appVersion)>=4)){xposition=(screen.width-D)/2;yposition=(screen.height-A)/2}theproperty="width="+D+",height="+A+",location=0,menubar=0,resizable=1,scrollbars=1,status=0,titlebar=0,toolbar=0,hotkeys=0,screenx="+xposition+",screeny="+yposition+",left="+xposition+",top="+yposition;window.open(C,B,theproperty)}function joinfavorite(B){var A=new Ajax("statusid","XML");A.get(siteUrl+"/batch.common.php?action=joinfavorite&itemid="+B,function(C){alert(C.lastChild.firstChild.nodeValue)})}function showajaxdiv(D,B,C){var A=new Ajax("statusid","XML");A.get(B,function(G){if(getbyid("xspace-ajax-div-"+D)){var E=getbyid("xspace-ajax-div-"+D)}else{var E=document.createElement("DIV");E.id="xspace-ajax-div-"+D;E.className="xspace-ajaxdiv";document.body.appendChild(E)}E.style.cssText="width:"+C+"px;";var I=navigator.userAgent.toLowerCase();var H=(I.indexOf("opera")!=-1);var F=scrollTop=0;if(H){F=document.body.clientHeight/2;scrollTop=document.body.scrollTop}else{F=document.documentElement.clientHeight/2;scrollTop=document.documentElement.scrollTop}E.innerHTML=G.lastChild.firstChild.nodeValue;E.style.left=(document.documentElement.clientWidth/2+document.documentElement.scrollLeft-C/2)+"px";E.style.top=(F+scrollTop-E.clientHeight/2)+"px"})}function getMsg(){if(GetCookie("readMsg")!="1"){var A=document.createElement("div");A.id="xspace-sitemsg";A.innerHTML="<h6><a href='javascript:;' onclick='closeMsg();' class='xspace-close'>關閉</a>公告:</h6><div>"+siteMsg+"<p class='xspace-more'><a href='"+siteUrl+"/index.php?action_announcement' target='_blank'>MORE</a></p></div>";document.body.insertBefore(A,document.body.firstChild);showMsg()}}function floatMsg(){window.onscroll=function(){document.getElementById("xspace-sitemsg").style.bottom="10px";document.getElementById("xspace-sitemsg").style.background="#EEF0F6"}}function showMsg(){var C=document.getElementById("xspace-sitemsg").style.bottom;if(C==""){C="-180px"}var A=C.length-2;var B=parseInt(C.substring(0,A));if(B<10){document.getElementById("xspace-sitemsg").style.bottom=(B+5)+"px";showvotetime=setTimeout("showMsg()",1)}else{floatMsg()}}function closeMsg(){document.getElementById("xspace-sitemsg").style.display="none";CreatCookie("readMsg","1")}function CreatCookie(B,C){var A=function(){var D=new Date();D.setTime(D.getTime+3*30*24*60*60*1000);return D.toGMTString()};document.cookie=B+"="+C+";expires="+A}function GetCookieVal(B){var A=document.cookie.indexOf(";",B);if(A==-1){A=document.cookie.length}return unescape(document.cookie.substring(B,A))}function GetCookie(F){var B=F+"=";var E=B.length;var A=document.cookie.length;var D=0;while(D<A){var C=D+E;if(document.cookie.substring(D,C)==B){return GetCookieVal(C)}D=document.cookie.indexOf(" ",D)+1;if(D==0){break}}return null}function DelCookie(A,B){document.cookie=A+"="+escape(B)+";expires=Fri, 31 Dec 1999 23:59:59 GMT;"}function hidetoolbar(){window.parent.document.getElementById("toolbarframe").style.display="none"}function showtoolbar(){document.getElementById("toolbarframe").style.display="block"}function mngLink(B){var A=window.parent.document.getElementById("wrap");if(A==null){alert("本按鈕僅對拖拽模板有效！");return false}if(A.className==""){A.className="hidemnglink";B.innerHTML="顯示編輯按鈕"}else{A.className="";B.innerHTML="隱藏編輯按鈕"}}function setCopy(A){if(navigator.userAgent.toLowerCase().indexOf("ie")>-1){clipboardData.setData("Text",A);alert("網址「"+A+"」\n已經複製到您的剪貼板中\n您可以使用Ctrl+V快捷鍵粘貼到需要的地方")}else{prompt("請複製網站地址:",A)}}function addBookmark(B,A){if(navigator.userAgent.toLowerCase().indexOf("ie")>-1){window.external.addFavorite(A,B)}else{if(navigator.userAgent.toLowerCase().indexOf("opera")>-1){alert("請使用Ctrl+T將本頁加入收藏夾")}else{alert("請使用Ctrl+D將本頁加入收藏夾")}}}function setRate(A){getbyid("xspace-ratevalue").value=A;getbyid("xspace-rates").className="xspace-rates"+A}function adclick(B){var A=new Ajax("statusid","XML");A.get(siteUrl+"/batch.common.php?action=adclick&id="+B,function(C){})}function display(A){dobj=getbyid(A);if(dobj.style.display=="none"||dobj.style.display==""){dobj.style.display="block"}else{dobj.style.display="none"}}function addMediaAction(B){if(getbyid(B)){var A=getbyid(B).getElementsByTagName("kbd");for(i=0;i<A.length;i++){if((A[i].className=="showvideo")||(A[i].className.indexOf("showflash",0)==0)){A[i].onclick=function(){showmedia(this,400,400)};A[i].onclick()}}}}function extractMediaInfo(G,E,F,B){var A,D;var C=F.length;A=G.lastIndexOf(F);if(A!=-1){if(F==B){A=G.lastIndexOf(F,A-C)}if(A!=-1){D=G.substr(A+C,G.length-A-C);if(B){A=D.indexOf(B);if(A!=-1){D=D.substr(0,A)}}G=E+D}}return G}function showmedia(E,D,H){var F,C;if(E.tagName.toLowerCase()=="a"){C=E.href}else{C=E.title}var A=E.className.toLowerCase();if(A=="showflash"){if(C.indexOf("youtube.com")!=-1){A="showflash-youtube";C=extractMediaInfo(C,"http://www.youtube.com/v/","v=")}else{if(C.indexOf("google.com")!=-1){A="showflash-google";C=extractMediaInfo(C,"","docid=","&")}else{if(C.indexOf("videoegg.com")!=-1){A="showflash-videoegg";C=extractMediaInfo(C,"","/","#")}else{if(C.indexOf("myspace.com")!=-1||C.indexOf("myspacetv.com")!=-1){A="showflash-myspace";C=extractMediaInfo(C,"","videoid=","&")}else{if(C.indexOf("qq.com")!=-1){A="showflash-qq";C=extractMediaInfo(C,"","v=","&")}else{if(C.indexOf("tudou.com")!=-1){A="showflash-tudou";C=extractMediaInfo(C,"","/","/")}else{if(C.indexOf("uume.com")!=-1){A="showflash-uume";C=extractMediaInfo(C,"","/play_","?")}else{if(C.indexOf("56.com")!=-1){A="showflash-56";C=extractMediaInfo(C,"","/play_","?")}else{if(C.indexOf("sina.com.cn")!=-1){A="showflash-sina-cn";C=extractMediaInfo(C,"","/",".");var B;B=C.indexOf("-");if(B!=-1){vStr=C.substr(0,B);uStr=C.substr(B+1,C.length-B-1)}}}}}}}}}}}switch(A){case"showflash":F="<p style='text-align: right; margin: 0.3em 0; width: 400px;'>[<a href='"+C+"' target='_blank'>全屏觀看</a>]</p><object codeBase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='400' height='260'><param name='movie' value='"+C+"'><param name='quality' value='high'><param name='AllowScriptAccess' value='never'><embed src='"+C+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='400' height='260'></embed></OBJECT>";break;case"showflash-youtube":F='<object width="425" height="355"><param name="movie" value="'+C+'"></param><param name="wmode" value="transparent"></param><embed src="'+C+'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object>';break;case"showflash-qq":F='<object id="flashplayer" classid="clsid:D27CDB6E-AE6D-11cf- 96B8-444553540000" width="456" height="362"><param name="movie" value="http://static.video.qq.com/v1/res/qqplayerout.swf?v='+C+'" /><param name="allowFullScreen" value="true" /><param name="wmode" value="transparent"><param name="flashvars" value="vid='+C+'&cgi=http%3A//video.qq.com/bin/vrank%3Ftype%3D8%26start%3D1%26end%3D8&vhost=http://v.video.qq.com/&phost=http://p.video.qq.com/"><embed type="application/x-shockwave-flash" src="http://static.video.qq.com/v1/res/qqplayerout.swf?v='+C+'" width="456" height="362" id="flashplayer" name="flashplayer" quality="high" allowScriptAccess="sameDomain" allowFullScreen="true" wmode="transparent" flashvars="vid='+C+'&cgi=http%3A//video.qq.com/bin/vrank%3Ftype%3D8%26start%3D1%26end%3D8&vhost=http://v.video.qq.com/&phost=http://p.video.qq.com/"></embed></object>';case"showflash-tudou":F='<object width="400" height="350"><param name="movie" value="http://www.tudou.com/v/'+C+'"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed src="http://www.tudou.com/v/'+C+'" type="application/x-shockwave-flash" width="400" height="350" allowFullScreen="true" wmode="transparent" allowScriptAccess="always"></embed></object>';break;case"showflash-uume":F='<object width="400" height="342"><param name="movie" value="http://www.uume.com/v/'+C+'_UUME"></param><embed src="http://www.uume.com/v/'+C+'_UUME" type="application/x-shockwave-flash" width="400" height="342"></embed></object>';break;case"showflash-sina-cn":F='<object width="474" height="461"><param name="wmode" value="transparent" /><param name="movie" value="http://v.blog.sina.com.cn/b/vblog_player.swf?vid='+vStr+"&uid="+uStr+'&initfull=0&cursound=null"/></param><embed src="http://v.blog.sina.com.cn/b/vblog_player.swf?vid='+vStr+"&uid="+uStr+'&initfull=0&cursound=null" wmode="transparent" type="application/x-shockwave-flash" width="474" height="461"></embed></object>';break;case"showflash-google":F='<embed FlashVars="" style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='+C+'"></embed>';break;case"showflash-videoegg":F='<embed src="http://static.videoegg.com/videoegg/loader.swf" FlashVars="bgColor=FFFFFF&file=http://download.videoegg.com/'+C+'_high.flv&autoPlay=false&forcePlay=false&logo=&allowFullscreen=true&allowFlash9Fullscreen=true" quality="high" allowScriptAccess="always" bgcolor="#FFFFFF" scale="noscale" wmode="window" width="320" height="260" name="VE_Player" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>';break;case"showflash-myspace":F='<embed src="http://lads.myspace.com/videos/vplayer.swf" flashvars="m='+C+'&v=2&type=video" type="application/x-shockwave-flash" width="430" height="346"></embed>';break;case"showvideo":F="<object width='400' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'><param name='url' value='"+C+"' /><embed width='400' type='application/x-mplayer2' src='"+C+"'></embed></object>"}var G=document.getElementById(escape(C.toLowerCase()));if(G){E.parentNode.removeChild(G)}else{G=document.createElement("div");G.id=escape(C.toLowerCase());G.innerHTML=F;E.parentNode.insertBefore(G,E.nextSibling)}return false}function doZoom(A){getbyid("articlebody").style.fontSize=A+"px"}function doPrint(){var B=document.getElementsByTagName("link");for(i=0;i<B.length;i++){if(B[i].rel=="stylesheet"){B[i].disabled=true}}printCSS=document.createElement("link");printCSS.id="printcss";printCSS.type="text/css";printCSS.rel="stylesheet";printCSS.href=siteUrl+"/css/print.css";var E=document.getElementsByTagName("head")[0];var D=B[0];E.insertBefore(printCSS,D);var C=document.getElementsByTagName("h1")[0];var A=document.createElement("p");A.id="cancelPrint";A.style.textAlign="right";A.innerHTML="<a href='javascript:cancelPrint();' target='_self'>返回</a>&nbsp;&nbsp;<a href='javascript:window.print();' target='_self>打印</a>";getbyid("articledetail").insertBefore(A,C);window.print()}function cancelPrint(){if(printCSS){document.getElementsByTagName("head")[0].removeChild(printCSS)}var A=document.getElementsByTagName("link");for(i=0;i<A.length;i++){if(A[i].rel=="stylesheet"){A[i].disabled=false}}if(getbyid("cancelPrint")){getbyid("articledetail").removeChild(getbyid("cancelPrint"))}}function addImgLink(A){var B=getbyid(A);var C=B.getElementsByTagName("img");for(i=0;i<C.length;i++){if(C[i].parentNode.tagName.toLowerCase()!="a"){C[i].title="點擊圖片可在新窗口打開";C[i].style.cursor="pointer";C[i].onclick=function(){window.open(this.src)}}}}function showSubMenu(){var B=this;for(var A=0;A<B.childNodes.length;A++){if(B.childNodes.item(A).nodeName=="UL"){B.childNodes.item(A).style.display="block"}}}function hideSubMenu(A){var C=this;for(var B=0;B<C.childNodes.length;B++){if(C.childNodes.item(B).nodeName=="UL"){C.childNodes.item(B).style.display="none";return }}}function registerMenu(A){var B=document.getElementById(A);var C=B.getElementsByTagName("LI");for(var F=0;F<C.length;F++){var E=C[F];for(var D=0;D<E.childNodes.length;D++){if(E.childNodes.item(D).nodeName=="UL"){E.onmouseover=showSubMenu;E.onmouseout=hideSubMenu;for(var D=0;D<E.childNodes.length;D++){if(E.childNodes.item(D).nodeName=="A"){E.childNodes.item(D).className="hassubmenu"}}}}}}function toggleMenu(A,C){var B=document.getElementById(A);if(B){if(B.style.display=="none"){B.style.display="block";if(C){C.style.backgroundImage="url(./images/top/button-minus.gif)"}}else{B.style.display="none";if(C){C.style.backgroundImage="url(./images/top/button-plus.gif)"}}return true}else{return false}}function currentTime(){var A=new Date();return A.getTime()}var offset=(new Date()).getTimezoneOffset()/60*-1;document.cookie="supe_tzo="+offset+";path=/;";var languagemenustatus=false;function languageRollover(){var B=document.getElementById("languagearrow");var A=document.getElementById("languagetxt");if(!languagemenustatus){if(B.className=="languagearrowdefault"){B.className="languagearrowrollover";A.className="languagetxtrollover"}else{B.className="languagearrowdefault";A.className="languagetxtdefault"}}return true}function toggleLanguageMenu(){var A=document.getElementById("languagemenu");var C=document.getElementById("languagearrow");var B=document.getElementById("languagetxt");if(A.style.display=="none"){A.style.display="block";C.className="languagearrowonclick";B.className="languagetxtonclick";languagemenustatus=true}else{A.style.display="none";C.className="languagearrowrollover";B.className="languagetxtrollover";languagemenustatus=false}return true}function barRollover(B){var A=document.getElementById(B);if(B=="tabhelp"){if(A.className=="tabhelpdefault"){A.className="tabhelprollover"}else{A.className="tabhelpdefault"}}else{if(A.className=="tabdefault"){A.className="tabrollover"}else{A.className="tabdefault"}}return true}var searchmenustatus=false;function searchRollover(B){var A=document.getElementById(B);if(!searchmenustatus){if(A.className==B+"default"){A.className=B+"rollover"}else{A.className=B+"default"}}return true}function toggleSearchMenu(){var C=document.getElementById("searchmenu");var B=document.getElementById("searcharrow");var A=document.getElementById("searchtxt");if(C.style.display=="none"){C.style.display="block";B.className="searcharrowonclick";A.className="searchtxtonclick";searchmenustatus=true}else{C.style.display="none";B.className="searcharrowrollover";A.className="searchtxtdefault";searchmenustatus=false}return true}function selectSearchMenu(B){var F=document.getElementById("itemsearchdefault");var G=document.getElementById("itemsearchusers");var K=document.getElementById("itemsearchblog");var N=document.getElementById("itemsearchforum");var E=document.getElementById("selectsearchusers");var M=document.getElementById("selectsearchblog");var J=document.getElementById("selectsearchforum");var D=document.getElementById("usersearch");var H=document.getElementById("messagesearch");var I=document.getElementById("forumsearch");var C=document.getElementById("searchmenu");var A=document.getElementById("searcharrow");var L=document.getElementById("searchtxt");if(B=="users"){G.style.display="block";F.style.display=K.style.display=N.style.display="none";E.style.fontWeight="bold";M.style.fontWeight=J.style.fontWeight="normal";D.value=1;H.value=I.value=0}else{if(B=="blog"){K.style.display="block";F.style.display=G.style.display=N.style.display="none";M.style.fontWeight="bold";E.style.fontWeight=J.style.fontWeight="normal";H.value=1;D.value=I.value=0}else{N.style.display="block";F.style.display=G.style.display=K.style.display="none";J.style.fontWeight="bold";E.style.fontWeight=M.style.fontWeight="normal";I.value=1;D.value=H.value=0}}C.style.display="none";A.className="searcharrowdefault";L.className="searchtxtdefault";searchmenustatus=false;return true}function hideprofileblock(B,A){if(B){if(document.getElementById(B)){document.getElementById(B).style.display="none"}new Ajax2("/batch.common.php",{data:"action=hideblock&block="+B+"&side="+A,method:"get"}).request()}}function track_record(E,B,D,A){if(parseInt(E)>0){if(B){if(!D){B=Json.toString(B)}}else{B=""}if(typeof A=="undefined"){A=Class.empty}var C=new Ajax2("/batch.common.php?action=track_record",{method:"post",data:"id="+E+"&datamore="+B,onComplete:A});C.request()}}function saveAnchor(B){var A=window.location.href;var C=A.indexOf("#");if(C>=0){A=A.substring(0,C)}window.location.replace(A+"#return-"+B)}if(window.location.hash.indexOf("#return-")>=0){var len=window.location.hash.length;var newHash=window.location.hash.substring(8,len);var oldurl=window.location.href;var pos=oldurl.indexOf("#");if(pos>=0){oldurl=oldurl.substring(0,pos)}window.location.replace=oldurl+"#"+newHash}function set_persistent(E,D,B,A){if(typeof A=="undefined"){A=Class.empty}var C=new Ajax2("/batch.common.php?action=set_persistent",{method:"post",data:"skey="+escape(E)+"&expire="+B+"&value="+Json.toString(D),onComplete:function(F){if(F=="ok"){A.attempt()}}});C.request()}function get_persistent(D,B){var A="";if(typeof B=="undefined"){B=function(E){A=E}}var C=new Ajax2("/batch.common.php?action=get_persitent",{method:"post",data:"skey="+escape(D),onComplete:B.bind(this)});C.request()}function set_item_lock(C,B){var A=new Ajax("statusid","XML");A.get(siteUrl+"/batch.common.php?action=set_item_lock&itemid="+C+"&status="+B,function(D){alert(D.lastChild.firstChild.nodeValue)})}if(!window.Ajax){window.Ajax=function(){};window.Ajax.prototype.get=function(B,D){var C;var A=new XHR({async:false,method:"get"});A.send(B);if(D){D(A.transport.responseXML)}};window.ajax_json_handler=function(url,func,synchronous){var obj=new Json.Remote(url,{method:"get",async:!synchronous,onComplete:function(result){if(func){func(result)}}}).send();if(synchronous){obj.fireEvent("onComplete",eval(obj.transport.responseText))}}}function ANDWindow(A){A.style.position="absolute";this.element=A}ANDWindow.prototype.isvisible=function(){return this.element.style.display!="none"};ANDWindow.prototype.show=function(B){if(B){var A=this.getScroll();this.element.style.left=(B.clientX+A[0])+"px";this.element.style.top=(B.clientY+A[1])+"px"}this.element.style.display="block";this.element.style.zIndex=5000};ANDWindow.prototype.move=function(A,B){};ANDWindow.prototype.hide=function(){this.element.style.display="none"};ANDWindow.prototype.getScroll=function(){var A=window.pageYOffset||document.documentElement.scrollTop||0;var B=window.pageXOffset||document.documentElement.scrollLeft||0;return[B,A]};function stripHash(A){A=A.toString();var B=A.search("#");return A.substr(0,B)}function ANDLabeledAnchor(E,B,F,A){var C=document.createElement("div");var D;B+=": ";C.appendChild(document.createTextNode(B));D=document.createElement("a");D.href=F;D.appendChild(document.createTextNode(A));C.appendChild(D);E.appendChild(C)}function ANDAppendDiv(B,C){var A=document.createElement("div");A.appendChild(document.createTextNode(C));B.appendChild(A)}function ANDClearDescendants(A){while(A.firstChild){A.removeChild(A.firstChild)}}function ANDfindPos(A){var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=A.offsetLeft;curtop+=A.offsetTop}}return[B,curtop]}function ANDPhotoWidget(F,A,E,D,C){this.url_base="/";this.url_img="/";this.minExitDelay=500;this.attachments={};this.top_panel=undefined;this.cur_element=undefined;this.bStick=false;this.bTag=false;this.tagRegions={};this.tagRegionElements={};this.saveCallback=F;this.loadCallback=A;this.removeCallback=E;this.imageData={};this.img_aid={};this.comments={};this.albums=[];this.bAlbum=false;this.albumBackURL=undefined;this.profileURL=undefined;if(D){this.body=D}else{this.body=document.body}if(!C){var B;B=document.createElement("div");B.className="and-photo-widget-default-container";this.body.appendChild(B);this.body=B}}ANDPhotoWidget.icons={new_window:"enlarge.gif",prev:"back.gif",next:"next.gif",jump:"quick_view.gif",backtogallery:"gallery_view.gif"};ANDPhotoWidget.strings={subscribe:"Subscribe to future updates",tag_click:"Click on the image to place a tag. Click this bar to finish.",cancelbtn:"Cancel",tagbtn:"Tag",tagprompt:"Type any name or tag:",tagprompt2:"or choose a person:",comments:"Comments",link:"Share",new_window:"Window",new_windowDesc:"Create a new window",backtogallery:"Gallery",backtogalleryDesc:"Go back to gallery",prev:"Prev",prevDesc:"Go to previous photo",next:"Next",nextDesc:"Go to next photo",jump:"Jump",jumpDesc:"Jump to a photo in the album",comment:"Comment",commentErr:"Error submitting comment",commentLengthErr:"Your comment is too short!",commentSeccodeErr:"Security code doesn't match!",commentSuccess:"Success!",tag:"Tag",gallery:"Jump",link_album:"Album URL",link_image:"Image URL",link_privacy:"Enforce privacy settings",link_privacy_desc:"Disabling privacy settings on links allows people using the links to view your photos marked as private.",ok:"OK",submit:"Submit",cancel:"Cancel",add_comment:"Enter your comment",email:"Enter <replace>'s e-mail:",privacytag:"Cannot tag with that user because of privacy settings",photos:"Photos",remove:"Remove",nocomments:"No Comments",own_picture:"You",owner:"Picture Owner",album:"Photo Album",blog:"Blog Entry",in_photo:"In this photo",remove_verify:"Are you sure you want to remove this tag?",zoom:"Original",zoomDesc:"View original image",by:"by "};ANDPhotoWidget.prototype.setPaths=function(A,B){this.url_base=A;this.url_img=B};ANDPhotoWidget.prototype.getScroll=ANDWindow.prototype.getScroll;ANDPhotoWidget.prototype.setDimensions=function(B,A){this.max_width=B;this.max_height=A};ANDPhotoWidget.prototype.setAlbumURL=function(B,C,A){this.album_presentation_url=B;this.url_album_public=C;this.url_album_private=A};ANDPhotoWidget.prototype.loadTagRegions=function(){this.tagRegions={};for(var D in this.imageData){var C=this.imageData[D]["rgns"];var B=this.imageData[D]["aid"];this.tagRegions["id"+B]=[];if(C){var A;for(A=0;A<C.length;++A){this.tagRegions["id"+B].push({x:C[A].x,y:C[A].y,info:{keyword:C[A].keyword,uid:C[A].uid,removable:C[A].removable,email:undefined,tagid:C[A].tagid,photolink:C[A].photolink,profilelink:C[A].profilelink,by:C[A].by},aid:B})}}}};ANDPhotoWidget.setStrings=function(jsonString){try{var obj=eval("("+jsonString+")");for(var i in obj){ANDPhotoWidget.strings[i]=obj[i]}}catch(ex){}};ANDPhotoWidget.prototype.showPrompt=function(A,B){this.prompt_panel.innerHTML=A;this.prompt_panel.style.display="block";this.prompt_panel.old_clickhandler=this.prompt_panel.onclick;if(B){this.prompt_panel.onclick=B;this.prompt_panel.onmousedown=function(){return false};this.prompt_panel.style.cursor="pointer"}else{this.prompt_panel.style.cursor="default"}};ANDPhotoWidget.prototype.hidePrompt=function(){this.prompt_panel.style.display="none";this.prompt_panel.onclick=this.prompt_panel.old_clickhandler};ANDPhotoWidget.prototype.showRegion=function(A){A.className="and-photo-widget-tagregion-on"};ANDPhotoWidget.prototype.addRegionList=function(A,B){var C=this.tagRegionElements[A];if(!C){C=[];this.tagRegionElements[A]=C}C.push(B)};ANDPhotoWidget.prototype.createRegion=function(L,D){var F=document.getElementById(L);var A=F.getElementsByTagName("img");if(A.length>0){F=A[0]}var E=document.createElement("div");E.className="and-photo-widget-tagregion-off";E.style.position="absolute";E.style.display="block";var C=F.clientWidth;var K=F.clientHeight;var H=ANDfindPos(F);var M=0.2;var B=0.2;var I,G;I=E.style.left=Math.round(H[0]+(D.x-M/2)*C)+"px";G=E.style.top=Math.round(H[1]+(D.y-B/2)*K)+"px";E.style.height=(B*K)+"px";E.style.width=(M*C)+"px";I=parseInt(I);G=parseInt(G);var J=this;E.onmouseover=function(){if(!J.bStick||J.bTag){J.showCaption(I,G-14,D.info.keyword,this);if(!J.bTag){this.className="and-photo-widget-tagregion-on"}}return true};E.onmouseout=function(N){if(!N){N=window.event}var O=N.relatedTarget?N.relatedTarget:N.toElement;if(!O){O=N.targetElement}if(!O||(O.className!="and-photo-widget-caption")){J.hideCaption();if(!J.bTag){this.className="and-photo-widget-tagregion-off"}}return false};this.body.appendChild(E);return E};ANDPhotoWidget.prototype.hideTagRegions=function(A){var C=this.tagRegionElements[A];if(C){var B;for(B=0;B<C.length;++B){C[B].className="and-photo-widget-tagregion-off"}}};ANDPhotoWidget.prototype.showTagRegions=function(A){var C=this.tagRegionElements[A];if(C){var B;for(B=0;B<C.length;++B){C[B].className="and-photo-widget-tagregion-on"}}};ANDPhotoWidget.prototype.destroyTagRegions=function(){for(var B in this.tagRegionElements){var A;var C=this.tagRegionElements[B];for(A=0;A<C.length;++A){this.body.removeChild(C[A])}}this.tagRegionElements={}};ANDPhotoWidget.prototype.createTagRegions=function(){var D;var C=this.tagRegions["id"+this.cur_element.aid];if(!C){return }for(D=0;D<C.length;++D){var A=this.cur_element.id;var B=this.createRegion(A,C[D]);this.addRegionList(A,B)}};ANDPhotoWidget.prototype.getTag=function(A,C,B){ANDPhotoWidget.tagdialog.style.left=A+"px";ANDPhotoWidget.tagdialog.style.top=C+"px";ANDPhotoWidget.tagdialog.widget_ok_callback=B;ANDPhotoWidget.tagdialog.widget_input.value="";ANDPhotoWidget.tagdialog.style.display="block";ANDPhotoWidget.tagdialog.widget_email.style.display="none";ANDPhotoWidget.tagdialog.widget_email_value="";ANDPhotoWidget.tagdialog.and_filter(this);ANDPhotoWidget.tagdialog.widget_taglist.style.display="block";ANDPhotoWidget.tagdialog.widget_input.focus()};ANDPhotoWidget.prototype.doClick=function(A){this.top_panel.and_next.onclick();if(A){}};ANDPhotoWidget.prototype.launchWindow=function(D){var C=this.imageData["id"+D];if(this.presentation){window.location=C.links["image"]}else{var A;if(this.album_presentation_url){A=this.album_presentation_url.replace(/<aid>/,D)}else{A=C.links["frame"]}var B=window.open(A,"and_photos","width=800,height=600,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=yes");if(B){B.focus()}}};ANDPhotoWidget.prototype.setAlbumImage=function(E,H){var B;var F;var C;var A=E.getElementsByTagName("img");if(H&&A&&A.length>0){if(this.forceScale()){A[0].style.width="";A[0].style.height="";A[0].style.visibility="hidden"}var D=this;var G=E.and_wait;if(!G&&this.top_panel.style.display!="none"){G=document.createElement("img");E.appendChild(G);G.src=this.url_img+"wait.gif";G.style.display="none";E.and_wait=G}if(G){A[0].and_wait=G;G.style.position="absolute";G.style.zIndex=1000;this.layoutWait(E,G);G.style.display="block"}A[0].style.cursor="wait";A[0].src=H.links.image;A[0].alt=H.caption;A[0].title=H.caption;A[0].onclick=function(){D.doClick(D.cur_element.aid)};A[0].onload=function(){this.style.cursor="default";if(this.and_wait){this.and_wait.style.display="none"}if(D.forceScale()){var J=A[0].clientWidth;var I=A[0].clientHeight;this.origwidth=J;this.origheight=I;D.rescaleImg(this,this.and_maxx,this.and_maxy);this.style.visibility="visible"}D.destroyTagRegions();D.createTagRegions()};A[0].onerror=function(){this.style.cursor="default";if(this.and_wait){this.and_wait.style.display="none"}D.destroyTagRegions();D.createTagRegions()}}};ANDPhotoWidget.prototype.jumpAid=function(D,F){if(F){var E=window.location.hash;if(E.length>0){E=E.substr(1,E.length-1)}var C=new RegExp(this.cur_element.id+"=([0-9]+)");var A;if(A=E.match(C)){A=A[0].split("=");D=parseInt(A[1]);this.fromhash=true}}if(true){if(this.cur_element&&this.cur_element.aids){var B;for(B=0;B<this.cur_element.aids.length;++B){if(this.cur_element.aids[B]==D){this.albumJump(this.cur_element,B);break}}}}};ANDPhotoWidget.prototype.bookmarkAid=function(B){var F;if(window.location.hash.length>0){var E=B.aid;var C=new RegExp("([a-z][a-z0-9_]*)=[0-9]*");var D=window.location.hash.match(C);var A={};if(D){for(i=0;i<D.length;++i){var G=D[0].split("=");A[G[0]]=G[1]}}A[B.id]=E;var F="";var H;for(H in A){if(F.length>0){F+="_"}F+=H+"="+A[H]}F=F}else{F=B.id+"="+E}window.location.replace(stripHash(window.location)+"#"+F)};ANDPhotoWidget.prototype.albumJump=function(B,A){if(!this.bStick){var D=B.aids[A];var C=this.imageData["id"+D];B.aid=D;B.aid_index=A;this.checkActions(D);this.setAlbumImage(B,C);this.img_aid[B.id]=D;this.updateInfo(D);this.setupTagCaptions();this.loadComments(D);if(document.images&&A+1<B.aids.length){D=B.aids[A+1];C=this.imageData["id"+D];if(!C.preload){C.preload=new Image;C.preload.src=C.links.image}}}};ANDPhotoWidget.prototype.updateInfo=function(C){var D=this.imageData["id"+C];var B;ANDClearDescendants(this.top_panel.and_spacer);if(D){B=D.comcount;if(B==null){B=0}this.captionElement.firstChild.nodeValue=D.caption;ANDClearDescendants(this.commentCountElement);this.commentCountElement.appendChild(document.createTextNode("("+B+")"));if(this.externalCommentCount){ANDClearDescendants(this.externalCommentCount);this.externalCommentCount.appendChild(document.createTextNode("("+B+")"))}}if(this.cur_element.aids&&this.infoElement&&!this.single){var E;var A;ANDClearDescendants(this.infoElement);if(this.cur_element.aids){E=this.cur_element.aid_index+1+"/"+this.cur_element.aids.length;this.top_panel.and_spacer.appendChild(document.createTextNode(E))}if(D){if(D.owner){ANDAppendDiv(this.infoElement,ANDPhotoWidget.strings.owner+": "+ANDPhotoWidget.strings.own_picture)}else{ANDLabeledAnchor(this.infoElement,ANDPhotoWidget.strings.owner,D.owner_link,D.owner_name)}if(D.albumid){if(D.type=="blog"){E=ANDPhotoWidget.strings.blog}else{E=ANDPhotoWidget.strings.album}A=ANDLabeledAnchor(this.infoElement,E,D.album_link,D.album_name)}if(D.date){ANDAppendDiv(this.infoElement,D.date)}}}else{this.infoElement.style.display="none"}};ANDPhotoWidget.prototype.setPresentation=function(A,B){this.presentation=[A,B]};ANDPhotoWidget.prototype.init=function(D,L){var K=this;if(!L){L={}}var I=this.createElement("and_photo_widget_top");var A;I.innerHTML='<table><tr><td></td><td></td><td></td><td class="and-photo-widget-spacer">&nbsp;</td><td></td><td></td><td class="and-photo-widget-prev"></td><td class="and-photo-widget-next"></td><td></td></tr></table>';this.top_panel=I;var E;A=I.getElementsByTagName("td");this.top_panel.and_tag=A[0];E=document.createElement("nobr");A[0].appendChild(E);E.appendChild(document.createTextNode(ANDPhotoWidget.strings.tag));this.top_panel.and_link=A[1];E=document.createElement("nobr");A[1].appendChild(E);E.appendChild(document.createTextNode(ANDPhotoWidget.strings.link));this.top_panel.and_comment=A[2];E=document.createElement("nobr");A[2].appendChild(E);E.appendChild(document.createTextNode(ANDPhotoWidget.strings.comment));this.top_panel.and_spacer=A[3];this.top_panel.and_backtogallery=A[4];this.addActionIcon(A[4],this.url_img+ANDPhotoWidget.icons.backtogallery,ANDPhotoWidget.strings.backtogallery,ANDPhotoWidget.strings.backtogalleryDesc);this.top_panel.and_backtogallery.style.display="none";this.top_panel.and_window=A[5];this.addActionIcon(A[5],this.url_img+ANDPhotoWidget.icons.new_window,ANDPhotoWidget.strings.new_window,ANDPhotoWidget.strings.new_windowDesc);this.top_panel.and_prev=A[6];this.addActionIcon(A[6],this.url_img+ANDPhotoWidget.icons.prev,ANDPhotoWidget.strings.prev,ANDPhotoWidget.strings.prevDesc);this.top_panel.and_next=A[7];this.addActionIcon(A[7],this.url_img+ANDPhotoWidget.icons.next,ANDPhotoWidget.strings.next,ANDPhotoWidget.strings.nextDesc);this.top_panel.and_gallery=A[8];this.addActionIcon(A[8],this.url_img+ANDPhotoWidget.icons.jump,ANDPhotoWidget.strings.jump,ANDPhotoWidget.strings.jumpDesc);this.top_panel.and_next.style.display="none";this.top_panel.and_prev.style.display="none";this.top_panel.and_gallery.style.display="none";var J=function(M){return false};this.top_panel.and_backtogallery.onmousedown=J;this.top_panel.and_backtogallery.onclick=function(M){if(!M){M=window.evt}if(K.albumBackURL){window.location=K.albumBackURL}};this.top_panel.and_gallery.onmousedown=J;this.top_panel.and_gallery.onclick=function(N){if(!N){N=window.event}if(K.gallery_panel.style.display=="none"){if(K.gallery!=K.cur_element.aids){K.buildGallery(K.cur_element.aids)}K.gallery_panel.style.display="block";var Q=ANDfindPos(K.gallery_panel);var P=Q[0]+K.gallery_panel.clientWidth+16;var M=K.getScroll();var O;if(window.innerWidth){O=M[0]+window.innerWidth}else{O=M[0]+document.body.clientWidth}if(O<P){window.scrollBy(P-O,0)}}else{K.gallery_panel.style.display="none"}};this.top_panel.and_next.onmousedown=J;this.top_panel.and_next.onclick=function(N){if(!N){N=window.event}var O=K.cur_element;var M=O.aids;if(M){var P=O.aid_index+1;if(P>=M.length){P=0}K.albumJump(O,P);K.bookmarkAid(O)}};this.top_panel.and_window.onmousedown=J;this.top_panel.and_window.onclick=function(M){if(!M){M=window.event}K.launchWindow(K.cur_element.aid)};this.top_panel.and_prev.onmousedown=J;this.top_panel.and_prev.onclick=function(N){if(!N){N=window.event}var O=K.cur_element;var M=O.aids;if(M){var P=O.aid_index-1;if(P<0){P=M.length-1}K.albumJump(O,P);K.bookmarkAid(O)}};I=this.createElement("and_photo_widget_link");this.top_panel.and_link.onmousedown=J;this.top_panel.and_link.onclick=function(M){if(!K.bStick){if(!M){M=window.event}var N=K.cur_element.aid;var O=K.imageData["id"+N];if(K.bAlbum&&K.url_album_public){K.link_album.style.display="block"}else{K.link_album.style.display="none"}if(O.links.page_private){K.link_privacy.style.display="block";K.link_privacy_input.checked=true}else{K.link_privacy.style.display="none";K.link_privacy_input.checked=true}K.linkWindow.url_image_public=O.links.page_public;if(O.links.page_private){K.linkWindow.url_image_private=O.links.page_private}else{K.linkWindow.url_image_private=undefined}if(K.url_album_public){K.linkWindow.url_album_public=K.url_album_public}else{K.linkWindow.url_album_public=undefined}if(K.url_album_private){K.linkWindow.url_album_private=K.url_album_private}else{K.linkWindow.url_album_private=undefined}K.linkWindow.updateFields();K.linkWindow.show(M);K.bStick=true}else{if(K.linkWindow.isvisible()){if(this.docancel){this.docancel(M)}}}};this.top_panel.and_link.docancel=function(M){K.linkWindow.hide();K.bStick=false};var F=function(){this.select()};I.innerHTML='<div><span></span>:<br/><input type="text" class="and-photo-widget-readonly" readonly="1" size="60"/></div><div><span></span>:<br/><input type="text" readonly="1" class="and-photo-widget-readonly" size="60"/></div><div><input type="checkbox"><span></span><div class="and-photo-widget-tooltip" style="position: absolute; display: none; width:200px;"></div></div><div align="right"><button></button></div>';A=I.getElementsByTagName("span");A[0].innerHTML=ANDPhotoWidget.strings.link_image;A[1].innerHTML=ANDPhotoWidget.strings.link_album;A[2].innerHTML=ANDPhotoWidget.strings.link_privacy;A[2].onclick=function(){K.link_privacy_input.checked=!K.link_privacy_input.checked;K.linkWindow.updateFields()};A=I.getElementsByTagName("input");this.link_image_input=A[0];A[0].onfocus=F;A[0].onclick=F;this.link_album_input=A[1];A[1].onfocus=F;A[1].onclick=F;this.link_privacy_input=A[2];this.link_privacy_input.onclick=function(){K.linkWindow.updateFields()};A=I.getElementsByTagName("div");K.link_album=A[1];K.link_privacy=A[2];this.link_privacy_desc=A[3];this.link_privacy_desc.appendChild(document.createTextNode(ANDPhotoWidget.strings.link_privacy_desc));this.link_privacy.onmouseover=function(N){if(!N){N=window.event}var M=K.getScroll();K.link_privacy_desc.style.display="block"};this.link_privacy.onmouseout=function(M){if(!M){M=window.event}K.link_privacy_desc.style.display="none"};A=I.getElementsByTagName("button");A[0].appendChild(document.createTextNode(ANDPhotoWidget.strings.ok));A[0].onclick=function(M){if(K.top_panel.and_link.docancel){K.top_panel.and_link.docancel(M)}};this.linkWindow=new ANDWindow(I);this.linkWindow.updateFields=function(){if(K.link_privacy_input.checked){K.link_image_input.value=this.url_image_public;K.link_album_input.value=this.url_album_public}else{K.link_image_input.value=this.url_image_private;K.link_album_input.value=this.url_album_private}};I=this.createElement("and_photo_widget_new_comment");if(!L.commentpane){this.top_panel.and_comment.onmousedown=J;this.top_panel.and_comment.onclick=function(M){if(!K.bStick){if(!M){M=window.event}var N=K.cur_element.aid;var O=K.imageData["id"+N];K.comment_value.value="";K.commentWarning.style.display="none";K.commentWindow.show(M);K.bStick=true}else{if(K.commentWindow.isvisible()){if(this.docancel){this.docancel(M)}}}};this.top_panel.and_comment.docancel=function(M){K.commentWindow.hide();K.bStick=false;K.comment_value.value=""};I.innerHTML='<span></span>:<br/><textarea cols="30" rows="4"></textarea><div></div><div></div><div align="right"><button></button><button></button></div>';A=I.getElementsByTagName("span");A[0].appendChild(document.createTextNode(ANDPhotoWidget.strings.add_comment));A=I.getElementsByTagName("textarea");this.comment_value=A[0];A=I.getElementsByTagName("button");A[0].appendChild(document.createTextNode(ANDPhotoWidget.strings.cancel));A[0].onclick=function(M){if(K.top_panel.and_comment.docancel){K.top_panel.and_comment.docancel(M)}};A[1].appendChild(document.createTextNode(ANDPhotoWidget.strings.ok));A[1].onclick=function(N){var O;O={comment:K.comment_value.value};if(K.captchaInput){O.captcha=K.captchaInput.value}var M=K.saveCallback("comment",K.cur_element.aid,O);if(M=="ok"){K.commentWindow.hide();K.bStick=false;K.comments["id"+K.cur_element.aid]=undefined;K.incrementCommentCount(K.cur_element.aid);K.loadComments(K.cur_element.aid)}else{K.showCommentErr(M)}};if(D){this.appendCaptcha(I,"div",0,1,D)}this.commentWindow=new ANDWindow(I)}I=this.top_panel.and_tag;var G=function(T){if(!T){T=window.event}var Q=K.getScroll();var S;var M;var O;M=K.cur_element.getElementsByTagName("img");if(M.length>0){O=M[0]}else{O=K.cur_element}S=ANDfindPos(O);var N=O.clientWidth;var V=O.clientHeight;var R=T.clientX-S[0]+Q[0];var P=T.clientY-S[1]+Q[1];var U=function(Y){if(!Y.canwrite){alert(ANDPhotoWidget.strings.privacytag);return }if(!K.tagRegions["id"+K.cur_element.aid]){K.tagRegions["id"+K.cur_element.aid]=[]}K.tagRegions["id"+K.cur_element.aid].push({aid:K.cur_element.aid,x:R/N,y:P/V,info:Y});K.imageData["id"+K.cur_element.aid]["rgns"].push({x:R/N,y:P/V,keyword:Y.keyword,by:Y.by});var Z=K.tagRegions["id"+K.cur_element.aid];var X=K.createRegion(K.cur_element.id,Z[Z.length-1]);K.addRegionList(K.cur_element.id,X);K.showRegion(X);Y.x=R/N;Y.y=P/V;var W=K.saveCallback("tag",K.cur_element.aid,Y);if(W){Z[Z.length-1].info.tagid=W;K.tagRegions["id"+K.cur_element_aid]=Z}K.setupTagCaptions();if(W){Y.origtagid=W;ANDPhotoWidget.tagdialog.push_recent(Y)}};K.getTag(T.clientX+Q[0],T.clientY+Q[1],U)};var C=function(){K.bStick=false;K.bTag=false;ANDPhotoWidget.tagdialog.widget_cancelbtn.onclick();K.hideTagRegions(K.cur_element.id);K.hidePrompt();var M=K.getImgElement();M.onclick=K.oldTagClick;M.style.cursor="auto"};I.onmousedown=J;I.onclick=function(M){var N;if(K.bTag){C()}else{if(!K.bStick){K.bStick=true;K.bTag=true;K.showPrompt(ANDPhotoWidget.strings.tag_click,C);K.showTagRegions(K.cur_element.id);N=K.getImgElement();K.oldTagClick=N.onclick;N.onclick=G;N.style.cursor="crosshair"}}};I=this.createElement("and_photo_widget_mask");this.mask=I;this.mask.style.display="block";I=this.createElement("and_photo_widget_bottom");I.innerHTML='<table width="100%"><tr><td valign="top" class="and-photo-widget-info-tags"><span>Caption</span><br/><div></div></td><td valign="middle"></td></tr><tr><td colspan="2"></td></tr><tr><td colspan="2"><div><span class="comments"></span> <span class="numcomments"></span></div></td></tr></table><div></div>';this.bottom_panel=I;A=I.getElementsByTagName("span");this.captionElement=A[0];this.commentTextCaption=A[1];this.commentTextCaption.className="and-photo-widget-comments-caption";this.commentCountElement=A[2];A=I.getElementsByTagName("div");this.tagTextElement=A[0];this.commentTextCaptionRegion=A[1];this.commentTextCaptionRegion.className="and-photo-widget-comments-caption-region";var H=document.createElement("img");H.style.verticalAlign="middle";H.src=this.url_img+"triangle-side.gif";this.commentTextCaptionRegion.appendChild(H);this.commentTextCaptionRegion.onclick=function(){var N=this.getElementsByTagName("img");if(N.length>0){this.removeChild(N[0])}var M=document.createElement("img");M.style.verticalAlign="middle";if(K.commentTextElement.style.display=="none"){K.commentTextElement.style.display="block";K.bCommentWindow=true;K.loadComments(K.cur_element.aid);M.src=K.url_img+"triangle-down.gif"}else{K.commentTextElement.style.display="none";K.bCommentWindow=false;M.src=K.url_img+"triangle-side.gif"}this.appendChild(M)};K.comments=[];this.commentTextElement=A[2];this.commentTextElement.className="and-photo-widget-comments";this.commentTextElement.style.display="none";A=I.getElementsByTagName("td");this.infoElement=A[1];this.infoElement.className="and-photo-widget-info";if(L.commentpane){this.commentPaneParent=A[2];this.commentPaneParent.className="and-photo-widget-comment-pane-parent";I=this.commentPaneParent;I.innerHTML='<table class="and-photo-widget-comment-pane"><tr><td><span></span>:<br/><textarea class="and-photo-widget-comment-textarea"></textarea><br/><input type="checkbox"/><span></span></td><td id="xspace-itemform" valign="middle"><div></div><div></div><div align="center"><button id="xspace-btncomment" type="submit" name="submitcomment" class="inputBtn"></button></div></td></tr></table>';A=I.getElementsByTagName("span");A[0].appendChild(document.createTextNode(ANDPhotoWidget.strings.add_comment));A[1].appendChild(document.createTextNode(ANDPhotoWidget.strings.subscribe));var B=A[1];A=I.getElementsByTagName("input");this.subscribe=A[0];this.subscribe.checked=true;B.onclick=function(){K.subscribe.checked=!K.subscribe.checked};A=I.getElementsByTagName("textarea");this.comment_value=A[0];A=I.getElementsByTagName("button");A[0].appendChild(document.createTextNode(ANDPhotoWidget.strings.submit));A[0].onclick=function(N){var O;O={comment:K.comment_value.value};if(K.captchaInput){O.captcha=K.captchaInput.value}if(K.subscribe){O.subscribe=K.subscribe.checked}var M=K.saveCallback("comment",K.cur_element.aid,O);if(M=="ok"){if(K.commentWindow){K.commentWindow.hide()}else{if(K.commentWarning){K.commentWarning.className="and-photo-widget-comment-action-success";K.commentWarning.innerHTML=ANDPhotoWidget.strings.commentSuccess;K.comment_value.value=""}}K.bStick=false;K.comments["id"+K.cur_element.aid]=undefined;K.incrementCommentCount(K.cur_element.aid);K.loadComments(K.cur_element.aid)}else{K.showCommentErr(M)}};if(D){this.appendCaptcha(I,"div",0,1,D)}}this.commentTextCaption.appendChild(document.createTextNode(ANDPhotoWidget.strings.comments));I=this.createElement("and_photo_widget_prompt");this.prompt_panel=I;if(!ANDPhotoWidget.tagdialog){I=this.createElement("and_photo_widget_tagdialog");I.innerHTML='<div>val</div><input type="text" name="" size="15"/><div>val</div><div class="and-photo-widget-tagdialog-taglist"></div><div class="and-photo-widget-tagdialog-email">val<br/><input type="text" size="15"/></div><div class="and-photo-widget-tagdialog-buttonarea"><button>val</button><button>val</buton></div>';var A=I.getElementsByTagName("div");ANDPhotoWidget.tagdialog=I;ANDPhotoWidget.tagdialog.and_filter=function(N){var P=N.imageData["id"+N.cur_element.aid];this.and_nofilter=false;var M;var O=ANDPhotoWidget.tagdialog.widget_taglist.getElementsByTagName("div");if(this.and_nofilter){for(M=0;M<O.length;++M){if(O[M].and_me||(P.grade>=3&&P.ownerid==O[M].and_uid)){O[M].style.display="block"}else{O[M].style.display="none"}}}else{for(M=0;M<O.length;++M){O[M].style.display="block"}}};ANDPhotoWidget.tagdialog.push_recent=function(S){var M=ANDPhotoWidget.tagdialog.widget_taglist;var P;var N=[];var Q;divelement=M.firstChild;while(divelement){if(divelement.tagName=="DIV"){Q=divelement.getElementsByTagName("input");Q=Q[0];if(!((Q.and_data.origtagid!=S.origtagid&&((S.uid==undefined)||(Q.and_data.uid!=S.uid))&&((S.uid!=undefined)||(Q.and_data.keyword!=S.keyword))))){N.push(Q.parentNode)}}else{if(divelement.tagName=="HR"){break}}divelement=divelement.nextSibling}for(P=0;P<N.length;++P){M.removeChild(N[P])}var O=ANDPhotoWidget.addTagList(M,S,true);var R=M.getElementsByTagName("hr");if(!R||(R.length==0)){if(O.nextSibling){M.insertBefore(document.createElement("hr"),O.nextSibling)}else{M.appendChild(document.createElement("hr"))}}};ANDPhotoWidget.tagdialog.widget_prompt=A[0].firstChild;ANDPhotoWidget.tagdialog.widget_prompt2=A[1].firstChild;ANDPhotoWidget.tagdialog.widget_taglist=A[2];ANDPhotoWidget.tagdialog.widget_taglist.style.display="none";ANDPhotoWidget.tagdialog.widget_prompt.nodeValue=ANDPhotoWidget.strings.tagprompt;ANDPhotoWidget.tagdialog.widget_prompt2.nodeValue=ANDPhotoWidget.strings.tagprompt2;ANDPhotoWidget.tagdialog.widget_email=A[3];A[3].style.display="none";ANDPhotoWidget.tagdialog.widget_email_prompt=A[3].firstChild;A=A[3].getElementsByTagName("input");ANDPhotoWidget.tagdialog.widget_email_input=A[0];ANDPhotoWidget.tagdialog.email_prompt=ANDPhotoWidget.strings.email;ANDPhotoWidget.tagdialog.widget_email.style.display="none";A=I.getElementsByTagName("button");ANDPhotoWidget.tagdialog.widget_tagbtn=A[1];ANDPhotoWidget.tagdialog.widget_tagbtn.firstChild.nodeValue=ANDPhotoWidget.strings.tagbtn;ANDPhotoWidget.tagdialog.widget_cancelbtn=A[0];ANDPhotoWidget.tagdialog.widget_cancelbtn.firstChild.nodeValue=ANDPhotoWidget.strings.cancelbtn;ANDPhotoWidget.tagdialog.widget_cancelbtn.onclick=function(M){ANDPhotoWidget.tagdialog.style.display="none";ANDPhotoWidget.tagdialog.widget_taglist.style.display="none";ANDPhotoWidget.tagdialog.tagResult=undefined};ANDPhotoWidget.tagdialog.widget_tagbtn.onclick=function(N){var Q=ANDPhotoWidget.tagdialog;if(ANDPhotoWidget.tagdialog.widget_input.value.length==0){ANDPhotoWidget.tagdialog.widget_cancelbtn.onclick(N)}else{var O;var P;var M;if(ANDPhotoWidget.tagdialog.widget_taglist.style.display!="none"){P=ANDPhotoWidget.tagdialog.widget_taglist.getElementsByTagName("div");for(O=0;O<P.length;++O){if(P[O].style.display!="none"){if(!M){M=P[O]}else{M=undefined;break}}}}if(M){M.firstChild.onclick(N)}else{ANDPhotoWidget.tagdialog.style.display="none";ANDPhotoWidget.tagdialog.tagResult={keyword:Q.widget_input.value,uid:undefined,email:Q.widget_email_input.value,canwrite:true,removable:true};if(ANDPhotoWidget.tagdialog.widget_ok_callback){ANDPhotoWidget.tagdialog.widget_ok_callback(ANDPhotoWidget.tagdialog.tagResult)}}}};A=I.getElementsByTagName("input");ANDPhotoWidget.tagdialog.widget_input=A[0];A[0].onkeydown=function(N){if(!N){N=window.event}if(N.keyCode==13){this.blur();var O;var P;var M;if(ANDPhotoWidget.tagdialog.widget_taglist.style.display!="none"){P=ANDPhotoWidget.tagdialog.widget_taglist.getElementsByTagName("div");for(O=0;O<P.length;++O){if(P[O].style.display!="none"){M=P[O];break}}}if(M){M.firstChild.onclick(N)}else{ANDPhotoWidget.tagdialog.widget_tagbtn.onclick(N)}return false}else{if(N.keyCode==27){this.blur();ANDPhotoWidget.tagdialog.widget_cancelbtn.onclick(N);return false}}};A[0].onkeyup=function(Z){if(this.parentNode.and_nofilter){return }if(!Z){Z=window.event}var M;if(Z.keyCode){M=Z.keyCode}else{M=Z.which}var Q=this.value;var N=Q;var d=ANDPhotoWidget.tagdialog.email_prompt;var U;N.replace(/^\s/,"");var X=N.search(/\s/);if(X!=-1){U=N.substr(0,X)}else{U=N}ANDPhotoWidget.tagdialog.widget_email.firstChild.nodeValue=d.replace("<replace>",U);if(N.search(/\s/)!=-1){ANDPhotoWidget.tagdialog.widget_email.style.display="block";ANDPhotoWidget.tagdialog.widget_taglist.style.display="none"}else{var S;var R=0;var T=-1;var O=ANDPhotoWidget.tagdialog.widget_taglist.getElementsByTagName("div");for(S=0;S<O.length;++S){var P=O[S].firstChild.nextSibling.firstChild;var Y=P.nodeValue.toLowerCase();var W=Q.toLowerCase();var V=undefined;if(O[S].firstChild.and_data.orig_username){V=O[S].firstChild.and_data.orig_username.toLowerCase()}if((Y.search(W)!=-1)||(V!=undefined&&W==V)){O[S].style.display="block";O[S].firstChild.checked=false;++R;if(T<0){T=S}}else{O[S].style.display="none"}}if(R>0){ANDPhotoWidget.tagdialog.widget_email.style.display="none";ANDPhotoWidget.tagdialog.widget_email_input.value="";ANDPhotoWidget.tagdialog.widget_taglist.style.display="block";if(R==1){O[T].firstChild.checked=true}}else{ANDPhotoWidget.tagdialog.widget_email.style.display="block";ANDPhotoWidget.tagdialog.widget_taglist.style.display="none"}}}}this.caption=this.createElement("and_photo_widget_caption");this.caption.innerHTML="val";this.caption.textNode=this.caption.firstChild;this.caption.attach=undefined;this.caption.onmouseover=function(M){if(!M){M=window.event}var N=M.relatedTarget?M.relatedTarget:M.fromElement;if(!N){N=M.srcElement}if(N==this.attach){this.style.display="block"}};this.caption.onmouseout=function(M){if(!M){M=window.event}var N=M.relatedTarget?M.relatedTarget:M.toElement;if(!N){N=M.targetElement}if(N!=this.attach&&N.className!="and-photo-widget-caption"){this.style.display="none";if(this.attach){M={toElement:undefined,targetElement:undefined,relatedElement:undefined};this.attach.onmouseout(M)}}};this.gallery_panel=this.createElement("and_photo_widget_gallery")};ANDPhotoWidget.prototype.showCommentErr=function(A){var B=ANDPhotoWidget.strings.commentErr;switch(A){case"seccode":B=ANDPhotoWidget.strings.commentSeccodeErr;break;case"length":B=ANDPhotoWidget.strings.commentLengthErr;break}this.commentWarning.innerHTML=B;this.commentWarning.style.display="block";this.commentWarning.className="and-photo-widget-comment-action-err"};ANDPhotoWidget.prototype.addActionIcon=function(C,D,B,E){var A=document.createElement("img");A.src=D;A.height=16;A.width=16;if(B){A.alt=B}if(E){A.title=E}C.appendChild(A)};ANDPhotoWidget.prototype.setExternalComments=function(A,C,B,D){this.externalComments=document.getElementById(A);this.externalCommentCount=document.getElementById(C);this.externalCommentTemplate=B;this.externalCommentBlock=document.getElementById(D)};ANDPhotoWidget.prototype.appendCaptcha=function(B,E,C,F,A){var D;var G;D=B.getElementsByTagName(E);D[0].innerHTML=A;G=D[0];this.commentWarning=D[F];D=G.getElementsByTagName("input");this.captchaInput=D[0]};ANDPhotoWidget.prototype.getImgElement=function(){var A=this.cur_element;var B=A.getElementsByTagName("img");if(B.length>0){A=B[0]}return A};ANDPhotoWidget.prototype.incrementCommentCount=function(B){var A=this.imageData["id"+B];if(A){A.comcount++}this.updateInfo(B)};ANDPhotoWidget.prototype.loadComments=function(B){var A=this;if(this.bCommentWindow||this.externalComments){this.comment_aid=B;if(!this.comments["id"+B]){var C=function(D){A.comments["id"+B]=D;A.displayComments(D)};this.loadCallback("comments",B,C)}else{A.displayComments(this.comments["id"+B])}}};ANDPhotoWidget.prototype.setTransparent=function(A){if(A=="bottom"){this.bottom_panel.style.background="transparent"}};ANDPhotoWidget.prototype.displayComments=function(E){var C;var A;if(this.externalComments){A=this.externalComments}else{A=this.commentTextElement}ANDClearDescendants(A);if(E.length==0){var B;B=document.createElement("div");B.className="and-photo-widget-comment";B.appendChild(document.createTextNode(ANDPhotoWidget.strings.nocomments));A.appendChild(B)}var D;if(this.externalComments&&this.externalCommentTemplate){D=this.externalCommentTemplate}for(C=0;C<E.length;++C){this.appendComment(E[C],A,D)}if(E.length==0&&this.externalCommentBlock){this.externalCommentBlock.style.display="none"}else{if(this.externalCommentBlock){this.externalCommentBlock.style.display="block"}}};ANDPhotoWidget.prototype.appendComment=function(F,A,C){var B;var E;if(C){return this.appendCommentTemplate(F,A,C)}B=document.createElement("div");B.className="and-photo-widget-comment";B.innerHTML='<table cellspacing="0" cellpadding="0" ><tr><td><a><img class="and-photo-widget-comment-image"/></a><div>asd</div><div></div></td><td valign="top"></td></tr></table>';E=B.getElementsByTagName("img");if(F.thumburl){E[0].src=F.thumburl}else{}E=B.getElementsByTagName("a");E[0].href=F.user_url;E=B.getElementsByTagName("div");if(F.user_url){E[0].innerHTML='<a href="'+F.user_url+'">'+F.username+"</a>"}else{E[0].innerHTML=F.username}E[0].className="and-photo-widget-comment-author";E[1].innerHTML=F.formatteddate;E[1].className="and-photo-widget-comment-date";E=B.getElementsByTagName("td");E[0].className="and-photo-widget-comment-thumb";var D=E[E.length-1];D.className="and-photo-widget-comment-message";D.innerHTML=F.comment;A.appendChild(B)};ANDPhotoWidget.prototype.appendCommentTemplate=function(D,B,C){for(var A in D){var E=new RegExp("\\["+A+"\\]","g");C=C.replace(E,D[A])}B.innerHTML+=C};ANDPhotoWidget.addTagList=function(B,A,F){var H;var G=this;if(A.keyword){H=A.keyword}else{if(A.username){H=A.username}}if(H){var C=document.createElement("input");var I=function(){var J={keyword:H};if(A.uid){J.uid=A.uid}if(A.origtagid){J.origtagid=A.origtagid}J.canwrite=A.canwrite;J.removable=true;this.checked=false;if(ANDPhotoWidget.tagdialog.widget_ok_callback){ANDPhotoWidget.tagdialog.widget_ok_callback(J)}ANDPhotoWidget.tagdialog.style.display="none";ANDPhotoWidget.tagdialog.widget_taglist.style.display="none"};C=document.createElement("div");C.and_uid=A.uid;if(A.isme){C.and_me=true}if(F){B.insertBefore(C,B.firstChild)}else{B.appendChild(C)}var D=document.createElement("input");D.type="checkbox";D.onclick=I;D.and_data=A;C.appendChild(D);var E=document.createElement("span");E.appendChild(document.createTextNode(H));E.onclick=I;C.appendChild(E);return C}};ANDPhotoWidget.prototype.setTagInfo=function(json){try{var obj=eval("("+json+")");var tags;var child;var taglist=ANDPhotoWidget.tagdialog.widget_taglist;var i;while(child=taglist.firstChild){taglist.remove(child)}tags=obj.recent;if(tags){for(i=0;i<tags.length;++i){ANDPhotoWidget.addTagList(taglist,tags[i])}taglist.appendChild(document.createElement("hr"))}tags=obj.contacts;if(tags){for(i=0;i<tags.length;++i){ANDPhotoWidget.addTagList(taglist,tags[i])}}}catch(e){}};ANDPhotoWidget.prototype.setImageData=function(json){var obj;try{obj=eval("("+json+")")}catch(e){}if(obj){var i;for(i=0;i<obj.length;++i){if(obj[i]["aid"]){this.imageData["id"+obj[i]["aid"]]=obj[i]}}}this.loadTagRegions()};ANDPhotoWidget.prototype.showCaption=function(A,D,C,B){this.caption.textNode.nodeValue=C;this.caption.style.left=A+"px";this.caption.style.top=D+"px";this.caption.style.display="inline";this.caption.style.maxWidth="100px";this.caption.style.display="block";this.caption.attach=B};ANDPhotoWidget.prototype.hideCaption=function(){this.caption.style.display="none"};ANDPhotoWidget.prototype.createElement=function(B){var A=B.replace(/_/g,"-");element=document.createElement("div");element.className=A;element.style.display="none";element.style.position="absolute";this.body.appendChild(element);return element};ANDPhotoWidget.prototype.inBox=function(I,G,E,F,D){var H=[parseInt(E.style.left),parseInt(E.style.top)];var J=E.offsetHeight;var A=E.offsetWidth;if(F){H[1]-=F}if(D){J+=D}var B=(G>=H[1]&&G<H[1]+J);var C=(I>=H[0]&&I<H[0]+A);return I>=H[0]&&I<H[0]+A&&G>=H[1]&&G<H[1]+J};ANDPhotoWidget.prototype.hideAll=function(){this.top_panel.style.display="none";this.mask.style.visibility="hidden";this.bottom_panel.style.display="none";this.prompt_panel.style.display="none";this.commentTextElement.style.display="none";if(this.commentWindow){this.commentWindow.hide()}if(this.tagdialog){this.tagdialog.style.display="none"}if(this.linkWindow){this.linkWindow.hide()}this.destroyTagRegions()};ANDPhotoWidget.prototype.forceScale=function(){return element.style.maxWidth==undefined&&(this.max_width||this.max_height)};ANDPhotoWidget.prototype.rescaleImg=function(C,E,D){var B,A;var G,F;if(this.presentation){G=parseInt(E);F=parseInt(D)}else{G=this.max_width;F=this.max_height}B=G/C.origwidth;A=F/C.origheight;if(A<B){B=A}if(B<1){C.style.width=B*C.origwidth+"px";C.style.height=B*C.origheight+"px"}else{if(B==1){C.style.width=G+"px";C.style.height=F+"px"}}};ANDPhotoWidget.prototype.attachAlbum=function(D,A){var C=document.getElementById(D);var B=this;if(C){var B=this;C.aids=A;C.aid_index=0;this.albums.push(C)}};ANDPhotoWidget.prototype.setupResize=function(B){var C;var A=this;C=function(D){if(!D){D=window.event}A.layout(B)};this.attachWindowEvent("onresize",C);if(!window.ANDResizeHandlers){window.ANDResizeHandlers=[]}window.ANDResizeHandlers.push(C)};ANDPhotoWidget.prototype.changeIconLabels=function(B,A,D){var C=B.getElementsByTagName("img");if(C.length>0){C[0].alt=A;C[0].title=D}};ANDPhotoWidget.prototype.setupPresentation=function(C){var B=this;var A=this.presentation[0];var E=this.presentation[1];this.changeIconLabels(this.top_panel.and_window,ANDPhotoWidget.strings.zoom,ANDPhotoWidget.strings.zoomDesc);var D=function(G){if(!G){G=window.event}var H;var F;var I;if(window.innerWidth){H=(window.innerWidth-A)+"px";F=(window.innerHeight-E)+"px"}else{if(document.documentElement&&document.documentElement.clientHeight){H=(document.documentElement.clientWidth-A)+"px";F=(document.documentElement.clientHeight-E)+"px"}else{H=(document.body.clientWidth-A)+"px";F=(document.body.clientHeight-E)+"px"}}C.style.width=H;C.style.height=F;I=C.getElementsByTagName("img");if(I.length>0){if(B.forceScale()){if(I[0].and_rescale){I[0].and_rescale(H,F)}else{I[0].and_maxx=H;I[0].and_maxy=F}}else{I[0].style.maxWidth=H;I[0].style.maxHeight=F}}B.displayFrame(C.aid,C,true);B.destroyTagRegions();B.createTagRegions()};this.attachWindowEvent("onresize",D);D()};ANDPhotoWidget.prototype.setupAlbums=function(B){var E;this.bAlbum=true;this.albumBackURL=B;if(this.albumBackURL){this.showTableCell(this.top_panel.and_backtogallery,true)}for(E=0;E<this.albums.length;++E){var D=this.albums[E];var A=D.aids;if(A&&A.length>0){this.cur_element=D;this.albumJump(D,0);if(this.albums.length!=1){this.attachImg(D.id,aid)}}}if(this.albums.length==1){var C=this;var F=function(){C.displayFrame(C.albums[0].aids[0],C.albums[0],true)};this.attachWindowEvent("onload",F);if(this.presentation){this.setupPresentation(C.albums[0])}else{this.setupResize(C.albums[0]);this.commentTextCaptionRegion.style.display="none"}}};ANDPhotoWidget.prototype.showTableCell=function(B,A){if(A){try{B.style.display="table-cell"}catch(C){B.style.display="inline"}}else{B.style.display="none"}};ANDPhotoWidget.prototype.checkActions=function(E){var D=this.imageData["id"+E];var A;var C;var B;if(D){A=D.owner;C=D.allowcomment;B=D.owner||D.accesslevel<=1}this.showTableCell(this.top_panel.and_tag,A||D&&(D.grade>=3&&D.allowcomment));this.showTableCell(this.top_panel.and_link,B);if(this.top_panel.and_comment){this.showTableCell(this.top_panel.and_comment,!this.commentPaneParent&&C)}if(this.commentPaneParent){this.showTableCell(this.commentPaneParent,C&&this.bAlbum)}};ANDPhotoWidget.prototype.layoutWait=function(A,B){var C=ANDfindPos(A);B.style.left=(A.clientWidth/2+A.offsetLeft)+"px";B.style.top=(A.clientHeight/2+A.offsetTop)+"px"};ANDPhotoWidget.prototype.layout=function(C){var E=ANDfindPos(C);var D=E[1]-this.top_panel.offsetHeight;var A=C.offsetHeight+E[1];var B=E[0]+C.offsetWidth;this.top_panel.style.left=E[0]+"px";this.top_panel.style.top=D+"px";this.top_panel.style.width=(B-E[0])+"px";this.gallery_panel.style.top=D+"px";this.gallery_panel.style.left=B+"px";this.gallery_panel.style.height=(A-D)+"px";this.mask.style.top=D+"px";this.mask.style.left=E[0]+"px";this.mask.style.width=(B-E[0])+"px";this.mask.style.height=(A-D+this.bottom_panel.offsetHeight)+"px";this.bottom_panel.style.top=A+"px";this.bottom_panel.style.left=E[0]+"px";this.bottom_panel.style.width=(B-E[0])+"px";this.prompt_panel.style.top=E[1]+"px";this.prompt_panel.style.left=E[0]+"px";this.prompt_panel.style.width=(B-E[0])+"px";if(C.and_wait){this.layoutWait(C,C.and_wait)}};ANDPhotoWidget.prototype.displayFrame=function(C,E,I){var G=this;if(this.cur_element&&this.cur_element.aid){C=this.cur_element.aid}G.top_panel.style.display="block";G.bottom_panel.style.display="block";G.top_panel.style.position="absolute";G.mask.style.visibility="visible";G.mask.style.display="block";this.layout(E);this.checkActions(C);G.cur_element=E;var H=0;var A;var D;var B=function(K){if(G.bStick){return }if(!K&&window.event){K=window.event}if(!K){K=D}if(A){clearTimeout(A);A=undefined}if(E.tagName=="IMG"){E.className="and-photo-widget-blog-image-on"}var J=G.getScroll();var N=J[0],M=J[1];var L=(new Date).getTime()-H;if(!G.inBox(K.clientX+N,K.clientY+M,G.top_panel,10)&&!G.inBox(K.clientX+N,K.clientY+M,G.mask)&&!G.inBox(K.clientX+N,K.clientY+M,G.bottom_panel,0,10)){if(true){if(E.tagName=="IMG"){E.className="and-photo-widget-blog-image-off"}G.hideAll();G.cur_element=undefined;document.onmousemove=G.oldDocMousemove;G.removeWindowEvent("onscroll",G.oldScroll);H=0}else{if(!H){H=(new Date).getTime()}}}};G.updateInfo(C);if(G.comment_aid!=G.cur_element.aid){G.loadComments(G.cur_element.aid)}if(G.bCommentWindow){G.commentTextElement.style.display="block"}G.destroyTagRegions();G.createTagRegions();G.setupTagCaptions();G.oldDocMousemove=document.onmousemove;G.oldScroll=document.onscroll;if(!I){document.onmousemove=B;var F=function(){G.bStick=false;G.bTag=false};G.oldScroll=G.attachWindowEvent("onscroll",F)}if(this.bAlbum&&this.cur_element.aids.length>1){this.showTableCell(this.top_panel.and_next,true);this.showTableCell(this.top_panel.and_prev,true);this.showTableCell(this.top_panel.and_gallery,true)}else{this.showTableCell(this.top_panel.and_next,false);this.showTableCell(this.top_panel.and_prev,false);this.showTableCell(this.top_panel.and_gallery,false)}};ANDPhotoWidget.prototype.translateEvent=function(A){var B;switch(A){case"onscroll":B="scroll";break;case"onload":B="load";break;case"onresize":B="resize";break;case"onmove":B="move";break;case"onclick":B="click";break;default:B=A;break}return B};ANDPhotoWidget.prototype.removeWindowEvent=function(A,B){if(document.attachEvent){window.detachEvent(A,B)}else{if(document.addEventListener){var C=this.translateEvent(A);window.removeEventListener(C,B,false)}}};ANDPhotoWidget.prototype.attachWindowEvent=function(A,B){if(document.attachEvent){window.attachEvent(A,B);return B}else{if(document.addEventListener){var C=this.translateEvent(A);window.addEventListener(C,B,false);return B}else{alert("cannot attach")}}};ANDPhotoWidget.prototype.attachImg=function(E,D){var B=document.getElementById(E);if(B){var A=this;this.img_aid[E]=D;B.aid=D;if(this.albums.length!=1){var C=function(F){if(A.bStick||(A.top_panel.style.display!="none")){return }A.displayFrame(D,B)};B.onmousemove=C;B.onmouseover=C;B.onclick=function(){if(this.aid){A.doClick(this.aid)}}}if(this.presentation){this.setupPresentation(B)}else{this.setupResize(B)}}};ANDPhotoWidget.prototype.setupTagCaptions=function(){var C=this.img_aid[this.cur_element.id];var N=this.tagRegions["id"+this.cur_element.aid];var L=this;ANDClearDescendants(L.tagTextElement);if(N&&N.length>0){var F;var M;var G=true;M=document.createElement("span");M.appendChild(document.createTextNode(ANDPhotoWidget.strings.in_photo+": "));L.tagTextElement.appendChild(M);for(F=0;F<N.length;++F){M=document.createElement("span");L.tagTextElement.appendChild(M);M.className="and-photo-widget-tagtextregion";M.onmouseover=this.tagCaptionMouseover(N[F]);M.onmouseout=function(){this.myrgn.style.border="none";this.myrgn.className="and-photo-widget-tagregion-off";L.body.removeChild(this.myrgn);this.myrgn=undefined};if(!G){M.appendChild(document.createTextNode(", "))}else{G=false}var D;if(N[F].info.uid||N[F].info.removable){var E;var A;E=document.createElement("nobr");if(N[F].info.uid){D=document.createElement("a");if(N[F].info.profilelink){D.href=N[F].info.profilelink}else{D.href="/"+N[F].info.uid}if(N[F].info.by){D.title=ANDPhotoWidget.strings.by+N[F].info.by}D.appendChild(document.createTextNode(N[F].info.keyword));E.appendChild(D);E.appendChild(document.createTextNode(" ("));D=document.createElement("a");if(N[F].info.photolink){D.href=N[F].info.photolink}else{D.href="/"+N[F].info.uid+"/action_viewphotos_type_mine.html"}A=document.createTextNode(ANDPhotoWidget.strings.photos);D.appendChild(A);E.appendChild(D)}else{if(N[F].info.by){E.title=ANDPhotoWidget.strings.by+N[F].info.by}E.appendChild(document.createTextNode(N[F].info.keyword));E.appendChild(document.createTextNode(" ("))}if(N[F].info.removable&&N[F].info.tagid){if(N[F].info.uid){E.appendChild(document.createTextNode(", "))}D=document.createElement("span");D.appendChild(document.createTextNode(ANDPhotoWidget.strings.remove));var B=function(O,P){return function(){if(confirm(ANDPhotoWidget.strings.remove_verify)){if(L.removeCallback){L.removeCallback("tag",O)}var Q=L.tagRegions["id"+L.cur_element.aid];for(j=0;j<Q.length;++j){if(Q[j].info.tagid==O){L.tagRegions["id"+L.cur_element.aid].splice(j,1);break}}if(P.myrgn){P.myrgn.parentNode.removeChild(P.myrgn);P.myrgn=undefined}L.destroyTagRegions();L.createTagRegions();L.setupTagCaptions()}}};D.onclick=B(N[F].info.tagid,M);E.appendChild(D)}E.appendChild(document.createTextNode(")"));M.appendChild(E)}else{D=document.createTextNode(N[F].info.keyword);M.appendChild(D)}}}var K=this.cur_element.parentNode;if(K&&this.bAlbum){pos=ANDfindPos(K);var I=pos[1]+K.clientHeight;var H=pos[1];pos=ANDfindPos(this.bottom_panel);var J=pos[1]+this.bottom_panel.clientHeight;if(J){K.style.height=(J-H)+"px"}}};ANDPhotoWidget.prototype.tagCaptionMouseover=function(A){var B=this;return function(){var C=B.createRegion(B.cur_element.id,A);C.className="and-photo-widget-tagregion-on";this.myrgn=C}};ANDPhotoWidget.prototype.buildGallery=function(H){ANDClearDescendants(this.gallery_panel);var C;var I=this.gallery_panel;var J=this;var G=this.cur_element;var F=function(K){return function(L){if(!L){L=window.event}J.albumJump(G,K);J.bookmarkAid(element)}};for(C=0;C<H.length;++C){var A=H[C];var B;var D;var E;B=J.imageData["id"+A];D=document.createElement("div");I.appendChild(D);E=document.createElement("img");D.appendChild(E);E.src=B.links["thumb"];E.alt=B.caption;E.title=B.caption;E.onclick=F(C)}};var MooTools={version:"1.11"};function $defined(B){return(B!=undefined)}function $type(D){if(!$defined(D)){return false}if(D.htmlElement){return"element"}var C=typeof D;if(C=="object"&&D.nodeName){switch(D.nodeType){case 1:return"element";case 3:return(/\S/).test(D.nodeValue)?"textnode":"whitespace"}}if(C=="object"||C=="function"){switch(D.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof D.length=="number"){if(D.item){return"collection"}if(D.callee){return"arguments"}}}return C}function $merge(){var I={};for(var J=0;J<arguments.length;J++){for(var G in arguments[J]){var F=arguments[J][G];var H=I[G];if(H&&$type(F)=="object"&&$type(H)=="object"){I[G]=$merge(H,F)}else{I[G]=F}}}return I}var $extend=function(){var C=arguments;if(!C[1]){C=[this,C[0]]}for(var D in C[1]){C[0][D]=C[1][D]}return C[0]};var $native=function(){for(var D=0,C=arguments.length;D<C;D++){arguments[D].extend=function(B){for(var A in B){if(!this.prototype[A]){this.prototype[A]=B[A]}if(!this[A]){this[A]=$native.generic(A)}}}}};$native.generic=function(B){return function(A){return this.prototype[B].apply(A,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(B){return !!(B||B===0)}function $pick(D,C){return $defined(D)?D:C}function $random(D,C){return Math.floor(Math.random()*(C-D+1)+D)}function $time(){return new Date().getTime()}function $clear(B){clearTimeout(B);clearInterval(B);return null}var Abstract=function(B){B=B||{};B.extend=$extend;return B};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}var Class=function(D){var C=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this};$extend(C,this);C.prototype=D;C.constructor=Class;return C};Class.empty=function(){};Class.prototype={extend:function(H){var G=new this(null);for(var F in H){var E=G[F];G[F]=Class.Merge(E,H[F])}return new Class(G)},implement:function(){for(var D=0,C=arguments.length;D<C;D++){$extend(this.prototype,arguments[D])}}};Class.Merge=function(G,F){if(G&&G!=F){var H=$type(F);if(H!=$type(G)){return F}switch(H){case"function":var E=function(){this.parent=arguments.callee.parent;return F.apply(this,arguments)};E.parent=G;return E;case"object":return $merge(G,F)}}return F};var Chain=new Class({chain:function(B){this.chains=this.chains||[];this.chains.push(B);return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(D,C){if(C!=Class.empty){this.$events=this.$events||{};this.$events[D]=this.$events[D]||[];this.$events[D].include(C)}return this},fireEvent:function(E,F,D){if(this.$events&&this.$events[E]){this.$events[E].each(function(A){A.create({bind:this,delay:D,"arguments":F})()},this)}return this},removeEvent:function(D,C){if(this.$events&&this.$events[D]){this.$events[D].remove(C)}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var B in this.options){if($type(this.options[B]=="function")&&(/^on[A-Z]/).test(B)){this.addEvent(B,this.options[B])}}}return this}});Array.extend({forEach:function(G,F){for(var H=0,E=this.length;H<E;H++){G.call(F,this[H],H,this)}},filter:function(H,G){var I=[];for(var J=0,F=this.length;J<F;J++){if(H.call(G,this[J],J,this)){I.push(this[J])}}return I},map:function(H,G){var I=[];for(var J=0,F=this.length;J<F;J++){I[J]=H.call(G,this[J],J,this)}return I},every:function(G,F){for(var H=0,E=this.length;H<E;H++){if(!G.call(F,this[H],H,this)){return false}}return true},some:function(G,F){for(var H=0,E=this.length;H<E;H++){if(G.call(F,this[H],H,this)){return true}}return false},indexOf:function(G,F){var E=this.length;for(var H=(F<0)?Math.max(0,E+F):F||0;H<E;H++){if(this[H]===G){return H}}return -1},copy:function(F,G){F=F||0;if(F<0){F=this.length+F}G=G||(this.length-F);var E=[];for(var H=0;H<G;H++){E[H]=this[F++]}return E},remove:function(E){var F=0;var D=this.length;while(F<D){if(this[F]===E){this.splice(F,1);D--}else{F++}}return this},contains:function(C,D){return this.indexOf(C,D)!=-1},associate:function(G){var F={},H=Math.min(this.length,G.length);for(var E=0;E<H;E++){F[G[E]]=this[E]}return F},extend:function(E){for(var F=0,D=E.length;F<D;F++){this.push(E[F])}return this},merge:function(E){for(var F=0,D=E.length;F<D;F++){this.include(E[F])}return this},include:function(B){if(!this.contains(B)){this.push(B)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(B){return Array.copy(B)}function $each(G,H,F){if(G&&typeof G.length=="number"&&$type(G)!="object"){Array.forEach(G,H,F)}else{for(var E in G){H.call(F||G,G[E],E)}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(C,D){return(($type(C)=="string")?new RegExp(C,D):C).test(this)},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(B){return B.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(B){return(B.charAt(0)+"-"+B.charAt(1).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(B){return B.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(D){var C=this.match(/\d{1,3}/g);return(C)?C.rgbToHex(D):false},hexToRgb:function(D){var C=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(C)?C.slice(1).hexToRgb(D):false},contains:function(C,D){return(D)?(D+this+D).indexOf(D+C+D)>-1:this.indexOf(C)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});Array.extend({rgbToHex:function(F){if(this.length<3){return false}if(this.length==4&&this[3]==0&&!F){return"transparent"}var H=[];for(var E=0;E<3;E++){var G=(this[E]-0).toString(16);H.push((G.length==1)?"0"+G:G)}return F?H:"#"+H.join("")},hexToRgb:function(E){if(this.length!=3){return false}var D=[];for(var F=0;F<3;F++){D.push(parseInt((this[F].length==1)?this[F]+this[F]:this[F],16))}return E?D:"rgb("+D.join(",")+")"}});Function.extend({create:function(C){var D=this;C=$merge({bind:D,event:false,"arguments":null,delay:false,periodical:false,attempt:false},C);if($chk(C.arguments)&&$type(C.arguments)!="array"){C.arguments=[C.arguments]}return function(B){var H;if(C.event){B=B||window.event;H=[(C.event===true)?B:new C.event(B)];if(C.arguments){H.extend(C.arguments)}}else{H=C.arguments||arguments}var A=function(){return D.apply($pick(C.bind,D),H)};if(C.delay){return setTimeout(A,C.delay)}if(C.periodical){return setInterval(A,C.periodical)}if(C.attempt){try{return A()}catch(G){return false}}return A()}},pass:function(C,D){return this.create({"arguments":C,bind:D})},attempt:function(C,D){return this.create({"arguments":C,bind:D,attempt:true})()},bind:function(D,C){return this.create({bind:D,"arguments":C})},bindAsEventListener:function(D,C){return this.create({bind:D,event:true,"arguments":C})},delay:function(F,E,D){return this.create({delay:F,bind:E,"arguments":D})()},periodical:function(D,E,F){return this.create({periodical:D,bind:E,"arguments":F})()}});Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},limit:function(D,C){return Math.min(C,Math.max(D,this))},round:function(B){B=Math.pow(10,B||0);return Math.round(this*B)/B},times:function(D){for(var C=0;C<this;C++){D(C)}}});var Element=new Class({initialize:function(F,G){if($type(F)=="string"){if(window.ie&&G&&(G.name||G.type)){var E=(G.name)?' name="'+G.name+'"':"";var H=(G.type)?' type="'+G.type+'"':"";delete G.name;delete G.type;F="<"+F+E+H+">"}F=document.createElement(F)}F=$(F);return(!G||!F)?F:F.set(G)}});var Elements=new Class({initialize:function(B){return(B)?$extend(B,this):this}});Elements.extend=function(C){for(var D in C){this.prototype[D]=C[D];this[D]=$native.generic(D)}};function $(D){if(!D){return null}if(D.htmlElement){return Garbage.collect(D)}if([window,document].contains(D)){return D}var C=$type(D);if(C=="string"){D=document.getElementById(D);C=(D)?"element":false}if(C!="element"){return null}if(D.htmlElement){return Garbage.collect(D)}if(["object","embed"].contains(D.tagName.toLowerCase())){return D}$extend(D,Element.prototype);D.htmlElement=function(){};return Garbage.collect(D)}document.getElementsBySelector=document.getElementsByTagName;function $$(){var F=[];for(var G=0,H=arguments.length;G<H;G++){var E=arguments[G];switch($type(E)){case"element":F.push(E);case"boolean":break;case false:break;case"string":E=document.getElementsBySelector(E,true);default:F.extend(E)}}return $$.unique(F)}$$.unique=function(I){var L=[];for(var M=0,H=I.length;M<H;M++){if(I[M].$included){continue}var N=$(I[M]);if(N&&!N.$included){N.$included=true;L.push(N)}}for(var J=0,K=L.length;J<K;J++){L[J].$included=null}return new Elements(L)};Elements.Multi=function(B){return function(){var J=arguments;var L=[];var A=true;for(var I=0,K=this.length,H;I<K;I++){H=this[I][B].apply(this[I],J);if($type(H)!="element"){A=false}L.push(H)}return(A)?$$.unique(L):L}};Element.extend=function(D){for(var F in D){HTMLElement.prototype[F]=D[F];Element.prototype[F]=D[F];Element[F]=$native.generic(F);var E=(Array.prototype[F])?F+"Elements":F;Elements.prototype[E]=Elements.Multi(F)}};Element.extend({set:function(D){for(var E in D){var F=D[E];switch(E){case"styles":this.setStyles(F);break;case"events":if(this.addEvents){this.addEvents(F)}break;case"properties":this.setProperties(F);break;default:this.setProperty(E,F)}}return this},inject:function(G,E){G=$(G);switch(E){case"before":G.parentNode.insertBefore(this,G);break;case"after":var H=G.getNext();if(!H){G.parentNode.appendChild(this)}else{G.parentNode.insertBefore(this,H)}break;case"top":var F=G.firstChild;if(F){G.insertBefore(this,F);break}default:G.appendChild(this)}return this},injectBefore:function(B){return this.inject(B,"before")},injectAfter:function(B){return this.inject(B,"after")},injectInside:function(B){return this.inject(B,"bottom")},injectTop:function(B){return this.inject(B,"top")},adopt:function(){var B=[];$each(arguments,function(A){B=B.concat(A)});$$(B).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(E){var F=$(this.cloneNode(E!==false));if(!F.$events){return F}F.$events={};for(var D in this.$events){F.$events[D]={keys:$A(this.$events[D].keys),values:$A(this.$events[D].values)}}return F.removeEvents()},replaceWith:function(B){B=$(B);this.parentNode.replaceChild(B,this);return B},appendText:function(B){this.appendChild(document.createTextNode(B));return this},hasClass:function(B){return this.className.contains(B," ")},addClass:function(B){if(!this.hasClass(B)){this.className=(this.className+" "+B).clean()}return this},removeClass:function(B){this.className=this.className.replace(new RegExp("(^|\\s)"+B+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(B){return this.hasClass(B)?this.removeClass(B):this.addClass(B)},setStyle:function(D,C){switch(D){case"opacity":return this.setOpacity(parseFloat(C));case"float":D=(window.ie)?"styleFloat":"cssFloat"}D=D.camelCase();switch($type(C)){case"number":if(!["zIndex","zoom"].contains(D)){C+="px"}break;case"array":C="rgb("+C.join(",")+")"}this.style[D]=C;return this},setStyles:function(B){switch($type(B)){case"object":Element.setMany(this,"setStyle",B);break;case"string":this.style.cssText=B}return this},setOpacity:function(B){if(B==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ie){this.style.filter=(B==1)?"":"alpha(opacity="+B*100+")"}this.style.opacity=this.$tmp.opacity=B;return this},getStyle:function(G){G=G.camelCase();var E=this.style[G];if(!$chk(E)){if(G=="opacity"){return this.$tmp.opacity}E=[];for(var H in Element.Styles){if(G==H){Element.Styles[H].each(function(A){var B=this.getStyle(A);E.push(parseInt(B)?B:"0px")},this);if(G=="border"){var F=E.every(function(A){return(A==E[0])});return(F)?E[0]:false}return E.join(" ")}}if(G.contains("border")){if(Element.Styles.border.contains(G)){return["Width","Style","Color"].map(function(A){return this.getStyle(G+A)},this).join(" ")}else{if(Element.borderShort.contains(G)){return["Top","Right","Bottom","Left"].map(function(A){return this.getStyle("border"+A+G.replace("border",""))},this).join(" ")}}}if(document.defaultView){E=document.defaultView.getComputedStyle(this,null).getPropertyValue(G.hyphenate())}else{if(this.currentStyle){E=this.currentStyle[G]}}}if(window.ie){E=Element.fixStyle(G,E,this)}if(E&&G.test(/color/i)&&E.contains("rgb")){return E.split("rgb").splice(1,4).map(function(A){return A.rgbToHex()}).join(" ")}return E},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(D,E){D+="Sibling";var F=(E)?this[E]:this[D];while(F&&$type(F)!="element"){F=F[D]}return $(F)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(B){return !!$A(this.getElementsByTagName("*")).contains(B)},getProperty:function(F){var H=Element.Properties[F];if(H){return this[H]}var E=Element.PropertiesIFlag[F]||0;if(!window.ie||E){return this.getAttribute(F,E)}var G=this.attributes[F];return(G)?G.nodeValue:null},removeProperty:function(D){var C=Element.Properties[D];if(C){this[C]=""}else{this.removeAttribute(D)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(E,F){var D=Element.Properties[E];if(D){this[D]=F}else{this.setAttribute(E,F)}return this},setProperties:function(B){return Element.setMany(this,"setProperty",B)},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(D){var C=this.getTag();if(["style","script"].contains(C)){if(window.ie){if(C=="style"){this.styleSheet.cssText=D}else{if(C=="script"){this.setProperty("text",D)}}return this}else{this.removeChild(this.firstChild);return this.appendText(D)}}this[$defined(this.innerText)?"innerText":"textContent"]=D;return this},getText:function(){var B=this.getTag();if(["style","script"].contains(B)){if(window.ie){if(B=="style"){return this.styleSheet.cssText}else{if(B=="script"){return this.getProperty("text")}}}else{return this.innerHTML}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});Element.fixStyle=function(G,F,H){if($chk(parseInt(F))){return F}if(["height","width"].contains(G)){var J=(G=="width")?["left","right"]:["top","bottom"];var I=0;J.each(function(A){I+=H.getStyle("border-"+A+"-width").toInt()+H.getStyle("padding-"+A).toInt()});return H["offset"+G.capitalize()]-I+"px"}else{if(G.test(/border(.+)Width|margin|padding/)){return"0px"}}return F};Element.Styles={border:[],padding:[],margin:[]};["Top","Right","Bottom","Left"].each(function(D){for(var C in Element.Styles){Element.Styles[C].push(C+D)}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(H,F,G){var E={};$each(G,function(A){E[A]=H[F](A)});return E};Element.setMany=function(H,F,G){for(var E in G){H[F](E,G[E])}return H};Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});Element.PropertiesIFlag={href:2,src:2};Element.Methods={Listeners:{addListener:function(D,C){if(this.addEventListener){this.addEventListener(D,C,false)}else{this.attachEvent("on"+D,C)}return this},removeListener:function(D,C){if(this.removeEventListener){this.removeEventListener(D,C,false)}else{this.detachEvent("on"+D,C)}return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(B){if(!B.$tmp){Garbage.elements.push(B);B.$tmp={opacity:1}}return B},trash:function(J){for(var L=0,G=J.length,K;L<G;L++){if(!(K=J[L])||!K.$tmp){continue}if(K.$events){K.fireEvent("trash").removeEvents()}for(var I in K.$tmp){K.$tmp[I]=null}for(var H in Element.prototype){K[H]=null}Garbage.elements[Garbage.elements.indexOf(K)]=null;K.htmlElement=K.$tmp=K=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(E){if(E&&E.$extended){return E}this.$extended=true;E=E||window.event;this.event=E;this.type=E.type;this.target=E.target||E.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=E.shiftKey;this.control=E.ctrlKey;this.alt=E.altKey;this.meta=E.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(E.wheelDelta)?E.wheelDelta/120:-(E.detail||0)/3}else{if(this.type.contains("key")){this.code=E.which||E.keyCode;for(var F in Event.keys){if(Event.keys[F]==this.code){this.key=F;break}}if(this.type=="keydown"){var D=this.code-111;if(D>0&&D<13){this.key="f"+D}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(this.type.test(/(click|mouse|menu)/)){this.page={x:E.pageX||E.clientX+document.documentElement.scrollLeft,y:E.pageY||E.clientY+document.documentElement.scrollTop};this.client={x:E.pageX?E.pageX-window.pageXOffset:E.clientX,y:E.pageY?E.pageY-window.pageYOffset:E.clientY};this.rightClick=(E.which==3)||(E.button==2);switch(this.type){case"mouseover":this.relatedTarget=E.relatedTarget||E.fromElement;break;case"mouseout":this.relatedTarget=E.relatedTarget||E.toElement}this.fixRelatedTarget()}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(B){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Element.Methods.Events={addEvent:function(G,H){this.$events=this.$events||{};this.$events[G]=this.$events[G]||{keys:[],values:[]};if(this.$events[G].keys.contains(H)){return this}this.$events[G].keys.push(H);var E=G;var F=Element.Events[G];if(F){if(F.add){F.add.call(this,H)}if(F.map){H=F.map}if(F.type){E=F.type}}if(!this.addEventListener){H=H.create({bind:this,event:true})}this.$events[G].values.push(H);return(Element.NativeEvents.contains(E))?this.addListener(E,H):this},removeEvent:function(K,L){if(!this.$events||!this.$events[K]){return this}var H=this.$events[K].keys.indexOf(L);if(H==-1){return this}var G=this.$events[K].keys.splice(H,1)[0];var I=this.$events[K].values.splice(H,1)[0];var J=Element.Events[K];if(J){if(J.remove){J.remove.call(this,L)}if(J.type){K=J.type}}return(Element.NativeEvents.contains(K))?this.removeListener(K,I):this},addEvents:function(B){return Element.setMany(this,"addEvent",B)},removeEvents:function(C){if(!this.$events){return this}if(!C){for(var D in this.$events){this.removeEvents(D)}this.$events=null}else{if(this.$events[C]){this.$events[C].keys.each(function(A){this.removeEvent(C,A)},this);this.$events[C]=null}}return this},fireEvent:function(E,F,D){if(this.$events&&this.$events[E]){this.$events[E].keys.each(function(A){A.create({bind:this,delay:D,"arguments":F})()},this)}return this},cloneEvents:function(E,D){if(!E.$events){return this}if(!D){for(var F in E.$events){this.cloneEvents(E,F)}}else{if(E.$events[D]){E.$events[D].keys.each(function(A){this.addEvent(D,A)},this)}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(B){B=new Event(B);if(B.relatedTarget!=this&&!this.hasChild(B.relatedTarget)){this.fireEvent("mouseenter",B)}}},mouseleave:{type:"mouseout",map:function(B){B=new Event(B);if(B.relatedTarget!=this&&!this.hasChild(B.relatedTarget)){this.fireEvent("mouseleave",B)}}},mousewheel:{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(D,C){return this.create({bind:D,"arguments":C,event:Event})}});Elements.extend({filterByTag:function(B){return new Elements(this.filter(function(A){return(Element.getTag(A)==B)}))},filterByClass:function(D,E){var F=this.filter(function(A){return(A.className&&A.className.contains(D," "))});return(E)?F:new Elements(F)},filterById:function(E,F){var D=this.filter(function(A){return(A.id==E)});return(F)?D:new Elements(D)},filterByAttribute:function(J,F,H,G){var I=this.filter(function(B){var A=Element.getProperty(B,J);if(!A){return false}if(!F){return true}switch(F){case"=":return(A==H);case"*=":return(A.contains(H));case"^=":return(A.substr(0,H.length)==H);case"$=":return(A.substr(A.length-H.length)==H);case"!=":return(A!=H);case"~=":return A.contains(H," ")}return false});return(G)?I:new Elements(I)}});function $E(C,D){return($(D)||document).getElement(C)}function $ES(C,D){return($(D)||document).getElementsBySelector(C)}$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(J,H,G,I){var F=[H.namespaceURI?"xhtml:":"",G[1]];if(G[2]){F.push('[@id="',G[2],'"]')}if(G[3]){F.push('[contains(concat(" ", @class, " "), " ',G[3],' ")]')}if(G[4]){if(G[5]&&G[6]){switch(G[5]){case"*=":F.push("[contains(@",G[4],', "',G[6],'")]');break;case"^=":F.push("[starts-with(@",G[4],', "',G[6],'")]');break;case"$=":F.push("[substring(@",G[4],", string-length(@",G[4],") - ",G[6].length,' + 1) = "',G[6],'"]');break;case"=":F.push("[@",G[4],'="',G[6],'"]');break;case"!=":F.push("[@",G[4],'!="',G[6],'"]')}}else{F.push("[@",G[4],"]")}}J.push(F.join(""));return J},getItems:function(N,K,I){var J=[];var H=document.evaluate(".//"+N.join("//"),K,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var L=0,M=H.snapshotLength;L<M;L++){J.push(H.snapshotItem(L))}return(I)?J:new Elements(J.map($))}},normal:{getParam:function(F,I,G,J){if(J==0){if(G[2]){var H=I.getElementById(G[2]);if(!H||((G[1]!="*")&&(Element.getTag(H)!=G[1]))){return false}F=[H]}else{F=$A(I.getElementsByTagName(G[1]))}}else{F=$$.shared.getElementsByTagName(F,G[1]);if(G[2]){F=Elements.filterById(F,G[2],true)}}if(G[3]){F=Elements.filterByClass(F,G[3],true)}if(G[4]){F=Elements.filterByAttribute(F,G[4],G[5],G[6],true)}return F},getItems:function(D,F,E){return(E)?D:$$.unique(D)}},resolver:function(B){return(B=="xhtml")?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(H,I){var G=[];for(var J=0,F=H.length;J<F;J++){G.extend(H[J].getElementsByTagName(I))}return G}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(I,J){var O=[];I=I.trim().split(" ");for(var M=0,N=I.length;M<N;M++){var L=I[M];var K=L.match($$.shared.regexp);if(!K){break}K[1]=K[1]||"*";var P=$$.shared[$$.shared.method].getParam(O,this,K,M);if(!P){break}O=P}return $$.shared[$$.shared.method].getItems(O,this,J)},getElement:function(B){return $(this.getElements(B,true)[0]||false)},getElementsBySelector:function(F,G){var H=[];F=F.split(",");for(var I=0,J=F.length;I<J;I++){H=H.concat(this.getElements(F[I],true))}return(G)?H:$$.unique(H)}};Element.extend({getElementById:function(E){var F=document.getElementById(E);if(!F){return false}for(var D=F.parentNode;D!=this;D=D.parentNode){if(!D){return false}}return F},getElementsByClassName:function(B){return this.getElements("."+B)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var B=[];$each(this.options,function(A){if(A.selected){B.push($pick(A.value,A.text))}});return(this.multiple)?B:B[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},toQueryString:function(){var B=[];this.getFormElements().each(function(F){var G=F.name;var A=F.getValue();if(A===false||!G||F.disabled){return }var H=function(C){B.push(G+"="+encodeURIComponent(C))};if($type(A)=="array"){A.each(H)}else{H(A)}});return B.join("&")}});Element.extend({scrollTo:function(C,D){this.scrollLeft=C;this.scrollTop=D},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}}},getPosition:function(E){E=E||[];var H=this,F=0,G=0;do{F+=H.offsetLeft||0;G+=H.offsetTop||0;H=H.offsetParent}while(H);E.each(function(A){F-=A.scrollLeft||0;G-=A.scrollTop||0});return{x:F,y:G}},getTop:function(B){return this.getPosition(B).y},getLeft:function(B){return this.getPosition(B).x},getCoordinates:function(F){var D=this.getPosition(F);var E={width:this.offsetWidth,height:this.offsetHeight,left:D.x,top:D.y};E.right=E.left+E.width;E.bottom=E.top+E.height;return E}});Element.Events.domready={add:function(F){if(window.loaded){F.call(this);return }var D=function(){if(window.loaded){return }window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready")}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){D()}}.periodical(50)}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var E=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+E+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){D()}}}}else{window.addListener("load",D);document.addListener("DOMContentLoaded",D)}}}};window.onDomReady=function(B){return this.addEvent("domready",B)};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth}if(this.opera){return document.body.clientWidth}return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419){return this.innerHeight}if(this.opera){return document.body.clientHeight}return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth)}if(this.webkit){return document.body.scrollWidth}return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight)}if(this.webkit){return document.body.scrollHeight}return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}}},getPosition:function(){return{x:0,y:0}}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(B){return -(Math.cos(Math.PI*B)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(B){this.element=this.element||null;this.setOptions(B);if(this.options.initialize){this.options.initialize.call(this)}},step:function(){var B=$time();if(B<this.time+this.options.duration){this.delta=this.options.transition((B-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(B){this.now=B;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(D,C){return(C-D)*this.delta+D},start:function(D,C){if(!this.options.wait){this.stop()}else{if(this.timer){return this}}this.from=D;this.to=C;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this},stop:function(B){if(!this.timer){return this}this.timer=$clear(this.timer);if(!B){this.fireEvent("onCancel",this.element)}return this},custom:function(D,C){return this.start(D,C)},clearTimer:function(B){return this.stop(B)}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(F,E){if(F.test(/color/i)){return this.Color}var D=$type(E);if((D=="array")||(D=="string"&&E.contains(" "))){return this.Multi}return this.Single},parse:function(K,J,G){if(!G.push){G=[G]}var H=G[0],I=G[1];if(!$chk(I)){I=H;H=K.getStyle(J)}var L=this.select(J,I);return{from:L.parse(H),to:L.parse(I),css:L}}};Fx.CSS.Single={parse:function(B){return parseFloat(B)},getNow:function(E,F,D){return D.compute(E,F)},getValue:function(E,D,F){if(D=="px"&&F!="opacity"){E=Math.round(E)}return E+D}};Fx.CSS.Multi={parse:function(B){return B.push?B:B.split(" ").map(function(A){return parseFloat(A)})},getNow:function(G,H,I){var F=[];for(var J=0;J<G.length;J++){F[J]=I.compute(G[J],H[J])}return F},getValue:function(E,D,F){if(D=="px"&&F!="opacity"){E=E.map(Math.round)}return E.join(D+" ")+D}};Fx.CSS.Color={parse:function(B){return B.push?B:B.hexToRgb(true)},getNow:function(G,H,I){var F=[];for(var J=0;J<G.length;J++){F[J]=Math.round(I.compute(G[J],H[J]))}return F},getValue:function(B){return"rgb("+B.join(",")+")"}};Fx.Style=Fx.Base.extend({initialize:function(F,E,D){this.element=$(F);this.property=E;this.parent(D)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)},set:function(B){this.css=Fx.CSS.select(this.property,B);return this.parent(this.css.parse(B))},start:function(E,F){if(this.timer&&this.options.wait){return this}var D=Fx.CSS.parse(this.element,this.property,[E,F]);this.css=D.css;return this.parent(D.from,D.to)},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property))}});Element.extend({effect:function(D,C){return new Fx.Style(this,D,C)}});Fx.Styles=Fx.Base.extend({initialize:function(D,C){this.element=$(D);this.parent(C)},setNow:function(){for(var B in this.from){this.now[B]=this.css[B].getNow(this.from[B],this.to[B],this)}},set:function(E){var D={};this.css={};for(var F in E){this.css[F]=Fx.CSS.select(F,E[F]);D[F]=this.css[F].parse(E[F])}return this.parent(D)},start:function(I){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var G={},H={};for(var J in I){var F=Fx.CSS.parse(this.element,J,I[J]);G[J]=F.from;H[J]=F.to;this.css[J]=F.css}return this.parent(G,H)},increase:function(){for(var B in this.now){this.element.setStyle(B,this.css[B].getValue(this.now[B],this.options.unit,B))}}});Element.extend({effects:function(B){return new Fx.Styles(this,B)}});Fx.Elements=Fx.Base.extend({initialize:function(D,C){this.elements=$$(D);this.parent(C)},setNow:function(){for(var K in this.from){var H=this.from[K],I=this.to[K],L=this.css[K],G=this.now[K]={};for(var J in H){G[J]=L[J].getNow(H[J],I[J],this)}}},set:function(I){var N={};this.css={};for(var L in I){var J=I[L],M=this.css[L]={},H=N[L]={};for(var K in J){M[K]=Fx.CSS.select(K,J[K]);H[K]=M[K].parse(J[K])}}return this.parent(N)},start:function(K){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var P={},O={};for(var T in K){var R=K[T],N=P[T]={},Q=O[T]={},L=this.css[T]={};for(var M in R){var S=Fx.CSS.parse(this.elements[T],M,R[M]);N[M]=S.from;Q[M]=S.to;L[M]=S.css}}return this.parent(P,O)},increase:function(){for(var G in this.now){var E=this.now[G],H=this.css[G];for(var F in E){this.elements[G].setStyle(F,H[F].getValue(E[F],this.options.unit,F))}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(D,C){this.now=[];this.element=$(D);this.bound={stop:this.stop.bind(this,false)};this.parent(C);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)}.bind(this))}},setNow:function(){for(var B=0;B<2;B++){this.now[B]=this.compute(this.from[B],this.to[B])}},scrollTo:function(L,H){if(this.timer&&this.options.wait){return this}var J=this.element.getSize();var K={x:L,y:H};for(var I in J.size){var G=J.scrollSize[I]-J.size[I];if($chk(K[I])){K[I]=($type(K[I])=="number")?K[I].limit(0,G):G}else{K[I]=J.scroll[I]}K[I]+=this.options.offset[I]}return this.start([J.scroll.x,J.scroll.y],[K.x,K.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",false)},toElement:function(F){var D=this.element.getPosition(this.options.overflown);var E=$(F).getPosition(this.options.overflown);return this.scrollTo(E.x-D.x,E.y-D.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(D,C){this.element=$(D);this.wrapper=new Element("div",{styles:$extend(this.element.getStyles("margin"),{overflow:"hidden"})}).injectAfter(this.element).adopt(this.element);this.element.setStyle("margin",0);this.setOptions(C);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0)});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper)}})}},destroy:function(){this.element.injectAfter(this.wrapper);this.wrapper.remove()},setNow:function(){for(var B=0;B<2;B++){this.now[B]=this.compute(this.from[B],this.to[B])}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},slideIn:function(B){this[B||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset])},slideOut:function(B){this[B||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0])},hide:function(B){this[B||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(B){this[B||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(B){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(B)}return this.slideOut(B)},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)}});Fx.Transition=function(D,C){C=C||[];if($type(C)!="array"){C=[C]}return $extend(D,{easeIn:function(A){return D(A,C)},easeOut:function(A){return 1-D(1-A,C)},easeInOut:function(A){return(A<=0.5)?D(2*A,C)/2:(2-D(2*(1-A),C))/2}})};Fx.Transitions=new Abstract({linear:function(B){return B}});Fx.Transitions.extend=function(C){for(var D in C){Fx.Transitions[D]=new Fx.Transition(C[D]);Fx.Transitions.compat(D)}};Fx.Transitions.compat=function(B){["In","Out","InOut"].each(function(A){Fx.Transitions[B.toLowerCase()+A]=Fx.Transitions[B]["ease"+A]})};Fx.Transitions.extend({Pow:function(D,C){return Math.pow(D,C[0]||6)},Expo:function(B){return Math.pow(2,8*(B-1))},Circ:function(B){return 1-Math.sin(Math.acos(B))},Sine:function(B){return 1-Math.sin((1-B)*Math.PI/2)},Back:function(D,C){C=C[0]||1.618;return Math.pow(D,2)*((C+1)*D-C)},Bounce:function(F){var G;for(var H=0,E=1;1;H+=E,E/=2){if(F>=(7-4*H)/11){G=-Math.pow((11-6*H-11*F)/4,2)+E*E;break}}return G},Elastic:function(D,C){return Math.pow(2,10*--D)*Math.cos(20*D*Math.PI*(C[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(D,C){Fx.Transitions[D]=new Fx.Transition(function(A){return Math.pow(A,[C+2])});Fx.Transitions.compat(D)});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(D,C){this.setOptions(C);this.element=$(D);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),stop:this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(G){this.fireEvent("onBeforeStart",this.element);this.mouse.start=G.page;var E=this.options.limit;this.limit={x:[],y:[]};for(var F in this.options.modifiers){if(!this.options.modifiers[F]){continue}this.value.now[F]=this.element.getStyle(this.options.modifiers[F]).toInt();this.mouse.pos[F]=G.page[F]-this.value.now[F];if(E&&E[F]){for(var H=0;H<2;H++){if($chk(E[F][H])){this.limit[F][H]=($type(E[F][H])=="function")?E[F][H]():E[F][H]}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);G.stop()},check:function(C){var D=Math.round(Math.sqrt(Math.pow(C.page.x-this.mouse.start.x,2)+Math.pow(C.page.y-this.mouse.start.y,2)));if(D>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(C);this.fireEvent("onSnap",this.element)}C.stop()},drag:function(C){this.out=false;this.mouse.now=C.page;for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}this.value.now[D]=this.mouse.now[D]-this.mouse.pos[D];if(this.limit[D]){if($chk(this.limit[D][1])&&(this.value.now[D]>this.limit[D][1])){this.value.now[D]=this.limit[D][1];this.out=true}else{if($chk(this.limit[D][0])&&(this.value.now[D]<this.limit[D][0])){this.value.now[D]=this.limit[D][0];this.out=true}}}if(this.options.grid[D]){this.value.now[D]-=(this.value.now[D]%this.options.grid[D])}this.element.setStyle(this.options.modifiers[D],this.value.now[D]+this.options.unit)}this.fireEvent("onDrag",this.element);C.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(B){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},B))}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);return this},initialize:function(C){this.setTransport().setOptions(C);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var D=(this.options.encoding)?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+D)}if(this.options.initialize){this.options.initialize.call(this)}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return }this.running=false;var C=0;try{C=this.transport.status}catch(D){}if(this.options.isSuccess.call(this,C)){this.onSuccess()}else{this.onFailure()}this.transport.onreadystatechange=Class.empty},isSuccess:function(B){return((B>=200)&&(B<300))},onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(C,D){this.headers[C]=D;return this},send:function(E,G){if(this.options.autoCancel){this.cancel()}else{if(this.running){return this}}this.running=true;if(G&&this.options.method=="get"){E=E+(E.contains("?")?"&":"?")+G;G=null}this.transport.open(this.options.method.toUpperCase(),E,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close")}$extend(this.headers,this.options.headers);for(var H in this.headers){try{this.transport.setRequestHeader(H,this.headers[H])}catch(F){}}this.fireEvent("onRequest");this.transport.send($pick(G,null));return this},cancel:function(){if(!this.running){return this}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options);var Ajax2=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(D,C){this.addEvent("onSuccess",this.onComplete);this.setOptions(C);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.url=D},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text)}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts()}this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(B){B=B||this.options.data;switch($type(B)){case"element":B=$(B).toQueryString();break;case"object":B=Object.toQueryString(B)}if(this._method){B=(B)?[this._method,B].join("&"):this._method}return this.send(this.url,B)},evalScripts:function(){var F,D;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){D=this.response.text}else{D=[];var E=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((F=E.exec(this.response.text))){D.push(F[1])}D=D.join("\n")}if(D){(window.execScript)?window.execScript(D):window.setTimeout(D,0)}},getHeader:function(C){try{return this.transport.getResponseHeader(C)}catch(D){}return null}});Object.toQueryString=function(F){var E=[];for(var D in F){E.push(encodeURIComponent(D)+"="+encodeURIComponent(F[D]))}return E.join("&")};Element.extend({send:function(B){return new Ajax2(this.getProperty("action"),$merge({data:this.toQueryString()},B,{method:"post"})).request()}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(G,F,H){H=$merge(this.options,H);F=encodeURIComponent(F);if(H.domain){F+="; domain="+H.domain}if(H.path){F+="; path="+H.path}if(H.duration){var E=new Date();E.setTime(E.getTime()+H.duration*24*60*60*1000);F+="; expires="+E.toGMTString()}if(H.secure){F+="; secure"}document.cookie=G+"="+F;return $extend(H,{key:G,value:F})},get:function(C){var D=document.cookie.match("(?:^|;)\\s*"+C.escapeRegExp()+"=([^;]*)");return D?decodeURIComponent(D[1]):false},remove:function(D,C){if($type(D)=="object"){this.set(D.key,"",$merge(D,{duration:-1}))}else{this.set(D,"",$merge(C,{duration:-1}))}}});var Json={toString:function(E){switch($type(E)){case"string":return'"'+E.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+E.map(Json.toString).join(",")+"]";case"object":var D=[];for(var F in E){D.push(Json.toString(F)+":"+Json.toString(E[F]))}return"{"+D.join(",")+"}";case"number":if(isFinite(E)){break}case false:return"null"}return String(E)},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")")}};Json.Remote=XHR.extend({initialize:function(D,C){this.url=D;this.addEvent("onSuccess",this.onComplete);this.parent(C);this.setHeader("X-Request","JSON")},send:function(B){return this.parent(this.url,"json="+Json.toString(B))},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)])}});var Asset=new Abstract({javascript:function(E,F){F=$merge({onload:Class.empty},F);var D=new Element("script",{src:E}).addEvents({load:F.onload,readystatechange:function(){if(this.readyState=="complete"){this.fireEvent("load")}}});delete F.onload;return D.setProperties(F).inject(document.head)},css:function(D,C){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:D},C)).inject(document.head)},image:function(G,H){H=$merge({onload:Class.empty,onabort:Class.empty,onerror:Class.empty},H);var F=new Image();F.src=G;var E=new Element("img",{src:G});["load","abort","error"].each(function(B){var A=H["on"+B];delete H["on"+B];E.addEvent(B,function(){this.removeEvent(B,arguments.callee);A.call(this)})});if(F.width&&F.height){E.fireEvent("load",E,1)}return E.setProperties(H)},images:function(F,G){G=$merge({onComplete:Class.empty,onProgress:Class.empty},G);if(!F.push){F=[F]}var E=[];var H=0;F.each(function(A){var B=new Asset.image(A,{onload:function(){G.onProgress.call(this,H);H++;if(H==F.length){G.onComplete()}}});E.push(B)});return new Elements(E)}});var Hash=new Class({length:0,initialize:function(B){this.obj=B||{};this.setLength()},get:function(B){return(this.hasKey(B))?this.obj[B]:null},hasKey:function(B){return(B in this.obj)},set:function(C,D){if(!this.hasKey(C)){this.length++}this.obj[C]=D;return this},setLength:function(){this.length=0;for(var B in this.obj){this.length++}return this},remove:function(B){if(this.hasKey(B)){delete this.obj[B];this.length--}return this},each:function(C,D){$each(this.obj,C,D)},extend:function(B){$extend(this.obj,B);return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var C=[];for(var D in this.obj){C.push(D)}return C},values:function(){var C=[];for(var D in this.obj){C.push(this.obj[D])}return C}});function $H(B){return new Hash(B)}Hash.Cookie=Hash.extend({initialize:function(D,C){this.name=D;this.options=$extend({autoSave:true},C||{});this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true}var B=Json.toString(this.obj);if(B.length>4096){return false}Cookie.set(this.name,B,this.options);return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength()}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(B){Hash.Cookie.Methods[B]=function(){Hash.prototype[B].apply(this,arguments);if(this.options.autoSave){this.save()}return this}});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(H,F){F=F||(H.push?"rgb":"hex");var G,E;switch(F){case"rgb":G=H;E=G.rgbToHsb();break;case"hsb":G=H.hsbToRgb();E=H;break;default:G=H.hexToRgb(true);E=G.rgbToHsb()}G.hsb=E;G.hex=G.rgbToHex();return $extend(G,Color.prototype)},mix:function(){var D=$A(arguments);var E=($type(D[D.length-1])=="number")?D.pop():50;var F=this.copy();D.each(function(B){B=new Color(B);for(var A=0;A<3;A++){F[A]=Math.round((F[A]/100*(100-E))+(B[A]/100*E))}});return new Color(F,"rgb")},invert:function(){return new Color(this.map(function(B){return 255-B}))},setHue:function(B){return new Color([B,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(B){return new Color([this.hsb[0],B,this.hsb[2]],"hsb")},setBrightness:function(B){return new Color([this.hsb[0],this.hsb[1],B],"hsb")}});function $RGB(E,F,D){return new Color([E,F,D],"rgb")}function $HSB(E,F,D){return new Color([E,F,D],"hsb")}Array.extend({rgbToHsb:function(){var O=this[0],N=this[1],S=this[2];var V,W,U;var T=Math.max(O,N,S),X=Math.min(O,N,S);var R=T-X;U=T/255;W=(T!=0)?R/T:0;if(W==0){V=0}else{var M=(T-O)/R;var P=(T-N)/R;var Q=(T-S)/R;if(O==T){V=Q-P}else{if(N==T){V=2+M-Q}else{V=4+P-M}}V/=6;if(V<0){V++}}return[Math.round(V*360),Math.round(W*100),Math.round(U*100)]},hsbToRgb:function(){var K=Math.round(this[2]/100*255);if(this[1]==0){return[K,K,K]}else{var G=this[0]%360;var I=G%60;var H=Math.round((this[2]*(100-this[1]))/10000*255);var J=Math.round((this[2]*(6000-this[1]*I))/600000*255);var L=Math.round((this[2]*(6000-this[1]*(60-I)))/600000*255);switch(Math.floor(G/60)){case 0:return[K,L,H];case 1:return[J,K,H];case 2:return[H,K,L];case 3:return[H,J,K];case 4:return[L,H,K];case 5:return[K,H,J]}}return false}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(C,D){this.element.scrollTo(C,D)}},initialize:function(D,C){this.setOptions(C);this.element=$(D);this.mousemover=([window,document].contains(D))?$(document.body):this.element},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(B){this.page=(this.element==window)?B.client:B.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var E=this.element.getSize();var F=this.element.getPosition();var G={x:0,y:0};for(var H in this.page){if(this.page[H]<(this.options.area+F[H])&&E.scroll[H]!=0){G[H]=(this.page[H]-this.options.area-F[H])*this.options.velocity}else{if(this.page[H]+this.options.area>(E.size[H]+F[H])&&E.scroll[H]+E.size[H]!=E.scrollSize[H]){G[H]=(this.page[H]-E.size[H]+this.options.area-F[H])*this.options.velocity}}}if(G.y||G.x){this.fireEvent("onChange",[E.scroll.x+G.x,E.scroll.y+G.y])}}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(B){this.knob.setStyle(this.p,B)},mode:"horizontal",steps:100,offset:0},initialize:function(J,G,L){this.element=$(J);this.knob=$(G);this.setOptions(L);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var K,H;switch(this.options.mode){case"horizontal":this.z="x";this.p="left";K={x:"left",y:false};H="offsetWidth";break;case"vertical":this.z="y";this.p="top";K={x:false,y:"top"};H="offsetHeight"}this.max=this.element[H]-this.knob[H]+(this.options.offset*2);this.half=this.knob[H]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);var I={};I[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:I,modifiers:K,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.initialize){this.options.initialize.call(this)}},set:function(B){this.step=B.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(D){var C=D.page[this.z]-this.getPos()-this.half;C=C.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(C);this.checkStep();this.end();this.fireEvent("onTick",C)},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(B){return Math.round((B+this.options.offset)/this.max*this.options.steps)},toPosition:function(B){return this.max*B/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(D){this.parent(window,D);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var C=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(A){if(A.href.indexOf(C)!=0){return }var B=A.href.substr(C.length);if(B&&$(B)){this.useLink(A,B)}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor})}},useLink:function(D,C){D.addEvent("click",function(A){this.anchor=C;this.toElement(C);A.stop()}.bindWithEvent(this))}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(C,D){D.setStyle("opacity",0.7);C.setStyle("opacity",0.7)},onDragComplete:function(C,D){C.setStyle("opacity",1);D.remove();this.trash.remove()}},initialize:function(F,H){this.setOptions(H);this.list=$(F);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={start:[],moveGhost:this.moveGhost.bindWithEvent(this)};for(var G=0,E=this.handles.length;G<E;G++){this.bound.start[G]=this.start.bindWithEvent(this,this.elements[G])}this.attach();if(this.options.initialize){this.options.initialize.call(this)}this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this)},attach:function(){this.handles.each(function(D,C){D.addEvent("mousedown",this.bound.start[C])},this)},detach:function(){this.handles.each(function(D,C){D.removeEvent("mousedown",this.bound.start[C])},this)},start:function(E,F){this.active=F;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var D=F.getPosition();this.offset=E.page.y-D.y;this.trash=new Element("div").inject(document.body);this.ghost=F.clone().inject(this.trash).setStyles({position:"absolute",left:D.x,top:E.page.y-this.offset});document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[F,this.ghost])}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);this.fireEvent("onStart",F);E.stop()},moveGhost:function(C){var D=C.page.y-this.offset;D=D.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",D);C.stop()},move:function(G){var J=G.page.y;this.previous=this.previous||J;var F=((this.previous-J)>0);var H=this.active.getPrevious();var I=this.active.getNext();if(H&&F&&J<H.getCoordinates().bottom){this.active.injectBefore(H)}if(I&&!F&&J>I.getCoordinates().top){this.active.injectAfter(I)}this.previous=J},serialize:function(B){return this.list.getChildren().map(B||function(A){return this.elements.indexOf(A)},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(B){B.setStyle("visibility","visible")},onHide:function(B){B.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(D,C){this.setOptions(C);this.toolTip=new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}}).inject(document.body);this.wrapper=new Element("div").inject(this.toolTip);$$(D).each(this.build,this);if(this.options.initialize){this.options.initialize.call(this)}},build:function(F){F.$tmp.myTitle=(F.href&&F.getTag()=="a")?F.href.replace("http://",""):(F.rel||false);if(F.title){var E=F.title.split("::");if(E.length>1){F.$tmp.myTitle=E[0].trim();F.$tmp.myText=E[1].trim()}else{F.$tmp.myText=F.title}F.removeAttribute("title")}else{F.$tmp.myText=false}if(F.$tmp.myTitle&&F.$tmp.myTitle.length>this.options.maxTitleChars){F.$tmp.myTitle=F.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;"}F.addEvent("mouseenter",function(A){this.start(F);if(!this.options.fixed){this.locate(A)}else{this.position(F)}}.bind(this));if(!this.options.fixed){F.addEvent("mousemove",this.locate.bindWithEvent(this))}var D=this.end.bind(this);F.addEvent("mouseleave",D);F.addEvent("trash",D)},start:function(B){this.wrapper.empty();if(B.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(B.$tmp.myTitle)}if(B.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(B.$tmp.myText)}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(B){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(C){var D=C.getPosition();this.toolTip.setStyles({left:D.x+this.options.offsets.x,top:D.y+this.options.offsets.y})},locate:function(N){var L={x:window.getWidth(),y:window.getHeight()};var H={x:window.getScrollLeft(),y:window.getScrollTop()};var M={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight};var I={x:"left",y:"top"};for(var K in I){var J=N.page[K]+this.options.offsets[K];if((J+M[K]-H[K])>L[K]){J=N.page[K]-this.options.offsets[K]-M[K]}this.toolTip.setStyle(I[K],J)}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this)}this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={}},addEvent:function(D,C){this.checker[D]=this.checker[D]||{};this.events[D]=this.events[D]||[];if(this.events[D].contains(C)){return false}else{this.events[D].push(C)}this.instances.each(function(B,A){B.addEvent(D,this.check.bind(this,[D,B,A]))},this);return this},check:function(G,E,H){this.checker[G][H]=true;var F=this.instances.every(function(A,B){return this.checker[G][B]||false},this);if(!F){return }this.checker[G]={};this.events[G].each(function(A){A.call(this,this.instances,E)},this)}});document.iframeLoaders={};Porkiframe=new Class({initialize:function(D,C){this.form=$(D);this.setOptions(this.defaultOptions,C);this.options.uniqueId=new Date().getTime();document.iframeLoaders[this.options.uniqueId]=this;this.transport=this.getTransport()},defaultOptions:{onComplete:null,update:null,updateMultiple:null,uniqueId:null},request:function(){this.form.target="frame_"+this.options.uniqueId;this.form.setAttribute("target","frame_"+this.options.uniqueId);this.form.submit();return false},getResponse:function(){var C="Failed to get response document";try{var C=this.transport.contentDocument.document.body.innerHTML;this.transport.contentDocument.document.close()}catch(D){try{var C=this.transport.contentWindow.document.body.innerHTML;this.transport.contentWindow.document.close()}catch(D){try{var C=this.transport.document.body.innerHTML;this.transport.document.body.close()}catch(D){try{var C=window.frames["frame_"+this.options.uniqueId].document.body.innerText}catch(D){}}}}return C},onStateChange:function(){this.transport.responseText=this.getResponse();if(this.options.onComplete){setTimeout(function(){this.options.onComplete(this.transport)}.bind(this),10)}if(this.options.update){setTimeout(function(){$(this.options.update).innerHTML=this.transport.responseText}.bind(this),10)}if(this.options.updateMultiple){setTimeout(function(){try{var hasscript=false;eval("var inputObject = "+this.transport.responseText);for(var i in inputObject){if(i=="script"){hasscript=true}else{if(elm=$(i)){elm.innerHTML=inputObject[i]}else{alert("element "+i+" not found!")}}}if(hasscript){eval(inputObject.script)}}catch(e){}}.bind(this),10)}},getTransport:function(){var B=new Element("DIV",{styles:{position:"absolute",top:0,marginLeft:-10000}});if(navigator.userAgent.indexOf("MSIE")>0&&navigator.userAgent.indexOf("Opera")==-1){B.innerHTML='<iframe name="frame_'+this.options.uniqueId+'" id="frame_'+this.options.uniqueId+'" src="about:blank" onload="setTimeout(function(){document.iframeLoaders['+this.options.uniqueId+'].onStateChange()},20);"></iframe>'}else{FrameEl=new Element("iframe",{name:"frame_"+this.options.uniqueId,id:"frame_"+this.options.uniqueId,events:{load:function(){this.onStateChange()}.bind(this)}}).injectInside(B)}B.injectInside(document.body);return $("frame_"+this.options.uniqueId)}});Porkiframe.implement(new Options);window.addEvent("domready",function(){if($type($("tab_notyetreplied"))){$("tab_notyetreplied").addEvent("click",showTab.pass(4));$("tab_notyetreplied").setProperty("href","javascript:void(0)")}if($type($("mini_notyetreplied"))){$("mini_notyetreplied").addEvent("click",showTab.pass(4));$("mini_notyetreplied").setProperty("href","#guestlist")}if($type($("tab_yes"))){$("tab_yes").addEvent("click",showTab.pass(1));$("tab_yes").setProperty("href","javascript:void(0)")}if($type($("mini_yes"))){$("mini_yes").addEvent("click",showTab.pass(1));$("mini_yes").setProperty("href","#guestlist")}if($type($("tab_no"))){$("tab_no").addEvent("click",showTab.pass(2));$("tab_no").setProperty("href","javascript:void(0)")}if($type($("mini_no"))){$("mini_no").addEvent("click",showTab.pass(2));$("mini_no").setProperty("href","#guestlist")}if($type($("tab_maybe"))){$("tab_maybe").addEvent("click",showTab.pass(3));$("tab_maybe").setProperty("href","javascript:void(0)")}if($type($("mini_maybe"))){$("mini_maybe").addEvent("click",showTab.pass(3));$("mini_maybe").setProperty("href","#guestlist")}$$(".delete_tag").each(function(A){A.addEvent("click",function(F){var C=new Event(F).stop();var B=$(C.target);var D=B.getProperty("dest");var G=B.getProperty("src");var E=new Ajax2("/batch.events.php",{data:{delete_tag:"1",dest:D,src:G},onComplete:function(H){if(H==1){B.getParent().getParent().remove()}}}).request()})});$ES(".rsvpform").each(function(A){A.addEvent("submit",function(F){var E=new Event(F).target;new Event(F).stop();var C=$ES("input[name=response]",E);var D=C.filter(function(H,G){return H.checked});var B=false;if(D.length==0){alert("Please select a response");B=true}if($type($ES("input[name=name]",E))&&$ES("input[name=name]",E)[0].getValue().trim()==""){alert("Please enter your name");B=true}if(B){return false}this.send({onComplete:function(H){H=Json.evaluate(H);if(H.cookie){Cookie.set(H.cookie.id,H.cookie.val)}var G=E.getElements(".rsvp_container_"+H.itemid)[0];if(!H.error){$("event_input_attending_final1_"+H.itemid).removeProperty("checked");$("event_input_attending_final2_"+H.itemid).removeProperty("checked");$("event_input_attending_final3_"+H.itemid).removeProperty("checked");if(H.response==1){$("event_input_attending_final1_"+H.itemid).setProperty("checked","checked")}if(H.response==2){$("event_input_attending_final2_"+H.itemid).setProperty("checked","checked")}if(H.response==3){$("event_input_attending_final3_"+H.itemid).setProperty("checked","checked")}if($type(H.response_message)){$("event_text_attending_"+H.itemid).setHTML(event_response.replace("###",H.response_message.toUpperCase()))}if($type($("event_input_name_"+H.itemid))){$("event_input_name_"+H.itemid).setProperty("value",H.name);$("event_text_name_"+H.itemid).setHTML(H.name)}if($type($("event_input_email_"+H.itemid))){$("event_input_email_"+H.itemid).setProperty("value",H.dest_email);$("event_text_email_"+H.itemid).setHTML(H.dest_email)}$("event_input_message_final_"+H.itemid).setHTML(H.message_from_user);$("event_text_message_final_"+H.itemid).setHTML(H.message_from_user);if(H.nbguest==1){$("event_input_guests_final1_"+H.itemid).setProperty("selected","selected")}if(H.nbguest==2){$("event_input_guests_final2_"+H.itemid).setProperty("selected","selected")}if(H.nbguest==3){$("event_input_guests_final3_"+H.itemid).setProperty("selected","selected")}if(H.nbguest==4){$("event_input_guests_final4_"+H.itemid).setProperty("selected","selected")}if(H.nbguest==5){$("event_input_guests_final5_"+H.itemid).setProperty("selected","selected")}$("event_text_guests_final_"+H.itemid).setHTML(H.nbguest);$("event_input_attending_"+H.itemid).setStyle("display","none");$("event_text_attending_"+H.itemid).setStyle("display","block");if($type($("event_input_name_"+H.itemid))){$("event_input_name_"+H.itemid).setStyle("display","none");$("event_text_name_"+H.itemid).setStyle("display","block")}if($type($("event_input_email_"+H.itemid))){$("event_input_email_"+H.itemid).setStyle("display","none");$("event_text_email_"+H.itemid).setStyle("display","block")}$("event_input_message_"+H.itemid).setStyle("display","none");$("event_text_message_"+H.itemid).setStyle("display","block");$("event_input_guests_"+H.itemid).setStyle("display","none");$("event_text_guests_"+H.itemid).setStyle("display","block");$("event_input_submit_"+H.itemid).setStyle("display","none");$("event_text_submit_"+H.itemid).setStyle("display","block");if($("registerSmall")){launchLB.delay(1000)}else{if($type($("viewevent"))){window.location="?invite_1";return }}}}})})});$ES(".smalltab").each(function(A){var A=$(A);A.setProperty("href","#");A.addEvent("click",changeSmalltab.bindWithEvent(this))});$ES(".smalltab4").each(function(A){var A=$(A);A.setProperty("href","#");A.addEvent("click",changeSmalltab4.bindWithEvent(this))});$ES(".expandBigEvent").each(function(A){A.addEvent("click",toggleSmallBig.bindWithEvent(this,[A.getProperty("id").replace("changersvp_",""),true,true]))});$ES(".event_big").each(function(A){A.addEvent("click",toggleSmallBig.bindWithEvent(this,[A.getProperty("id").replace("event_big_",""),false,false]))});if($type($("related_blog_multi"))){$("related_blog_multi").getElements("a").each(function(A){A.addEvent("click",function(C){var B=new Event(C);B.stop();new Json.Remote("/batch.events.php?related=1",{onComplete:function(D){$each(D.content,function(F){var E=new Element("li");E.setHTML(F.fullname);new Element(a).setProperty("href",F.url).setHTML(F.subject).injectTop(E);$("related_blog").adopt(E)});$("related_blog").setHTML()}}).send({type:"blog",itemid:A.getProperty("itemid"),page:A.getProperty("page")})})})}});var request;function showTab(A){var C=$("tab_guest");C.setStyle("background","transparent url(/images/photowidget/wait.gif) no-repeat center center;");var B=new Element("ul").setStyles({padding:"0 0 1.75em 1em",margin:0,"list-style":"none","line-height":"1em"});if(request){request.cancel()}request=new Json.Remote("?ajax_1_response_"+A,{onComplete:function(D){$("tab_notyetreplied").setStyle("background-position","0 -26px");$("tab_yes").setStyle("background-position","0 -26px");$("tab_no").setStyle("background-position","0 -26px");$("tab_maybe").setStyle("background-position","0 -26px");switch(A){case 4:$("tab_notyetreplied").setStyle("background-position","0 0");$("view_all").setProperty("href","?type_notyetreplied");break;case 1:$("tab_yes").setStyle("background-position","0 0");$("view_all").setProperty("href","?type_yes");break;case 2:$("tab_no").setStyle("background-position","0 0");$("view_all").setProperty("href","?type_no");break;case 3:$("tab_maybe").setStyle("background-position","0 0");$("view_all").setProperty("href","?type_maybe");break}if(!$type(D.data)||D.data.length==0){C.empty();C.setStyle("background","none");if(D.unregistered>0){var E=new Element("div").addClass("xspace-noticemsg").setHTML(more_user.replace("###",D.unregistered)).injectInside(C)}else{var E=new Element("div").addClass("xspace-noticemsg").setHTML(no_friends).injectInside(C)}return }$each(D.data,function(I){var H=new Element("img").setProperty("src",I.photo).addClass("avatar").setStyles({width:"75px",height:"56px"});var J=new Element("div").setStyles({"font-size":"90%","font-weight":"bold",clear:"both",margin:"0",padding:"0"}).setHTML(I.full_name);if(I.domain){var G=new Element("a").setProperty("href","/"+I.domain).adopt(H).adopt(J)}else{var G=new Element("div").setStyles({margin:"0"}).adopt(H).adopt(J)}var F=new Element("li").setStyles({padding:"0",display:"inline",margin:"3px",width:"80px",height:"90px"}).addClass("xspace-avatarlist").addClass("xspace-imgstyle").adopt(G).injectInside(B)},this);C.empty();C.adopt(B);if(D.unregistered>0){var E=new Element("div").addClass("xspace-noticemsg").setStyle("clear","both").setHTML(more_user.replace("###",D.unregistered)).injectInside(C)}C.setStyle("background","none")}}).send()}function eventShowRightList(B,A){if(B=="mine"){$("event_right_mine_on").setStyle("display","");$("event_right_mine_off").setStyle("display","none");$("event_right_attend_on").setStyle("display","none");$("event_right_attend_off").setStyle("display","");request=new Json.Remote("/batch.events.php?right_event=1",{onComplete:function(D){$("event_right_list").setHTML(D.text);var E=new Element("a").setProperty("href","$event_right_mine_url").setHTML(view_all+"  ("+D.numevent+") &gt;");var C=new Element("li").addClass("xspace-blockfooter").adopt(E).injectInside($("event_right_list"))}}).send({type:B,uid:A})}else{if(B=="taggedin"){request=new Json.Remote("/batch.events.php?right_event=1",{onComplete:function(D){$("event_right_list").setHTML(D.text);var E=new Element("a").setProperty("href","$event_right_mine_url").setHTML(view_all+"  ("+D.numevent+") &gt;");var C=new Element("li").addClass("xspace-blockfooter").adopt(E).injectInside($("event_right_list"))}}).send({type:B,uid:A})}else{$("event_right_mine_on").setStyle("display","none");$("event_right_mine_off").setStyle("display","");$("event_right_attend_on").setStyle("display","");$("event_right_attend_off").setStyle("display","none");request=new Json.Remote("/batch.events.php?right_event=1",{onComplete:function(D){$("event_right_list").setHTML(D.text);var E=new Element("a").setProperty("href","$event_right_attend_url").setHTML(view_all+"  ("+D.numevent+") &gt;");var C=new Element("li").addClass("xspace-blockfooter").adopt(E).injectInside($("event_right_list"))}}).send({type:B,uid:A})}}}function eventShowMap(){var A=$("street").innerHTML;if(!A){A=$("location").innerHTML}var B=$("region").innerHTML;$("map").setProperty("href","http://maps.google.com/maps?f=q&hl=en&geocode=&q="+escape(A)+","+escape(B)+"&ie=UTF8&z=12&om=0")}function changeRsvp(A){$("event_input_attending_"+A).setStyle("display","block");$("event_text_attending_"+A).setStyle("display","none");if($type($("event_input_name_"+A))){$("event_input_name_"+A).setStyle("display","block");$("event_text_name_"+A).setStyle("display","none")}if($type($("event_input_email_"+A))){$("event_input_email_"+A).setStyle("display","block");$("event_text_email_"+A).setStyle("display","none")}$("event_input_message_"+A).setStyle("display","block");$("event_text_message_"+A).setStyle("display","none");$("event_input_guests_"+A).setStyle("display","block");$("event_text_guests_"+A).setStyle("display","none");$("event_input_submit_"+A).setStyle("display","block");$("event_text_submit_"+A).setStyle("display","none")}function openMethod(A){for(i=1;i<=2;i++){if(i==A){stylestr="block";imgstr="minus"}else{stylestr="none";imgstr="plus"}document.getElementById("method"+i).style.display=stylestr;document.getElementById("method"+i+"img").src="/images/top/button-"+imgstr+".gif"}}function eventInviteGuest(C,B,F){var E=$("new_guest");uid_selected.push(C);E.setStyle("display","block");var A=new Element("input").setProperty("name","guestuids[]").setProperty("value",C).setProperty("type","hidden");var D=new Element("span").setStyle("float","left").setHTML(unescape(B));var G=new Element("a").setProperty("href","javascript:void(0)").setStyles({"float":"right","padding-right":"4px"}).setHTML("[X]").setProperty("name","uid_close").setProperty("rel",C).addEvent("click",function(J){var I=new Event(J);var H=I.target;$("method1").setStyle("display","");$("method1menu").setStyle("display","");uid_selected.remove(C);if($type($("chk_"+C))){$("chk_"+C).removeProperty("checked");$($("chk_"+C).parentNode.parentNode).setStyle("display","")}$(H.parentNode).remove()});new Element("div").setStyles({clear:"both","padding-left":"4px","line-height":"90%"}).setProperty("id","gl_form_"+C).adopt(D).adopt(G).adopt(A).injectTop(E);$(F.parentNode.parentNode).setStyle("display","none")}function clear_all(){var A=$A(document.getElementsByName("uid_close"));A.each(function(C){var B=C.getProperty("rel");$("method1").setStyle("display","");$("method1menu").setStyle("display","");$("chk_"+B).removeProperty("checked");$($("chk_"+B).parentNode.parentNode).setStyle("display","");$(C.parentNode).remove()});if($("method1a").getStyle("display")=="block"){$("check_all_a").setStyle("display","")}}function changeSmalltab(D){var B=new Event(D).stop();var A=$(B.target);var C=A.getProperty("rel2");$("filter_by_page").setProperty("value",C);change_filter($("filter_by_itemid").getValue(),1)}function changeSmalltab4(G){var C=new Event(G).stop();var B=$(C.target);var E=$("filter_by_itemid").getValue();var D=B.getProperty("rel2");$("filter_by_page").setProperty("value",D);var A=[];var F=[];A[0]="itemid="+E;A[1]="invited=1";A[2]="page="+D;request=new Ajax2("/batch.events.php",{method:"post",data:A.join("&"),onRequest:function(){$("wait_invited").addClass("wait2")},onComplete:function(H){H=Json.evaluate(H);$("invitee_list").empty();$("wait_invited").removeClass("wait2");var I=true;H.uids.each(function(L){var J=new Element("li").setStyles({"float":"none",display:"block",padding:"0",width:"100%",margin:"0","margin-top":"2px","list-style":"none"}).addClass("xspace-imagelist").setProperty("id","gl_form_"+L.uid);if(I){J.setStyle("background-color","transparent");I=false}else{I=true}var K=['<table width="100%"><tr><td align="left" width="11">','<div style="margin:0;padding:0;margin-right:3px;margin-top:1px;float:left;width:11px;height:11px;background:url(/images/events/event_icon.gif) [TO_REPLACE]"></div>','</td><td  align="left">','<a href="/'+L.domain+'" target="_blank">'+L.full_name+"</a>","</td>"];if(H.access==1){K.push('<td align="right" width="20">');K.push("<a onclick=\"javascript:removeUserFromGuestlist('gl_form_','"+L.uid+'\')" style="float:right;margin-right:3px;cursor:pointer">[X]</a>');K.push("</td>")}K.push("</tr></table>");K=K.join("");switch(L.response){case"1":K=K.replace("[TO_REPLACE]","");break;case"2":K=K.replace("[TO_REPLACE]"," 0 -40px");break;case"3":K=K.replace("[TO_REPLACE]"," 0 -60px");break;case"4":K=K.replace("[TO_REPLACE]"," 0 -20px");break}J.setHTML(K).injectInside($("invitee_list"))});createMultipage(H.multipage,$("multipage4"),"4")}}).request()}function createMultipage(F,C,G){if(F.prev>0){var D=new Element("a").addClass("smalltab"+G).setProperty("id","staprev"+G).setProperty("rel2",F.prev).setStyles({"padding-left":"1px","padding-right":"1px"}).setHTML("&lt;");if(G==""){D.addEvent("click",changeSmalltab.bindWithEvent(this))}else{D.addEvent("click",changeSmalltab4.bindWithEvent(this))}}var A=new Element("span").setProperty("id","stalinks"+G);if(F.pages&&F.pages.length>0){F.pages.each(function(J){if(J==F.current){var I=new Element("span").setProperty("href","#").setStyles({"padding-left":"1px","padding-right":"1px"}).setHTML(J).injectInside(A)}else{var H=new Element("a").setProperty("href","#").setProperty("rel2",J).addClass("smalltab"+G).setStyles({"padding-left":"1px","padding-right":"1px"}).setHTML(J);if(G==""){H.addEvent("click",changeSmalltab.bindWithEvent(this)).injectInside(A)}else{H.addEvent("click",changeSmalltab4.bindWithEvent(this)).injectInside(A)}}},this)}if(F.next>0){var B=new Element("a").addClass("smalltab"+G).setProperty("href","#").setProperty("id","staprev"+G).setProperty("rel2",F.next).setStyles({"padding-left":"1px","padding-right":"1px"}).setHTML("&gt;");if(G==""){B.addEvent("click",changeSmalltab.bindWithEvent(this))}else{B.addEvent("click",changeSmalltab4.bindWithEvent(this))}}var E=C.empty();if(F.prev>0){E.adopt(D)}E.adopt(A);if(F.next>0){E.adopt(B)}}function removeUserFromGuestlist(B,A){if(confirm("Warning, you are about to remove a user from the guestlist")){$(B+A).remove();$("remove_form").setStyle("display","");$("remove_button").setStyle("display","");new Element("input").setProperty("name","to_remove[]").setProperty("value",A).setProperty("type","hidden").injectInside($("to_remove"))}}function show_elements(A){A=$A(A);A.each(function(B){B=$(B);if($type(B)){B.setStyle("display","")}})}function hide_elements(A){A=$A(A);A.each(function(B){B=$(B);if($type(B)){B.setStyle("display","none")}})}function toggle_elements(A){A=$A(A);A.each(function(B){B=$(B);if(B.getStyle("display")=="none"){B.setStyle("display","")}else{B.setStyle("display","none")}})}function selectAllFriends(){toggle_elements(["add_all_friends"]);if($("check_fans").getValue()!=1&&$("check_friends").getValue()!=1){show_elements(["method1a","multipagea","filter_by_check_region","filter_by_check_gender","filter_by_check_type"])}else{if($("check_fans").getValue()!=1&&$("check_friends").getValue()==1){hide_elements(["method1a","multipagea","filter_by_check_region","filter_by_check_gender","filter_by_check_type"])}}}function selectAllFans(){toggle_elements(["add_all_fans"]);if($("check_fans").getValue()!=1&&$("check_friends").getValue()!=1){show_elements(["method1a","multipagea","filter_by_check_region","filter_by_check_gender","filter_by_check_type"])}else{if($("check_fans").getValue()==1&&$("check_friends").getValue()!=1){hide_elements(["method1a","multipagea","filter_by_check_region","filter_by_check_gender","filter_by_check_type"])}}}function toggleSmallBig(F,D,B,C){var A=new Event(F);var E=A.target;if($type($("event_small_"+D))&&$type($("event_big_"+D))){if(C||(E.tagName.toLowerCase()!="a"&&E.tagName.toLowerCase()!="button"&&E.tagName.toLowerCase()!="textarea"&&E.tagName.toLowerCase()!="input"&&E.tagName.toLowerCase()!="select"&&E.tagName.toLowerCase()!="option")){if(B){$("event_big_"+D).setStyle("display","");$("event_small_"+D).setStyle("display","none")}}}}var uid_selected=[];function change_filter(B,D){var A=[];var C=[];A[0]="itemid="+B;A[1]="filter=1";if(D!=1){$("filter_by_page").setProperty("value","1")}if($("region").getValue()!=0){A.push("region="+escape($("region").getValue()));C.push("region")}if($("gender").getValue()!=0){A.push("gender="+escape($("gender").getValue()));C.push("gender")}if($("type").getValue()!=0){A.push("type="+escape($("type").getValue()));C.push("type")}if($("category").getValue()!=0){A.push("category="+escape($("category").getValue()));C.push("category")}if($("filter_by_check_category_all").getValue()==1){A.push("cat_all=1");C.push("type")}A.push("page="+escape($("filter_by_page").getValue()));request=new Ajax2("/batch.events.php",{method:"post",data:A.join("&"),onRequest:function(){C.each(function(E){$("wait_"+E).addClass("wait2")})},onComplete:function(E){E=Json.evaluate(E);$("method1a").empty();C.each(function(G){$("wait_"+G).removeClass("wait2")});var F="";if($("invite_all_check").getValue()==1){F=' style="display:none "'}E.uids.each(function(H){if(uid_selected.indexOf(parseInt(H.uid))==-1){var I=new Element("div").setStyles({margin:"3px","margin-left":"0px"});var G=['<div style="margin:3px; margin-left:0px">',"<span>",'<input type="checkbox" name="chka_val[]" ',F,' class="list_chk" id="chk_',H.uid,'" rel ="',H.uid,",",escape(H.full_name),'" onclick="eventInviteGuest(',H.uid,",'",escape(H.full_name),"',this)\">","</span>","<span>",'<a href="/',H.domain,'" target="_blank">',H.full_name,"</a>","</span>","</div>"].join("");I.setHTML(G).injectInside($("method1a"))}});$("invite_all_text").empty().setHTML(E.total);$("invite_all_text2").empty().setHTML(E.total);createMultipage(E.multipage,$("multipagea"),"")}}).request()}function invite_all(A){if($("invite_all_check").getValue()==1){hide_elements(["filter_by_check","filter_by"]);show_elements(["invite_all_text2"]);if($("filter_by_check").getValue()==1){new Element("input").setProperty("type","hidden").setProperty("name","filter").setProperty("id","post_filter").setProperty("value","1").injectInside("invite_all_text2");if($("region").getValue()!=0){new Element("input").setProperty("type","hidden").setProperty("name","region").setProperty("id","post_region").setProperty("value",$("region").getValue()).injectInside("invite_all_text2")}if($("gender").getValue()!=0){new Element("input").setProperty("type","hidden").setProperty("name","gender").setProperty("id","post_gender").setProperty("value",$("gender").getValue()).injectInside("invite_all_text2")}if($("type").getValue()!=0){new Element("input").setProperty("type","hidden").setProperty("name","type").setProperty("id","post_type").setProperty("value",$("type").getValue()).injectInside("invite_all_text2")}if($("category").getValue()!=0){new Element("input").setProperty("type","hidden").setProperty("name","category").setProperty("id","post_category").setProperty("value",$("category").getValue()).injectInside("invite_all_text2")}}$ES(".list_chk",$("method1a")).each(function(B){B.setStyle("display","none")},this);$("invite_all_text").setStyles({"font-weight":"900","font-size":"110%"})}else{show_elements(["filter_by_check"]);if($("filter_by_check").getValue()==1){show_elements(["filter_by"])}hide_elements(["invite_all_text2"]);if($type($("post_filter"))){$("post_filter").remove()}if($type($("post_region"))){$("post_region").remove()}if($type($("post_gender"))){$("post_gender").remove()}if($type($("post_type"))){$("post_type").remove()}if($type($("post_category"))){$("post_category").remove()}$ES(".list_chk",$("method1a")).each(function(B){B.setStyle("display","")},this);$("invite_all_text").setStyles({"font-weight":"normal","font-size":"100%"})}}var shoutbox_starttimer;var shoutbox_maxtime=600;var shoutbox_oldtimer;var shoutbox_oldupdate;var siteUrl;function shoutbox_cancel(){shoutbox_starttimer=0;if(shoutbox_oldupdate){clearTimeout(shoutbox_oldupdate)}shoutbox_oldupdate=undefined;shoutbox_updatetimer(true)}function update_shoutbox(F,D,J,I){var H=10;if((!J&&F)||(!shoutbox_starttimer)){if(!I){shoutbox_starttimer=currentTime()}}else{if(currentTime()-shoutbox_starttimer>=shoutbox_maxtime*1000){shoutbox_updatetimer(true);return }}var G=function(P){var Q=document.getElementById("shoutbox");var W=document.getElementById("sbInner");var O,U;var T;var M;var N=shoutbox_show_date();while(W.hasChildNodes()){W.removeChild(W.firstChild)}M=0;while(M<P.length){var V;var R;if(M%2==0){V="BG1"}else{V="BG2"}T=document.createElement("li");T.className=V;R="";if(P[M].candelete){R+='<span class="body"><a href="'+siteUrl+"/batch.shoutbox.php?action=delete&sid="+P[M].sid+'" title="Delete" style="color: #cc801a;">[x]</a></span>'}R+='<a href="'+P[M].user_url+'" title="'+P[M].username+'" class="title">'+P[M].username+':</a><span class="body">'+P[M].message+"</span>";if(N){var S=new Date();S.setTime(P[M].dateline*1000);var L=S.getMinutes();var K=S.getHours();if(K.toString().length<2){K="0"+K.toString()}if(L.toString().length<2){L="0"+L.toString()}R+='<div class="body" style="display: block; font-size: xx-small; ">'+K+":"+L+"</div>"}T.innerHTML=R;W.appendChild(T);++M}if(!I){if(shoutbox_oldupdate){clearTimeout(shoutbox_oldupdate)}shoutbox_oldupdate=setTimeout("update_shoutbox()",H*1000)}};var E=1;if(J){E="archive"}var A;if(document.cookie.match(/lang=sc/i)){A=1}else{A=0}var B=siteUrl+"/batch.shoutbox.php?ajax="+E+"&json=1&room="+A;if(D){B+="&msg="+D}var C;C=new Date();C=C.getTime();B+="&rnd="+C;new Json.Remote(B,{method:"get",onComplete:G}).send();shoutbox_updatetimer(I)}function shoutbox_updatetimer(B){var A=document.getElementById("shoutbox_secs");var C=currentTime()-shoutbox_starttimer;C=shoutbox_maxtime-parseInt(C/1000);if((C<0)||isNaN(C)){C=0}if(A){A.innerHTML=C;if(!B){if(shoutbox_oldtimer){clearTimeout(shoutbox_oldtimer)}shoutbox_oldtimer=setTimeout("shoutbox_updatetimer()",2000)}}A=document.getElementById("shoutbox_auto");if(A){if(C==0){A.checked=false}else{A.checked=true}}}function shoutbox_toggle_date(){if(document.cookie.indexOf("supe_sb_date")==-1){document.cookie="supe_sb_date=1;"}else{document.cookie="supe_sb_date=;expires=Fri, 02-Jan-1970 00:00:00 GMT"}shoutbox_update_datecheck();update_shoutbox(true,undefined,false,true)}function shoutbox_show_date(){return document.cookie.indexOf("supe_sb_date")!=-1}function shoutbox_update_datecheck(){var A=document.getElementById("shoutbox_date");if(A){A.checked=shoutbox_show_date()}}if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(K){this.setAttribute("swf",K)}if(B){this.setAttribute("id",B)}if(L){this.setAttribute("width",L)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;