document.domain=""+XN.env.domain+"";function __DOMAIN(){}var DOMAIN=new __DOMAIN();DOMAIN.img="http://img."+XN.env.domain+"/";function getEl(a){return document.all?document.all[a]:document.getElementById(a)}function setElementStyle(b,a){getEl(b).className=a}function check(c,b,a){if(getEl(c).value==""){alert(b+"不能为空");getEl(c).select();return false}if(getEl(c).value==b){alert(a);getEl(c).select();return false}return true}function hideLayer(ALayerName){if(ALayerName!=""){if(document.getElementById){document.getElementById(ALayerName).style.display="none"}else{if(document.all){document.all[ALayerName].style.display="none"}else{if(document.layers){eval("document."+ALayerName+".display = 'none'")}}}}}function showLayer(ALayerName){if(ALayerName!=""){if(document.getElementById){document.getElementById(ALayerName).style.display="block"}else{if(document.all){document.all[ALayerName].style.display="block"}else{if(document.layers){eval("document."+ALayerName+".display = 'block'")}}}}}function display(c,a){var b=document.all?document.all[c]:document.getElementById(c);if(b){b.style.display=a?"":"none"}}function add_comsch(b){var a=++getEl("max_com").value;if(a<6){if(b=="com"){getEl("comName"+a).value="";getEl("comTitle"+a).value="";getEl("comStarTime"+a).value="";getEl("comEndTime"+a).value="";display("comdiv"+a,true)}else{getEl("schName"+a).value="";display("schdiv"+a,true)}}}function onReport(e,a){var c;var d=confirm("本贴含有违规内容，将向站长举报。继续？");var b="/Report.do?postId=";b+=a;b+="&threadId=";b+=e;if(d){c=window.open(b,"editPost","left=100,top=100,width=550,height=350,status=no,toolbar=no,menubar=no,scrollbars,resizable=yes");c.focus()}return false}function LTrim(e){var b=new String(" \t\n\r");var d=new String(e);if(b.indexOf(d.charAt(0))!=-1){var a=0,c=d.length;while(a<c&&b.indexOf(d.charAt(a))!=-1){a++}d=d.substring(a,c)}return d}function RTrim(d){var a=new String(" \t\n\r");var c=new String(d);if(a.indexOf(c.charAt(c.length-1))!=-1){var b=c.length-1;while(b>=0&&a.indexOf(c.charAt(b))!=-1){b--}c=c.substring(0,b+1)}return c}function Trim(a){return RTrim(LTrim(a))}function checkISBN(a){return !/(?=.{13}$)\d{1,5}([-])\d{1,7}\1\d{1,6}\1(\d|X|x)/.test(a)}function checkNum(a){return !/\D/.test(a)}function isValidDate(a){return/^(\d{1,4})(-|\/)(\d{2})\2(\d{2})$/.test(a)}function isEmail(a){if(a.length==0){alert("请填写电子邮件地址，否则我们将无法与您联系。");return false}var b=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!b.test(a)){alert("抱歉，电子邮箱格式不对或者包含不合法字符");return false}return true}function findPosX(a){var b=0;if(a.offsetParent){while(a.offsetParent){b+=a.offsetLeft;a=a.offsetParent}}else{if(a.x){b+=a.x}}return b}function findPosY(b){var a=0;if(b.offsetParent){while(b.offsetParent){a+=b.offsetTop;b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function mousePosX(b){var a=0;if(!b){var b=window.event}if(b.pageX){a=b.pageX}else{if(b.clientX&&document.body.scrollLeft){a=b.clientX+document.body.scrollLeft}else{if(b.clientX&&document.documentElement.scrollLeft){a=b.clientX+document.documentElement.scrollLeft}else{if(b.clientX){a=b.clientX}}}}return a}function mousePosY(a){var b=0;if(!a){var a=window.event}if(a.pageY){b=a.pageY}else{if(a.clientY&&document.body.scrollTop){b=a.clientY+document.body.scrollTop}else{if(a.clientY&&document.documentElement.scrollTop){b=a.clientY+document.documentElement.scrollTop}else{if(a.clientY){b=a.clientY}}}}return b}function debugOut(a){if($("debugout")){$("debugout").style.overflow="auto";$("debugout").innerHTML=a+"<br>"+$("debugout").innerHTML}}function limitLen(c,a,b){if(b){c.replace("/</g","&lt;");c.replace("/>/g","&gt;");c.replace("/&/g","&amp;");c.replace("/#/g","&#35;");c.replace("/(/g","&#40;");c.replace("/)/g","&#41;");c.replace('/"/g',"&#34;");c.replace("/'/g","&#39;")}if(c.length>a){return false}else{return true}}function cc(b){var c,a;if(b.srcElement){c=b.srcElement;a=c.createTextRange();a.moveStart("character",0);a.collapse(true);a.select()}else{c=b.target;c.selectionStart=0;c.selectionEnd=0;return true}}function noteme(a){a.parentNode.nextSibling.className="hey"}function dontnoteme(a){a.parentNode.nextSibling.className="note"}var oldload=(window.onload)?window.onload:function(){};window.onload=function(){oldload();var pageId=document.body.id;str="var regAction; if(typeof("+pageId+'_onload) == "function") { regAction = '+pageId+"_onload} else { regAction = function(){}};";eval(str);str="regAction()";eval(str)};window.ow=function(a){return getEl(a).contentWindow};function GetHTML(a){if(typeof(_DEBUG)!="undefined"){alert("inner GetHTML")}if(a){return ow(a).getContent()}if(typeof(_DEBUG)!="undefined"){alert("after getContent")}return null}function isEmpty(a){if(a){return ow(a).isEmpty()}}function SetHTML(b,a){if(a){ow(a).setHtml(b)}}function SetFocus(a){if(a){ow(a).setFocus()}}function closeInfoWnd(a){try{div=document.getElementById(a);if(div){document.body.removeChild(div);delete div;div=null}}catch(b){}}var IM=new Object();var web5q=0;function setPos(d,b,c){alert(1);alert(d);var a=findPosX(getParentNode(d));var e=findPosY(getParentNode(d));alert(a+":"+e);b.style.left=a-c-80+"px";b.style.top=e+20+"px"}IM.setPos=function(c,b){var a=findPosX(c);var d=findPosY(c);b.style.left=a-20+"px";b.style.top=d+20+"px"};function downloadIM(a){window.location="http://im."+XN.env.domain+"/setup/XiaoNeiSetup.exe";closeInfoWnd("ImDownload")}IM.getimv=function(){var a="";try{web5q=web5q||new ActiveXObject("QImWeb.ImWebObj");a=web5q.GetImVersion()}catch(b){}return a};IM.startIM=function(d,a,b){try{web5q=web5q||new ActiveXObject("QImWeb.ImWebObj");if(web5q!=null){if(b==1){web5q.Start5QIMNew(d,a)}else{web5q.Start5QIM(d,a)}}else{IM.bigDownload(event,tp)}}catch(c){}};IM.openIM=function(h,a,c,b,g){try{web5q=web5q||new ActiveXObject("QImWeb.ImWebObj");if(web5q!=null){if(c==1){web5q.Start5QIMPopupNew(h,a)}else{web5q.Start5QIMPopup(h,a)}}else{IM.bigDownload(b,g)}}catch(d){IM.bigDownload(b,g)}};IM.download=function(){closeInfoWnd("ImDownload");var b=document.createElement("div");b.id="ImDownload";b.className="popupwrap";b.style.zIndex="5000";var a='<div class="popup"><h4>浏览器不支持或未安装校内通</h4><p>下载登录校内通后就可以聊天了:)<br /><a href="http://im.'+XN.env.domain+'" target="_blank">了解校内通</a></p><p class="operation"><input type="button" value="立即下载" class="subbutton" onclick="javascript:downloadIM(78);" /><input type="button" value="关闭" class="canbutton" onclick="closeInfoWnd(\'ImDownload\');" /></p></div>';b.innerHTML=a;document.body.appendChild(b);IM.setPos(IM.srcEl,b,300);b.style.display="block"};IM.log=function(e,d){var b=new Date;var a="logIM.do";var c="c=1&gid="+e+"&hid="+d+"&t="+b.getTime();var f=new Ajax.Request(a,{method:"get",parameters:c})};IM.srcEl;IM.myid;IM.toid;IM.em;function writepipe(c,a){if(c>0){var b=GetCookie("_pipe");if(b){b+=":"}SetCookie("_pipe",b+c+":"+escape(a),null,"/",""+XN.env.domain+"")}var f=GetCookie("_wi");if("opening"==f){}else{if("running"==f){}else{SetCookie("_wi","opening",null,"/",""+XN.env.domain+"");window.wiw=window.open("http://"+XN.env.domain+"/webpager.do?toid="+c,"_blank","height=600,width=650,resizable=yes,location=yes");if(window.wiw_checker){window.clearInterval(window.wiw_checker)}window.wiw_checker=window.setInterval(function(){if(window.wiw.closed){window.clearInterval(window.wiw_checker);SetCookie("_wi","",null,"/",""+XN.env.domain+"")}},1000);return true}}try{if(window.wiw){window.wiw.focus()}}catch(d){}return false}function tnx2(d,a,h,c,b){if(IM.getimv()==""){writepipe(h,b)}else{IM.srcEl=d.srcElement;IM.myid=a;IM.toid=h;IM.em=c;try{var f=new Ajax.Request("tnx.do",{method:"get",parameters:"v="+IM.getimv(),onComplete:tnxy2,onFailure:tnxn})}catch(g){}}}function tnx(){try{var a=new Ajax.Request("tnx.do",{method:"get",parameters:"v="+IM.getimv(),onComplete:tnxy,onFailure:tnxn})}catch(b){}}function tnxy(a){var b=a.responseText;IM.startIM(tnxe,b.substring(0,b.length-1),b.substring(b.length-1,b.length))}function tnxy2(a){var c=a.responseText;if(document.all){try{IM.startIM(IM.em,c.substring(0,c.length-1),c.substring(c.length-1,c.length))}catch(b){IM.download()}if(IM.toid>0){try{web5q.StartChat(IM.myid,IM.toid)}catch(b){}}}else{alert("你的浏览器不支持此功能！")}IM.log(IM.toid,IM.myid)}function tnxn(a){}function getErrorCode(e){var b=new Date;var a="pages/jsError.jsp";var c="errorStr="+e+"&t="+b.getTime();var d=new Ajax.Request(a,{method:"post",parameters:c,onComplete:getErrorCode_showResponse,onFailure:getErrorCode_showError})}function getErrorCode_showResponse(a){return true}function getErrorCode_showError(a){}function getIEVersonNumber(){var b=navigator.userAgent;var a=b.indexOf("MSIE ");if(a<0){return 0}return parseFloat(b.substring(a+5,b.indexOf(";",a)))}function isIE6(){return(getIEVersonNumber()==6)}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(d){var b=d+"=";var f=b.length;var a=document.cookie.length;var e=0;while(e<a){var c=e+f;if(document.cookie.substring(e,c)==b){return GetCookieVal(c)}e=document.cookie.indexOf(" ",e)+1;if(e==0){break}}return null}function SetCookie(c,e){var a=SetCookie.arguments;var h=SetCookie.arguments.length;var b=(h>2)?a[2]:null;var g=(h>3)?a[3]:null;var d=(h>4)?a[4]:null;var f=(h>5)?a[5]:false;document.cookie=c+"="+escape(e)+((b==null)?"":("; expires="+b.toGMTString()))+((g==null)?"":("; path="+g))+((d==null)?"":("; domain="+d))+((f==true)?"; secure":"")}String.prototype.trim=function(){return this.replace(/^\s*|\s*$/g,"")};function formOnfocus(a){a.onfocus=function(){a.style.backgroundColor="#fcfcfc"};a.onblur=function(){a.style.backgroundColor="#fff"}}function upload(f,b){if(!f){document.location.href="http://photo."+XN.env.domain+"/choosealbum.do"}else{if(b>=120){document.location.href="http://photo."+XN.env.domain+"/choosealbum.do?full=1";return}var a=false;try{var c=new ActiveXObject("xnalbum.Uploader");if(c){a=true}}catch(d){}if(a&&document.all&&window.ActiveXObject&&navigator.userAgent.toLowerCase().indexOf("msie")>-1&&navigator.userAgent.toLowerCase().indexOf("opera")==-1){document.location.href="http://photo."+XN.env.domain+"/tophotox.do?id="+f}else{document.location.href="http://upload."+XN.env.domain+"/addphoto.do?id="+f}}}window.loaded=true;function gen_unique(){return ++gen_unique._counter}gen_unique._counter=0;function ge(g){if(typeof(g)=="undefined"){Util.error("Tried to get an undefined element!");return null}var e;if(typeof(g)=="string"){e=document.getElementById(g);if(!(ua.ie()>=7)){return e}if(!e){return null}else{if(typeof(e.id)=="string"&&e.id==g){return e}else{var d=document.getElementsByName(g);if(!d||!d.length){return null}var b=[];for(var a=0;a<d.length;a++){var f=d[a];if(!f.id&&g){continue}if(typeof(f.id)=="string"&&f.id!=g){continue}b.push(d[a])}if(b.length!=1){Util.error("ge() failed in a bizarre complicated edge case. Check comments.");return null}return b[0]}}}else{return g}return null}function $(){var a=ge.apply(null,arguments);if(!a){Util.warn("Tried to get element %q, but it is not present in the page. (Use ge() to test for the presence of an element.)",arguments[0])}return a}function show(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style){a.style.display=""}}return false}function hide(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style){a.style.display="none"}}return false}function shown(a){a=ge(a);return(a.style.display!="none")}function toggle(){for(var b=0;b<arguments.length;b++){var a=$(arguments[b]);a.style.display=get_style(a,"display")=="block"?"none":"block"}return false}function is_descendent(b,c){var a=ge(c);if(b==null){return}while(b!=a){if(b.parentNode){b=b.parentNode}else{return false}}return true}function get_style(b,d){function c(e){return e.replace(/[A-Z]/g,function(f){return"-"+f.toLowerCase()})}if(window.getComputedStyle){return window.getComputedStyle(b,null).getPropertyValue(c(d))}if(document.defaultView&&document.defaultView.getComputedStyle){var a=document.defaultView.getComputedStyle(b,null);if(a){return a.getPropertyValue(c(d))}if(d=="display"){return"none"}Util.error("Can't retrieve requested style %q due to a bug in Safari",d)}if(b.currentStyle){return b.currentStyle[d]}return b.style[d]}function close_more_list(){var c=ge("expandable_more");if(c){c.style.display="none";removeEventBase(document,"click",c.offclick,c.id)}var a=ge("ssponsor");if(a){a.style.position=""}var b=ge("more_link");if(b){b.innerHTML="更多";b.className="expand_link more_apps"}}function expand_more_list(){var d=ge("expandable_more");var a=ge("more_section");if(a){remove_css_class_name(a,"highlight_more_link")}if(d){d.style.display="block";d.offclick=function(f){if(!is_descendent(event_get_target(f),"sidebar_content")){close_more_list()}}.bind(d);addEventBase(document,"click",d.offclick,d.id)}var b=ge("ssponsor");if(b){b.style.position="static"}var c=ge("more_link");if(c){c.innerHTML="隐藏";c.className="expand_link less_apps"}}function toggle_more_list(){var a=ge("expandable_more");if(!a){return false}if(a.style.display=="none"){expand_more_list()}else{close_more_list()}}function remove_node(b){if(b.removeNode){b.removeNode(true)}else{for(var a=b.childNodes.length-1;a>=0;a--){remove_node(b.childNodes[a])}b.parentNode.removeChild(b)}return null}function create_hidden_input(a,b){var c=document.createElement("input");c.name=a;c.id=a;c.value=b;c.type="hidden";return c}function has_css_class_name(b,a){return(b&&a)?new RegExp("\\b"+trim(a)+"\\b").test(b.className):false}function swap_css_class_name(e,b,a){for(var d=0;d<e.length;d++){var c=ge(e[d]);if(c.className.indexOf(b)!=-1){c.className=c.className.replace(b,a)}else{c.className=c.className.replace(a,b)}}}function add_css_class_name(b,a){if(b&&a){if(b.className){if(has_css_class_name(b,a)){return false}else{b.className+=" "+trim(a);return true}}else{b.className=a;return true}}else{return false}}function remove_css_class_name(c,b){if(c&&b&&c.className){b=trim(b);var a=c.className;c.className=c.className.replace(new RegExp("\\b"+b+"\\b"),"");return c.className!=a}else{return false}}function toggle_css_class_name(b,a){if(has_css_class_name(b,a)){remove_css_class_name(b,a)}else{add_css_class_name(b,a)}}function set_inner_html(c,a){var b='<span style="display:none">&nbsp</span>';a=a.replace("<style",b+"<style");a=a.replace("<STYLE",b+"<STYLE");a=a.replace("<script",b+"<script");a=a.replace("<SCRIPT",b+"<SCRIPT");c.innerHTML=a;eval_inner_js(c);addSafariLabelSupport(c)}function eval_inner_js(f){var a=f.getElementsByTagName("script");for(var c=0;c<a.length;c++){if(a[c].src){var b=document.createElement("script");b.type="text/javascript";b.src=a[c].src;document.body.appendChild(b)}else{try{eval_global(a[c].innerHTML)}catch(d){if(typeof console!="undefined"){console.error(d)}}}}}function eval_global(c){var b=document.createElement("script");b.type="text/javascript";try{b.innerHTML=c}catch(a){b.text=c}document.body.appendChild(b)}var KEYS={BACKSPACE:8,TAB:9,RETURN:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};var KeyCodes={Left:63234,Right:63235};function mouseX(a){return a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft))}function mouseY(a){return a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}function pageScrollX(){return document.body.scrollLeft||document.documentElement.scrollLeft}function pageScrollY(){return document.body.scrollTop||document.documentElement.scrollTop}function elementX(b){var a=b.offsetLeft;var c=b.offsetParent;while(b.parentNode&&document.body!=b.parentNode){b=b.parentNode;a-=b.scrollLeft;if(c==b){if(ua.safari()<500&&b.tagName=="TR"){a+=b.firstChild.offsetLeft}else{a+=b.offsetLeft}c=b.offsetParent}}return a}function elementY(b){var a=b.offsetTop;var c=b.offsetParent;while(b.parentNode&&document.body!=b.parentNode){b=b.parentNode;a-=b.scrollTop;if(c==b){if(ua.safari()<500&&b.tagName=="TR"){a+=b.firstChild.offsetTop}else{a+=b.offsetTop}c=b.offsetParent}}return a}function warn_if_unsaved(a){onloadRegister(function(){var b=[];var e=ge(a);var c=get_all_form_inputs();for(var d=0;d<c.length;++d){if(is_button(c[d])){c[d].onclick=bind(null,function(f,g){dont_warn_if_unsaved();return f&&f(g)},c[d].onclick)}else{if(is_descendent(c[d],e)){b.push({element:c[d],value:c[d].value})}}}(function(f){onbeforeunloadRegister(function(){if(!document.unsaved_warning_disabled){for(var g=0;g<f.length;++g){var h=f[g].element;var j=f[g].value;if(h.value!=j){return"You have unsaved changes.  Continue?"}}}})})(b)})}function dont_warn_if_unsaved(){document.unsaved_warning_disabled=true}function get_all_form_inputs(c){var f={input:1,select:1,textarea:1,button:1};c=c||document;var a=[];for(var e in f){var d=c.getElementsByTagName(e);for(var b=0;b<d.length;++b){a.push(d[b])}}return a}function serialize_form_helper(e,b,d){var a=/([^\]]+)\[([^\]]*)\](.*)/.exec(b);if(a){e[a[1]]=e[a[1]]||{};if(a[2]==""){var c=0;while(e[a[1]][c]!=undefined){c++}}else{c=a[2]}if(a[3]==""){e[a[1]][c]=d}else{serialize_form_helper(e[a[1]],c.concat(a[3]),d)}}else{e[b]=d}}function serialize_form(d){var c={};var b=d.tagName=="FORM"?d.elements:get_all_form_inputs(d);for(var a=b.length-1;a>=0;a--){if(b[a].name&&!b[a].disabled){if(!(b[a].type=="radio"||b[a].type=="checkbox")||b[a].checked||(!b[a].type||b[a].type=="text"||b[a].type=="password"||b[a].type=="hidden"||b[a].tagName=="TEXTAREA"||b[a].tagName=="SELECT")){serialize_form_helper(c,b[a].name,b[a].value)}}}return c}function is_button(b){var a=b.tagName.toUpperCase();if(a=="BUTTON"){return true}if(a=="INPUT"&&b.type){var c=b.type.toUpperCase();return c=="BUTTON"||c=="SUBMIT"}return false}function addEventBase(d,c,b,a){if(d.addEventListener){d.addEventListener(c,b,false)}else{if(d.attachEvent){d["e"+c+b+a]=b;d[c+b+a]=function(){d["e"+c+b+a](window.event)};d.attachEvent("on"+c,d[c+b+a])}}}function removeEventBase(d,c,b,a){if(d.removeEventListener){d.removeEventListener(c,b,false)}else{if(d.detachEvent){d.detachEvent("on"+c,d[c+b+a]);d[c+b+a]=null;d["e"+c+b+a]=null}}}function placeholderSetup(c){var a=ge(c);if(!a){return}if(a.type=="search"){return}var b=a.getAttribute("placeholder");if(!b||b==""){return}if(a.value==b){a.value=""}a.is_focused=(a.value!="");if(!a.is_focused){a.value=b;a.style.color="#777";a.is_focused=0}addEventBase(a,"focus",placeholderFocus);addEventBase(a,"blur",placeholderBlur)}function placeholderFocus(){if(!this.is_focused){this.is_focused=1;this.value="";this.style.color="#000";var a=this.getAttribute("radioselect");if(a&&a!=""){var b=document.getElementById(a);if(!b){return}if(b.type!="radio"){return}b.checked=true}}}function placeholderBlur(){var a=this.getAttribute("placeholder");if(this.is_focused&&a&&this.value==""){this.is_focused=0;this.value=a;this.style.color="#777"}}function optional_drop_down_menu(h,g,b,a,j,e){if(b.style.display=="none"){b.style.display="block";var f=e?e:h.className;if(g){g.className="active"}h.className=j?j:"global_menu_arrow_active";var d=true;var c=ge(b.id+"_iframe");if(c){c.style.top=b.style.top;c.style.right=b.style.right;c.style.display="block";c.style.width=(b.offsetWidth+2)+"px";c.style.height=(b.offsetHeight+2)+"px"}b.offclick=function(k){if(!d){hide(this);if(g){g.className=""}h.className=f;var m=ge(b.id+"_iframe");if(m){m.style.display="none";m.style.width=b.offsetWidth+"px";m.style.height=b.offsetHeight+"px"}removeEventBase(document,"click",this.offclick,b.id)}else{d=false}}.bind(b);addEventBase(document,"click",b.offclick,b.id)}return false}function position_app_switcher(){var a=ge("app_switcher");var b=ge("app_switcher_menu");b.style.top=(a.offsetHeight-1)+"px";b.style.right="0px"}function addSafariLabelSupport(a){if(ua.safari()<500){var b=(a||document.body).getElementsByTagName("label");for(i=0;i<b.length;i++){b[i].addEventListener("click",addLabelAction,true)}}}function addLabelAction(b){var d=this.getAttribute("for");var a=null;if(d){a=document.getElementById(d)}else{a=this.getElementsByTagName("input")[0]}if(!a||b.srcElement==a){return}if(a.type=="checkbox"){a.checked=!a.checked}else{if(a.type=="radio"){var c=document.getElementsByTagName("input");for(i=0;i<c.length;i++){if(c[i].name==a.name&&c[i].form==a.form){c.checked=false}}a.checked=true}else{a.focus()}}if(a.onclick){a.onclick(b)}}function escapeURI(a){if(encodeURIComponent){return encodeURIComponent(a)}if(escape){return escape(a)}}function goURI(a){window.location.href=a}function is_email(a){return/^[\w!.%+]+@[\w]+(?:\.[\w]+)+$/.test(a)}function getViewportWidth(){var a=0;if(document.documentElement&&document.documentElement.clientWidth){a=document.documentElement.clientWidth}else{if(document.body&&document.body.clientWidth){a=document.body.clientWidth}else{if(window.innerWidth){a=window.innerWidth-18}}}return a}function getViewportHeight(){var a=0;if(window.innerHeight){a=window.innerHeight-18}else{if(document.documentElement&&document.documentElement.clientHeight){a=document.documentElement.clientHeight}else{if(document.body&&document.body.clientHeight){a=document.body.clientHeight}}}return a}function getPageScrollHeight(){var a;if(typeof(window.pageYOffset)=="number"){a=window.pageYOffset}else{if(document.body&&document.body.scrollTop){a=document.body.scrollTop}else{if(document.documentElement&&document.documentElement.scrollTop){a=document.documentElement.scrollTop}}}if(isNaN(a)){return 0}return a}function getRadioFormValue(a){for(i=0;i<a.length;i++){if(a[i].checked){return a[i].value}}return null}function getTableRowShownDisplayProperty(){if(ua.ie()){return"inline"}else{return"table-row"}}function showTableRow(){for(var b=0;b<arguments.length;b++){var a=ge(arguments[b]);if(a&&a.style){a.style.display=getTableRowShownDisplayProperty()}}return false}function getParentRow(a){a=ge(a);while(a.tagName&&a.tagName!="TR"){a=a.parentNode}return a}function stopPropagation(a){if(!a){var a=window.event}a.cancelBubble=true;if(a.stopPropagation){a.stopPropagation()}}function show_standard_status(a){s=ge("standard_status");if(s){var b=s.firstChild;b.innerHTML=a;show("standard_status")}}function hide_standard_status(){s=ge("standard_status");if(s){hide("standard_status")}}function remove_node(b){if(b.removeNode){b.removeNode(true)}else{for(var a=b.childNodes.length-1;a>=0;a--){remove_node(b.childNodes[a])}b.parentNode.removeChild(b)}return null}function adjustImage(f,g,a){var b=f.parentNode;if(g==null){g="note_content"}if(a==null){while(b.className.indexOf(g)==-1){b=b.parentNode}if(b.offsetWidth){a=b.offsetWidth}else{a=400}}if(navigator.userAgent.indexOf("AppleWebKit/4")==-1){f.style.position="absolute";f.style.left=f.style.top="-32000px"}f.className=f.className.replace("img_loading","img_ready");if(f.width>a){if(window.ActiveXObject){try{var c=document.createElement("div");c.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+f.src.replace('"',"%22")+'", sizingMethod="scale")';c.style.width=a+"px";c.style.height=((a/f.width)*f.height)+"px";if(f.parentNode.tagName=="A"){c.style.cursor="pointer"}f.parentNode.insertBefore(c,f);f.removeNode(true)}catch(d){f.style.width=a+"px"}}else{f.style.width=a+"px"}}f.style.left=f.style.top=f.style.position=""}function imageConstrainSize(e,d,b,a){var c=new Image();c.onload=function(){if(c.width>0&&c.height>0){var j=c.width;var g=c.height;if(j>d||g>b){var k=b/d;var f=g/j;if(f>k){j=j*(b/g);g=b}else{g=g*(d/j);j=d}}var m=ge(a);var h=document.createElement("img");h.src=e;h.width=j;h.height=g;m.parentNode.insertBefore(h,m);m.parentNode.removeChild(m)}};c.src=e}function set_opacity(c,a){try{c.style.opacity=(a==1?"":a);c.style.filter=(a==1?"":"alpha(opacity="+a*100+")")}catch(b){}}function get_opacity(b){var a=get_style(b,"filter");var c=null;if(a&&(c=/(\d+(?:\.\d+)?)/.exec(a))){return parseFloat(c.pop())/100}else{if(a=get_style(b,"opacity")){return parseFloat(a)}else{return 1}}}function get_caret_position(d){d.focus();if(document.selection){if(d.tagName=="INPUT"){var c=document.selection.createRange();return{start:-c.moveStart("character",-d.value.length),end:-c.moveEnd("character",-d.value.length)}}else{if(d.tagName=="TEXTAREA"){var c=document.selection.createRange();var a=c.duplicate();a.moveToElementText(d);a.setEndPoint("StartToEnd",c);var b=d.value.length-a.text.length;a.setEndPoint("StartToStart",c);return{start:d.value.length-a.text.length,end:b}}else{return{start:undefined,end:undefined}}}}else{return{start:d.selectionStart,end:d.selectionEnd}}}function set_caret_position(d,e,a){if(document.selection){if(d.tagName=="TEXTAREA"){var c=d.value.indexOf("\r",0);while(c!=-1&&c<a){a--;if(c<e){e--}c=d.value.indexOf("\r",c+1)}}var b=d.createTextRange();b.collapse(true);b.moveStart("character",e);if(a!=undefined){b.moveEnd("character",a-e)}b.select()}else{d.selectionStart=e;d.selectionEnd=a==undefined?e:a;d.focus()}}function focus_login(){var a=ge("email");var b=ge("pass");var c=ge("doquicklogin");if(a&&b){if(a.value!=""&&b.value==""){b.focus()}else{if(a.value==""){a.focus()}else{if(a.value!=""&&b.value!=""){c.focus()}}}}}function login_form_change(){var a=ge("persistent");if(a){a.checked=false}}function array_indexOf(a,d,b){if(!b){b=0}for(var c=b;c<a.length;c++){if(a[c]==d){return c}}return -1}var ua={ie:function(){return this._ie},firefox:function(){return this._firefox},opera:function(){return this._opera},safari:function(){return this._safari},windows:function(){return this._windows},osx:function(){return this._osx},populate:function(){var a=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/.exec(navigator.userAgent);var b=/(Mac OS X;)|(Windows;)/.exec(navigator.userAgent);if(a){ua._ie=a[1]?parseFloat(a[1]):NaN;ua._firefox=a[2]?parseFloat(a[2]):NaN;ua._opera=a[3]?parseFloat(a[3]):NaN;ua._safari=a[4]?parseFloat(a[4]):NaN}else{ua._ie=ua._firefox=ua._opera=ua._safari=NaN}if(b){ua._osx=!!b[1];ua._windows=!!b[2]}else{ua._osx=ua._windows=false}},adjustBehaviors:function(){onloadRegister(addSafariLabelSupport);if(ua.ie()<7){try{document.execCommand("BackgroundImageCache",false,true)}catch(a){}}}};var DOM={setText:function(a,b){if(ua.firefox()){a.textContent=b}else{a.innerText=b}},getText:function(a){if(ua.firefox()){return a.textContent}else{return a.innerText}}};if(Object.prototype.eval){window.eval=Object.prototype.eval}delete Object.prototype.eval;delete Object.prototype.valueOf;Array.prototype.forEach=null;Array.prototype.every=null;Array.prototype.some=null;Array.prototype.reduce=null;Array.prototype.reduceRight=null;Array.prototype.filter=null;Array.prototype.sort=(function(a){return function(b){return(this==window)?null:(b?a.call(this,function(d,c){return b(d,c)}):a.call(this))}})(Array.prototype.sort);Array.prototype.reverse=(function(a){return function(){return(this==window)?null:a.call(this)}})(Array.prototype.reverse);Array.prototype.concat=(function(a){return function(){return(this==window)?null:a.apply(this,arguments)}})(Array.prototype.concat);Array.prototype.slice=(function(a){return function(){return(this==window)?null:a.apply(this,arguments)}})(Array.prototype.slice);Function.prototype.extend=function(c){var b=__metaprototype(c,0);var a=__metaprototype(this,b.prototype.__level+1);a.parent=b};function __metaprototype(b,c){if(b.__metaprototype){return b.__metaprototype}var a=new Function();a.construct=__metaprototype_construct;a.prototype.construct=__metaprototype_wrap(b,c,true);a.prototype.__level=c;a.base=b;b.prototype.parent=a;b.__metaprototype=a;return a}function __metaprototype_construct(a){__metaprototype_init(a.parent);var b=[];var c=a;while(c.parent){b.push(new_obj=new c.parent());new_obj.__instance=a;c=c.parent}a.parent=b[1];b.reverse();b.pop();a.__parents=b;a.__instance=a;return a.parent.construct.apply(a.parent,arguments)}var aiert;if(!aiert){aiert=alert}function __metaprototype_init(a){if(a.initialized){return}var b=a.base.prototype;if(a.parent){__metaprototype_init(a.parent);var c=a.parent.prototype;for(i in c){if(i!="__level"&&i!="construct"&&b[i]===undefined){b[i]=a.prototype[i]=c[i]}}}a.initialized=true;var d=a.prototype.__level;for(i in b){if(i!="parent"){b[i]=a.prototype[i]=__metaprototype_wrap(b[i],d)}}}function __metaprototype_wrap(d,c,a){if(typeof d!="function"||d.__prototyped){return d}var b=function(){var e=this.__instance;if(e){var j=e.parent;e.parent=c?e.__parents[c-1]:null;if(a){var g=[];for(var h=1;h<arguments.length;h++){g.push(arguments[h])}var f=d.apply(e,g)}else{var f=d.apply(e,arguments)}e.parent=j;return f}else{return d.apply(this,arguments)}};b.__prototyped=true;return b}function xdp(a){var d="";var e=20;for(var c in a){try{d+=(c+" => "+a[c]+"\n")}catch(b){d+=(c+" => "+b+"\n")}if(!e--){aiert(d);d="";e=20}}if(d!=""){aiert(d)}else{aiert(a)}}function adClick(a){ajax=new XnAjax();ajax.get("/ajax/redirect.php",{id:a},true);return true}function abTest(a,b){AsyncRequest.pingURI("/ajax/abtest.php",{data:a,post_form_id:null},true);if(!b){return true}}function ac(a){AsyncRequest.pingURI("/ajax/ac.php",{meta:a},true);return true}function setCookie(e,d,c){var b=new Date();var a=new Date();if(c==null||c==0){c=1}a.setTime(b.getTime()+3600000*24*c);document.cookie=e+"="+escape(d)+"; expires="+a.toGMTString()+"; path=/; domain=.facebook.com"}function clearCookie(a){document.cookie=a+"=; expires=Mon, 26 Jul 1997 05:00:00 GMT; path=/; domain=.facebook.com"}function getCookie(b){var d=b+"=";var a=document.cookie.split(";");for(i=0;i<a.length;i++){var e=a[i];while(e.charAt(0)==" "){e=e.substring(1,e.length)}if(e.indexOf(d)==0){return unescape(e.substring(d.length,e.length))}}return null}function do_post(b){var e=/(^([^?])+)\??(.*)$/.exec(b);var d=document.createElement("form");d.action=e[1];d.method="post";d.style.display="none";var c=/([\w]+)(?:=([^&]+)|&|$)/g;var f=null;if(ge("post_form_id")){e[3]+="&post_form_id="+ge("post_form_id").value}while(f=c.exec(e[3])){var a=document.createElement("input");a.type="hidden";a.name=f[1];a.value=f[2];d.appendChild(a)}document.body.appendChild(d);d.submit();return false}function dynamic_post(b,e){var c=document.createElement("form");c.action=b;c.method="POST";c.style.display="none";if(ge("post_form_id")){e.post_form_id=ge("post_form_id").value}for(var d in e){var a=document.createElement("input");a.type="hidden";a.name=d;a.value=e[d];c.appendChild(a)}document.body.appendChild(c);c.submit();return false}function anchor_set(a){window.location=window.location.href.split("#")[0]+"#"+a}function anchor_get(){return window.location.href.split("#")[1]||null}function event_get(a){return a||window.event}function event_get_target(a){return(a=event_get(a))&&(a.target||a.srcElement)}function event_abort(a){(a=event_get(a))&&(a.cancelBubble=true)&&a.stopPropagation&&a.stopPropagation();return false}function event_get_keypress_keycode(a){switch(a.keyCode){case 63232:return 38;case 63233:return 40;case 63234:return 37;case 63235:return 39;case 63272:case 63273:case 63275:return null;case 63276:return 33;case 63277:return 34}if(a.shiftKey){switch(a.keyCode){case 33:case 34:case 37:case 38:case 39:case 40:return null}}else{return a.keyCode}}function env_get(a){return typeof(window.Env)!="undefined"&&Env[a]}function cavalry_log(b){var d=new Date();var c;try{c=deconcept.SWFObjectUtil.getPlayerVersion()}catch(a){c={major:0,minor:0,rev:666}}(new Image()).src="/common/instrument_endpoint.php?g="+b+"&uri="+encodeURIComponent(window.location)+"&d="+(d.getTime()-Env.start)+"&c="+Env.cache+"&p="+Env.pkgv+"&k="+(document.cookie.length)+"&fmj="+c.major+"&fmn="+c.minor+"&frv="+c.rev+"&"+Math.random()}function chain(b,a){var c=[];for(var d=0;d<arguments.length;d++){c.push(arguments[d])}return function(){for(var e=0;e<c.length;e++){if(c[e]&&c[e].apply(null,arguments)===false){return false}}return true}}function onloadRegister(a){window.loaded?_runHook(a):_addHook("onloadhooks",a)}function onafterloadRegister(a){window.loaded?_runHook(a):_addHook("onafterloadhooks",a)}function onbeforeunloadRegister(a){_addHook("onbeforeunloadhooks",a)}function onunloadRegister(a){_addHook("onunloadhooks",a)}function _onloadHook(){_runHooks("onloadhooks");window.loaded=true}function _runHook(b){try{b()}catch(a){Util.error("Uncaught exception in hook (run after page load): %x",a)}}function _runHooks(a){var b=(a=="onbeforeunloadhooks");var f=null;do{var e=window[a];if(!b){window[a]=null}if(!e){break}for(var d=0;d<e.length;d++){try{if(b){f=f||e[d]()}else{e[d]()}}catch(c){Util.error("Uncaught exception in hook (%q) #%d: %x",a,d,c)}}if(b){break}}while(window[a]);if(b){if(f){return f}else{window.exiting=true}}}function _addHook(a,b){(window[a]?window[a]:(window[a]=[])).push(b)}function _bootstrapEventHandlers(){if(document.addEventListener){if(ua.safari()){var a=setInterval(function(){if(/loaded|complete/.test(document.readyState)){_onloadHook();clearTimeout(a)}},10)}else{document.addEventListener("DOMContentLoaded",_onloadHook,true)}}else{var b="javascript:void(0)";if(window.location.protocol=="https:"){b="//:"}document.write('<script onreadystatechange="if(this.readyState==\'ready\'){this.parentNode.removeChild(this);_onloadHook();}" defer="defer" src="'+b+'"><\/script>')}window.onload=chain(window.onload,function(){_onloadHook();_runHooks("afterloadhooks")});window.onbeforeunload=function(){return _runHooks("onbeforeunloadhooks")};window.onunload=chain(window.onunload,function(){_runHooks("onunloadhooks")})}function iterTraverseDom(b,a){var g=b,f=null;var e=0;do{f=g.firstChild;if(!f){if(a(g)==false){return}f=g.nextSibling}if(!f){var d=g;do{f=d.parentNode;if(f==b){break}if(a(f)==false){return}d=f;f=f.nextSibling}while(!f)}g=f}while(g!=b)}function prependChild(a,b){if(a.firstChild){a.insertBefore(b,a.firstChild)}else{a.appendChild(b)}}ua.populate();_bootstrapEventHandlers();ua.adjustBehaviors();function bind(c,d){var a=[];for(var b=2;b<arguments.length;b++){a.push(arguments[b])}return function(){var g=c||this;var e=a.slice();for(var f=0;f<arguments.length;f++){e.push(arguments[f])}if(typeof(d)=="string"){if(g[d]){return g[d].apply(g,e)}}else{return d.apply(g,e)}}}Function.prototype.bind=function(b){var a=[arguments[0],this];var d=arguments.length;for(var c=1;c<d;c++){a.push(arguments[c])}return bind.apply(null,a)};function copy_properties(c,b){for(var a in b){c[a]=b[a]}return c}var Try={these:function(){var a=arguments.length;var b;for(var c=0;c<a;c++){try{b=arguments[c]();return b}catch(d){}}return b}};var Util={isDevelopmentEnvironment:function(){return env_get("dev")},warn:function(){Util.log(sprintf.apply(null,arguments),"warn")},error:function(){Util.log(sprintf.apply(null,arguments),"error")},log:function(b,a){if(Util.isDevelopmentEnvironment()){if(typeof(window.infoConsole)!="undefined"){infoConsole.addEvent(new fbinfoconsole.ConsoleEvent(["js",a],nl2br(b)))}else{if(typeof(console)!="undefined"&&console.error){console.error(b)}else{if(a!="deprecated"){aiert(b)}}}}else{if(a=="error"){b+="\n\n"+Util.stack();(typeof(window.debug_rlog)=="function")&&debug_rlog(b)}}},deprecated:function(a){if(!Util._deprecatedThings[a]){Util._deprecatedThings[a]=true;var b=sprintf("Deprecated: %q is deprecated.\n\n%s",a,Util.whyIsThisDeprecated(a));Util.log(b,"deprecated")}},stack:function(){try{try{({}).llama()}catch(d){if(d.stack){var h=[];var b=[];var j=/^([^@]+)@(.+)$/mg;var m=j.exec(d.stack);do{h.push([m[1],m[2]])}while(m=j.exec());for(var c=0;c<h.length;c++){b.push("#"+c+" "+h[c][0]+" @ "+(h[c+1]?h[c+1][1]:"?"))}return b.join("\n")}else{var b=[];var g=arguments.callee;var k=[];while(g){for(var c=0;c<k.length;c++){if(k[c]==g){b.push("#"+b.length+" ** recursion ** @ ?");return b.join("\n")}}k.push(g);var f=[];for(var c=0;c<g.arguments.length;c++){if(g.arguments[c] instanceof Function){var a=/function ?([^(]*)/.exec(g.arguments[c].toString()).pop();f.push(a?a:"anonymous")}else{if(g.arguments[c] instanceof Array){f.push("Array")}else{if(g.arguments[c] instanceof Object){f.push("Object")}else{if(typeof g.arguments[c]=="string"){f.push('"'+g.arguments[c].replace(/("|\\)/g,"\\$1")+'"')}else{f.push(g.arguments[c])}}}}}b.push("#"+b.length+" "+/function?([^(]*)/.exec(g).pop()+"("+f.join(", ")+") @ ?");if(b.length>100){break}g=g.caller}return b.join("\n")}}}catch(d){return"No stack trace available"}},whyIsThisDeprecated:function(a){return Util._deprecatedBecause[a.toLowerCase()]||"No additional information is available about this deprecation."},_deprecatedBecause:{},_deprecatedThings:{}};var Configurable={getOption:function(a){if(typeof(this.option[a])=="undefined"){Util.warn("Failed to get option %q; it does not exist.",a);return null}return this.option[a]},setOption:function(b,a){if(typeof(this.option[b])=="undefined"){Util.warn("Failed to set option %q; it does not exist.",b)}else{this.option[b]=a}return this},getOptions:function(){return this.option}};function Ad(){}copy_properties(Ad,{refreshRate:10000,lastRefreshTime:new Date(),refresh:function(){var b=(new Date().getTime()-Ad.lastRefreshTime.getTime());if(b>Ad.refreshRate){var a=Ad.getFrame();if(a){if(!a.osrc){a.osrc=a.src}a.src=a.osrc+"?"+Math.random();Ad.lastRefreshTime=new Date()}}},getFrame:function(){return ge("ssponsor")&&ge("ssponsor").getElementsByTagName("iframe")[0]}});function URI(a){this.parse(a||"")}copy_properties(URI,{expression:/(((\w+):\/\/)([^\/:]*)(:(\d+))?)?([^#?]*)(\?([^#]*))?(#(.*))?/,explodeQuery:function(d){if(!d){return{}}var b,a,c={};d=d.split("&");for(b=0,l=d.length;b<l;b++){a=d[b].split("=");c[decodeURIComponent(a[0])]=(typeof(a[1])=="undefined")?"":decodeURIComponent(a[1])}return c},implodeQuery:function(f,c){c=c||"";var e=[];if(f instanceof Array){for(var d=0;d<f.length;d++){try{e.push(URI.implodeQuery(f[d],c?c+"["+d+"]":d))}catch(b){}}}else{if(typeof(f)=="object"){for(var a in f){try{e.push(URI.implodeQuery(f[a],c?c+"["+a+"]":a))}catch(b){}}}else{if(c&&c.length){e.push(encodeURIComponent(c)+"="+encodeURIComponent(f))}else{e.push(encodeURIComponent(f))}}}return e.join("&")}});copy_properties(URI.prototype,{parse:function(b){var a=b.toString().match(URI.expression);copy_properties(this,{protocol:a[3]||"",domain:a[4]||"",port:a[6]||"",path:a[7]||"",query:URI.explodeQuery(a[9]||""),fragment:a[11]||""});return this},setProtocol:function(a){this.protocol=a;return this},getProtocol:function(){return this.protocol},setQueryData:function(a){this.query=a;return this},addQueryData:function(a){return this.setQueryData(copy_properties(this.query,a))},getQueryData:function(){return this.query},setFragment:function(a){this.fragment=a;return this},getFragment:function(){return this.fragment},setDomain:function(a){this.domain=a;return this},getDomain:function(){return this.domain},setPort:function(a){this.port=a;return this},getPort:function(){return this.port},setPath:function(a){this.path=a;return this},getPath:function(){return this.path},toString:function(){var a="";var b=URI.implodeQuery(this.query);this.protocol&&(a+=this.protocol+"://");this.domain&&(a+=this.domain);this.port&&(a+=":"+this.port);if(this.domain&&!this.path){a+="/"}this.path&&(a+=this.path);b&&(a+="?"+b);this.fragment&&(a+="#"+this.fragment);return a},isSameOrigin:function(a){var b=a||window.location.href;if(!(b instanceof URI)){b=new URI(b.toString())}if(this.getProtocol()&&this.getProtocol()!=b.getProtocol()){return false}if(this.getDomain()&&this.getDomain()!=b.getDomain()){return false}return true},coerceToSameOrigin:function(a){var b=a||window.location.href;if(!(b instanceof URI)){b=new URI(b.toString())}if(this.isSameOrigin(b)){return true}if(this.getProtocol()!=b.getProtocol()){return false}var d=b.getDomain().split(".");var c=this.getDomain().split(".");if(d.pop()=="com"&&c.pop()=="com"){if(d.pop()=="facebook"&&c.pop()=="facebook"){this.setDomain(b.getDomain());return true}}return false}});function EventController(a){copy_properties(this,{queue:[],ready:false,responder:a})}copy_properties(EventController.prototype,{startQueue:function(){this.ready=true;this.dispatchEvents();return this},pauseQueue:function(){this.ready=false;return this},addEvent:function(c){if(c.toLowerCase()!==c){Util.warn("Event name %q contains uppercase letters; events should be lowercase.",c)}var a=[];for(var b=1;b<arguments.length;b++){a.push(arguments[b])}this.queue.push({type:c,args:a});if(this.ready){this.dispatchEvents()}return event_abort(event_get(arguments[1]))},dispatchEvents:function(){if(!this.responder){Util.error("Event controller attempting to dispatch events with no responder! Provide a responder when constructing the controller.")}for(var a=0;a<this.queue.length;a++){var b="on"+this.queue[a].type;if(typeof(this.responder[b])!="function"&&typeof(this.responder[b])!="null"){Util.warn("Event responder is unable to respond to %q event! Implement a %q method. Note that method names are case sensitive; use lower case when defining events and event handlers.",this.queue[a].type,b)}else{if(this.responder[b]){this.responder[b].apply(this.responder,this.queue[a].args)}}}this.queue=[]}});function htmlspecialchars(a){if(typeof(a)=="undefined"||!a.toString){return""}if(a===false){return"0"}else{if(a===true){return"1"}}return a.toString().replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#039;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function escape_js_quotes(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/"/g,"\\x22").replace(/'/g,"\\'").replace(/</g,"\\x3c").replace(/>/g,"\\x3e").replace(/&/g,"\\x26")}function trim(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/^\s*|\s*$/g,"")}function nl2br(a){if(typeof(a)=="undefined"||!a.toString){return""}return a.toString().replace(/\n/g,"<br />")}function sprintf(){if(arguments.length==0){Util.warn("sprintf() was called with no arguments; it should be called with at least one argument.");return""}var f=["This is an argument vector."];for(var g=arguments.length-1;g>0;g--){if(typeof(arguments[g])=="undefined"){Util.log("You passed an undefined argument (argument "+g+" to sprintf(). Pattern was: `"+(arguments[0])+"'.","error");f.push("")}else{if(arguments[g]===null){f.push("")}else{if(arguments[g]===true){f.push("true")}else{if(arguments[g]===false){f.push("false")}else{if(!arguments[g].toString){Util.log("Argument "+(g+1)+" to sprintf() does not have a toString() method. The pattern was: `"+(arguments[0])+"'.","error");return""}f.push(arguments[g])}}}}}var e=arguments[0];e=e.toString().split("%");var c=e.length;var k=e[0];for(var g=1;g<c;g++){if(f.length==0){Util.log("Not enough arguments were provide to sprintf(). The pattern was: `"+(arguments[0])+"'.","error");return""}if(!e[g].length){k+="%";continue}switch(e[g].substr(0,1)){case"s":k+=htmlspecialchars(f.pop().toString());break;case"h":k+=f.pop().toString();break;case"d":k+=parseInt(f.pop());break;case"f":k+=parseFloat(f.pop());break;case"q":k+="`"+htmlspecialchars(f.pop().toString())+"'";break;case"e":k+="'"+escape_js_quotes(f.pop().toString())+"'";break;case"L":var d=f.pop();for(var g=0;g<d.length;g++){d[g]="`"+htmlspecialchars(f.pop().toString())+"'"}if(d.length>1){d[d.length-1]="and "+d[d.length-1]}k+=d.join(", ");break;case"x":x=f.pop();var j="?";var a="?";try{if(typeof(x.line)!="undefined"){j=x.line}else{if(typeof(x.lineNumber)!="undefined"){j=x.lineNumber}}if(typeof(x.sourceURL)!="undefined"){a=x.sourceURL}else{if(typeof(x.fileName)!="undefined"){a=h.fileName}}}catch(b){}var h="[An Exception]";try{h=x.message||x.toString()}catch(b){}k+=h+" [at line "+j+" in "+a+"]";break;default:k+="%"+e[g].substring(0,1);break}k+=e[g].substring(1)}if(f.length>1){Util.log("Too many arguments ("+(f.length-1)+" extras) were passed to sprintf(). Pattern was: `"+(arguments[0])+"'.","error")}return k}String.prototype._split=String.prototype.split;String.prototype.split=function(g,b){var a="";if(g===null||b===null){return[]}else{if(typeof g=="string"){return this._split(g,b)}else{if(g===undefined){return[this.toString()]}else{if(g instanceof RegExp){if(!g._2||!g._1){a=g.toString().replace(/^[\S\s]+\//,"");if(!g._1){if(!g.global){g._1=new RegExp(g.source,"g"+a)}else{g._1=1}}}separator1=g._1==1?g:g._1;var e=(g._2?g._2:g._2=new RegExp("^"+separator1.source+"$",a));if(b===undefined||b<0){b=false}else{b=Math.floor(b);if(!b){return[]}}var d,c=[],h=0,f=0;while((b?f++<=b:true)&&(d=separator1.exec(this))){if((d[0].length===0)&&(separator1.lastIndex>d.index)){separator1.lastIndex--}if(separator1.lastIndex>h){if(d.length>1){d[0].replace(e,function(){for(var k=1;k<arguments.length-2;k++){if(arguments[k]===undefined){d[k]=undefined}}})}c=c.concat(this.substring(h,d.index),(d.index===this.length?[]:d.slice(1)));h=separator1.lastIndex}if(d[0].length===0){separator1.lastIndex++}}return(h===this.length)?(separator1.test("")?c:c.concat("")):(b?c:c.concat(this.substring(h)))}else{return this._split(g,b)}}}}};Util._deprecatedBecause={extend:"extend() has been renamed copy_properties() to avoid confusion with Function.extend(). Use Function.extend() or subclass() to establish classinheritence, and copy_properties() to copy properties between objects.",ajaxrequest:"AjaxRequest has been renamed AsyncRequest. The interface has not changed.",ajaxresponse:"AjaxResponse has been renamed AsyncResponse. The interface has not changed.",ajax:'The `Ajax\' class has been deprecated for sucking. Use AsyncRequest and AsyncResponse to make remote HTTP requests. Prefer JSON to XML as a transport encoding, but never say "AJAJ". AND WRITE ERROR HANDLERS! ',ajaxloadindicator:"No ajaxLoadIndicator element is ever generated, so this code is apparently never used.",toggleinlineflyer:"This function is not used anywhere.",checkagree:"This function is marked as deprecated and not used anywhere.",dynamicdialog:"Dynamicdialog is deprecated in favor of dialogpro."};function extend(b,a){Util.deprecated("extend");return copy_properties(b,a)}function checkAgree(){Util.deprecated("checkagree");if(document.frm.pic.value){if(document.frm.agree.checked){document.frm.submit()}else{show("error")}}}function toggleInlineFlyer(a){Util.deprecated("toggleinlineflyer");if(a.innerHTML=="hide flyer"){a.innerHTML="show flyer"}else{a.innerHTML="hide flyer"}toggle("inline_flyer_content")}var ajaxLoadIndicatorRefCount=0;function ajaxShowLoadIndicator(){Util.deprecated("ajaxloadindicator");indicatorDiv=ge("ajaxLoadIndicator");if(!indicatorDiv){indicatorDiv=document.createElement("div");indicatorDiv.id="ajaxLoadIndicator";indicatorDiv.innerHTML="Loading";indicatorDiv.className="ajaxLoadIndicator";document.body.appendChild(indicatorDiv)}indicatorDiv.style.top=(5+pageScrollY())+"px";indicatorDiv.style.left=(5+pageScrollX())+"px";indicatorDiv.style.display="block";ajaxLoadIndicatorRefCount++}function ajaxHideLoadIndicator(){ajaxLoadIndicatorRefCount--;if(ajaxLoadIndicatorRefCount==0){ge("ajaxLoadIndicator").style.display=""}}function XnAjax(b,a){if(location.href.indexOf("intern/data")==-1){Util.deprecated("ajax")}newAjax=this;this.onDone=b;this.onFail=a;this.transport=this.getTransport();this.transport.onreadystatechange=ajaxTrampoline(this)}XnAjax.prototype.get=function(a,c,b){b=b||false;if(c&&(typeof c!="string")){c=URI.implodeQuery(c)}fullURI=a+(c?("?"+c):"");this.transport.open("GET",fullURI,!b);this.transport.send("")};XnAjax.prototype.post=function(b,d,c,a){c=c||false;a=a||false;if(d&&(typeof d!="string")){d=URI.implodeQuery(d)}if(!a){var e=ge("post_form_id");if(e){d+="&post_form_id="+e.value}}this.transport.open("POST",b,!c);this.transport.setRequestHeader("Content-Type","application/x-www-form-urlencoded");this.transport.send(d)};XnAjax.prototype.stateDispatch=function(){try{if(this.transport.readyState==1&&this.showLoad){ajaxShowLoadIndicator()}if(this.transport.readyState==4){if(this.showLoad){ajaxHideLoadIndicator()}if(this.transport.status>=200&&this.transport.status<300&&this.transport.responseText.length>0){try{if(this.onDone){this.onDone(this,this.transport.responseText)}}catch(a){console?console.error(a):false}}else{try{if(this.onFail){this.onFail(this)}}catch(a){console?console.error(a):false}}}}catch(b){if(this.onFail){this.onFail(this)}}};XnAjax.prototype.getTransport=function(){var a=null;try{a=new XMLHttpRequest()}catch(b){a=null}try{if(!a){a=new ActiveXObject("Msxml2.XMLHTTP")}}catch(b){a=null}try{if(!a){a=new ActiveXObject("Microsoft.XMLHTTP")}}catch(b){a=null}return a};function ajaxTrampoline(a){return function(){a.stateDispatch()}}function toggle_dynamic_dialog_custom(f,g){Util.deprecated("dynamicdialog");var e;e='<div id="ie_iframe_holder"></div>';e+='<div style="position: absolute; z-index: 100;">';g=e+g+"</div>";var c=ge("dynamic_dialog");if(c){if(shown(c)&&same_place(f,c)){hide(c)}else{move_here(f,c);c.innerHTML=g;show("dynamic_dialog")}}else{var c=document.createElement("div");c.id="dynamic_dialog";c.innerHTML=g;move_here(f,c);ge("content").appendChild(c)}var a,d,b;a=ge("dialog").offsetHeight;d=ge("dialog").offsetWidth;b='<iframe width="'+d+' "height='+a+'" ';b+='style="position: absolute; z-index: 99; border: none;"></iframe>';ge("ie_iframe_holder").innerHTML=b;return false}function same_place(b,a){Util.deprecated("dynamicdialog");if(b=ge(b)){if(elementY(b)+20==elementY(a)){return true}}return false}function move_here(c,b){Util.deprecated("dynamicdialog");var a=getViewportWidth()/2-120;var d=elementY(c)+20;b.style.left=a+"px";b.style.top=d+"px"}function toggle_dynamic_dialog_post(g,c,a,f,d,h){Util.deprecated("dynamicdialog");var j=(ge("post_form_id")?('<input type="hidden" name="post_form_id" value="'+ge("post_form_id").value+'"/>'):"");var k="";for(var b in h){k+='<input type="hidden" name="'+b+'" value="'+h[b]+'"/>'}var e='<table id="dialog" border="0" cellspacing="0" width="360"><tr><td class="dialog"><h4>'+c+"</h4><p>"+a+'</p><div class="buttons"><form action="'+d+'" method="post">'+j+k+'<input type="hidden" name="next" value="'+window.location+'"/><input type="submit" id="confirm" name="confirm" class="inputsubmit" value="'+f+'"/>&nbsp;<input type="button" id="cancel" name="cancel" onclick="hide(\'dynamic_dialog\');" class="inputbutton" value="Cancel" /></form></div></td></tr></table>';return toggle_dynamic_dialog_custom(g,e)}function toggle_dynamic_dialog(e,d,c,f,b){Util.deprecated("dynamicdialog");var a=(ge("post_form_id")?('<input type="hidden" name="post_form_id" value="'+ge("post_form_id").value+'"/>'):"");var g='<form action="'+b+'" method="post">\n<table id="dialog" border="0" cellspacing="0" width="360"><tr>\n<td class="dialog">\n<h4>'+d+"</h4>\n<p>"+c+'</p><div class="buttons">\n'+a+'<input type="hidden" name="next" value="'+window.location+'"/>\n<input type="submit" id="confirm" name="confirm" class="inputsubmit" value="'+f+'"/>&nbsp;<input type="button" id="cancel" name="cancel" onclick="hide(\'dynamic_dialog\');" class="inputbutton" value="Cancel" />\n</div>\n</td>\n</tr>\n</table>\n</form>\n';return toggle_dynamic_dialog_custom(e,g)}function toggle_dynamic_dialog_js(e,c,b,f,d,a){Util.deprecated("dynamicdialog");var g='<table id="dialog" border="0" cellspacing="0" width="360"><tr>\n<td class="dialog">\n<h4>'+c+"</h4>\n<p>"+b+'</p><div class="buttons">\n<input type="button" id="confirm" name="confirm" class="inputsubmit"  value="'+f+'" onclick="'+d+'"/>&nbsp;';if(!a){g+='<input type="button" id="cancel" name="cancel" onclick="hide(\'dynamic_dialog\');" class="inputbutton" value="Cancel" />\n'}g+="</div>\n</td>\n</tr>\n</table>\n";return toggle_dynamic_dialog_custom(e,g)}var MAX_APP_LIST_END=275;var MAX_SIDENAV_LINKS=7;var MOVING_THRESHOLD=10;var saved_message=null;function track_moveable(a,b){b.ondrag=function(c){event.cancelBubble=true;return false}.bind(this);this.listContainer=a;this.link=b;this.listContainer.onmousedown=function(c){return this._onclick(c?c:window.event)}.bind(this)}track_moveable.prototype._onclick=function(a){this.clickMouseY=mouseY(a);document.onselectstart=function(b){return false};document.onmousemove=function(b){return this._track_move(b?b:window.event)}.bind(this);document.onmouseup=function(b){this._track_drop(b?b:window.event)}.bind(this);return false};track_moveable.prototype._track_move=function(b){if(Math.abs(mouseY(b)-this.clickMouseY)>MOVING_THRESHOLD){var a=new moveable_app(this.listContainer,this.link);a._onclick(null,this.clickMouseY)}};track_moveable.prototype._track_drop=function(a){document.onmouseout=document.onmouseup=document.onmousemove=document.onclick=null;this.link.onclick=function(b){return true}};function moveable_app(a,b){this.listContainer=a;this.link=b;this.listContainer.onmousedown=function(c){return this._onclick(c?c:window.event)}.bind(this)}moveable_app.prototype._onclick=function(f,b){add_css_class_name(this.listContainer,"floating_container");var a=ge("app_list");this.listContainer.lowerBoundY=elementY(a.firstChild?a.firstChild:a);this.oldListID=this.listContainer.parentNode.parentNode.id;this.justOpened=false;var c=ge("app_non_nav_list");this.listContainer.upperBoundY=elementY(c.lastChild?c.lastChild:c);var d=(ua.ie()||ua.safari())?this.listContainer.offsetHeight:this.listContainer.offsetHeight+1;this.listContainer.parentNode.style.height=(d)+"px";this.listContainer.top=elementY(this.listContainer);b=b?b:mouseY(f);this.mouseOffset=b-this.listContainer.top;this.listContainer.style.top=this.listContainer.top+"px";document.onmousemove=function(g){return this._move(g?g:window.event)}.bind(this);document.onmouseup=function(g){this._drop(g?g:window.event)}.bind(this);this._calculateBoundaries();return false};moveable_app.prototype._calculateBoundaries=function(){var c=this.listContainer.parentNode.parentNode;var d=this.listContainer.parentNode.previousSibling;this.listContainer.prevList=null;this.listContainer.previousNodeY=null;if(d){this.listContainer.previousNodeY=elementY(d)+7;this.newList=false}else{if(c.id=="app_non_nav_list"){this.listContainer.prevList=ge("app_list");var b=null;if(this.listContainer.prevList.lastChild){b=this.listContainer.prevList.lastChild}else{b=this.listContainer.prevList}this.newList=true;this.listContainer.previousNodeY=elementY(b)+20}}var a=this.listContainer.parentNode.nextSibling;this.listContainer.nextList=null;this.listContainer.nextNodeY=null;if(a){this.listContainer.nextNodeY=elementY(a)-7;this.newList=false}else{if(c.id=="app_list"){this.listContainer.nextList=ge("app_non_nav_list");var b=null;this.newList=true;if(this.listContainer.nextList.parentNode.style.display=="none"){this.justOpened=true;this.listContainer.nextNodeY=elementY(ge("more_link"))-18}else{if(this.listContainer.nextList.firstChild){b=this.listContainer.nextList.firstChild}else{b=this.listContainer.nextList}this.listContainer.nextNodeY=elementY(b)-20}}}};moveable_app.prototype._move=function(c){this.listContainer.top=mouseY(c)-this.mouseOffset;var a=this.listContainer.parentNode;if(this.listContainer.nextNodeY&&this.listContainer.top>this.listContainer.nextNodeY){if(this.listContainer.nextList==null){var b=a.nextSibling;b.appendChild(this.listContainer);a.style.height=null;a.appendChild(b.firstChild)}else{if(this.newList){expand_more_list();var b=document.createElement("div");b.className="list_item";this.listContainer.nextList.insertBefore(b,this.listContainer.nextList.firstChild);b.appendChild(this.listContainer);a.parentNode.removeChild(a)}}}else{if(this.listContainer.previousNodeY&&this.listContainer.top<this.listContainer.previousNodeY){if(this.listContainer.prevList==null){var b=a.previousSibling;b.appendChild(this.listContainer);a.style.height=null;a.appendChild(b.firstChild)}else{var b=document.createElement("div");b.className="list_item";this.listContainer.prevList.appendChild(b);b.appendChild(this.listContainer);a.parentNode.removeChild(a)}}}if(this.listContainer.parentNode!=a){a.style.height=null;this.listContainer.parentNode.style.height=(this.listContainer.offsetHeight+1)+"px";this._calculateBoundaries()}if((is_first_child(this.listContainer.parentNode,"app_list")&&this.listContainer.top<elementY(this.listContainer.parentNode))||(is_last_child(this.listContainer.parentNode,"app_non_nav_list")&&this.listContainer.top>elementY(this.listContainer.parentNode))){this.listContainer.style.top=(elementY(this.listContainer.parentNode)-1)+"px"}else{this.listContainer.style.top=this.listContainer.top+"px"}return false};function is_first_child(b,a){return(b.parentNode.id==a)&&(b.parentNode.firstChild==b)}function is_last_child(b,a){return(b.parentNode.id==a)&&(b.parentNode.lastChild==b)}function onload_side_nav_check(){enforce_app_list_limits_and_save(false,"onload_side_nav")}function enforce_app_list_limits_and_save(force_save,context){var display_list="";var app_list_node=ge("app_list");var more_apps_node=ge("app_non_nav_list");var more_list="";var max_reached=false;var extra_pixel_amount=0;var rearrange_message=ge("rearrange_message");if(rearrange_message){extra_pixel_amount=rearrange_message.offsetHeight+6}var threshold=MAX_APP_LIST_END+elementY(ge("sidebar"))+extra_pixel_amount;while(elementY(app_list_node)+app_list_node.offsetHeight>threshold||app_list_node.childNodes.length>MAX_SIDENAV_LINKS){if(more_apps_node.firstChild){more_apps_node.insertBefore(app_list_node.lastChild,more_apps_node.firstChild)}else{more_apps_node.appendChild(app_list_node.lastChild)}max_reached=true}if(max_reached||force_save){for(var i=0;i<app_list_node.childNodes.length;i++){if(i!=0){display_list+=":"}try{display_list+=app_list_node.childNodes[i].firstChild.id}catch(e){}}for(var i=0;i<more_apps_node.childNodes.length;i++){if(i!=0){more_list+=":"}try{more_list+=more_apps_node.childNodes[i].firstChild.id}catch(e){}}var ajax=new XnAjax(function(obj,text){eval(text)});var post_vars={display_list:display_list,more_list:more_list,context:context};ajax.post("/savemenu.do",post_vars)}}moveable_app.prototype._drop=function(a){remove_css_class_name(this.listContainer,"floating_container");this.listContainer.style.top=null;this.listContainer.parentNode.style.height=null;enforce_app_list_limits_and_save(true,"rearrange_order");if(this.listContainer.parentNode.parentNode.id!="app_non_nav_list"&&this.justOpened){window.setTimeout("close_more_list()",500)}document.onmouseout=document.onmouseup=document.onmousemove=document.onclick=null;if(this.link){this.link.onclick=function(b){return false}}return false};function change_status_message(a,c){var b=ge("rearrange_message");b.className=a;b.innerHTML=c}function change_to_apps_menu(b){var a=b.firstChild;var d=a.firstChild;d.setAttribute("onclick","move_lists(this.parentNode.parentNode, 'app_non_nav_list', change_to_non_menu, true); return false;");d.setAttribute("class","action_item");d.innerHTML="remove";var c=document.createElement("div");c.setAttribute("class","handle");c.setAttribute("onmousedown","new moveable_app(this.parentNode);");a.insertBefore(c,a.firstChild.nextSibling)}function change_to_non_menu(b){var a=b.firstChild;var d=a.firstChild;var c=a.firstChild.nextSibling;a.removeChild(c);d.setAttribute("onclick","move_lists(this.parentNode.parentNode, 'app_list', change_to_apps_menu); return false;");d.setAttribute("class","action_item_add");d.innerHTML="add to menu"}function move_lists(d,b,c,a){to_list_obj=ge(b);if(c){c(d)}if(a){to_list_obj.insertBefore(d,to_list_obj.firstChild)}else{to_list_obj.appendChild(d)}}var apps_menu_timout_id;function try_expand(a){if(a.innerHTML=="更多"){apps_menu_timout_id=window.setTimeout("expand_more_list()",500)}else{}}function untry_expand(){window.clearTimeout(apps_menu_timout_id)}function generic_dialog(a,b){this.className=a;this.content=null;this.obj=null;this.popup=null;this.overlay=null;this.modal=null;this.iframe=null;this.hidden_objects=[];if(b==true){this.modal=true}}generic_dialog.dialog_stack=null;generic_dialog.prototype.should_hide_objects=ua.osx();generic_dialog.prototype.should_use_iframe=ua.ie()<7||(ua.osx()&&ua.firefox());generic_dialog.prototype.show_dialog=function(b){if(!this.obj){this.build_dialog()}set_inner_html(this.content,b);if(generic_dialog.prototype.should_hide_objects){var c=this.content.getElementsByTagName("img");for(var a=0;a<c.length;a++){c[a].onload=c[a].onload?function(){this.onload.apply(this.img,arguments);this.dialog.hide_objects()}.bind({img:c[a],dialog:this,onload:c[a].onload}):this.hide_objects.bind(this)}}this.show();this.focus_first_textbox();this.on_show_callback&&this.on_show_callback();return this};generic_dialog.prototype.focus_first_textbox=function(){function a(b){var c=(b.tagName=="INPUT"&&b.type.toLowerCase()=="text")||(b.tagName=="TEXTAREA");if(c){try{b.focus();return false}catch(d){}}return true}iterTraverseDom(this.content,a)};generic_dialog.prototype.set_top=function(a){return this};generic_dialog.prototype.make_modal=function(){if(this.modal){return}this.modal=true;if(ua.ie()==7){this.build_iframe()}this.build_overlay();this.reset_iframe()};generic_dialog.prototype.show_loading=function(a){return this.show_dialog('<div id="structs" class="share_composer share_status_post"><div class="loading"><p>'+a+"</p></div></div>")};generic_dialog.prototype.show_ajax_dialog_custom_loader=function(a,d,e){e=e||false;this.show_loading(a);var b=this;var c=new XnAjax(function(f,g){b.show_dialog(g)});if(e){c.post(d,e)}else{c.get(d)}return this};generic_dialog.prototype.show_ajax_dialog=function(b,c){c=c||false;var a="载入中...";return this.show_ajax_dialog_custom_loader(a,b,c)};generic_dialog.prototype.show_prompt=function(b,a){return this.show_dialog("<h2><span>"+b+'</span></h2><div class="dialog_content">'+a+"</div>")};generic_dialog.prototype.show_message=function(c,b,a){if(a==null){a="Okay"}return this.show_choice(c,b,a,function(){generic_dialog.get_dialog(this).fade_out(100)})};generic_dialog.prototype.show_choice=function(title,content,button1,button1js,button2,button2js,buttons_left_msg,button3,button3js){var buttons='<div class="dialog_buttons" id="dialog_buttons">';if(typeof(buttons_left_msg)!="undefined"){buttons+='<div class="dialog_buttons_left_msg">';buttons+=buttons_left_msg;buttons+="</div>"}buttons+='<input class="inputsubmit" type="button" value="'+button1+'" id="dialog_button1" />';if(button2){buttons+='<input class="inputsubmit" type="button" value="'+button2+'" id="dialog_button2" />'}if(button3){buttons+='<input class="inputsubmit" type="button" value="'+button3+'" id="dialog_button3" />'}this.show_prompt(title,this.content_to_markup(content)+buttons);var inputs=this.obj.getElementsByTagName("input");if(button3){button1obj=inputs[inputs.length-3];button2obj=inputs[inputs.length-2];button3obj=inputs[inputs.length-1]}else{if(button2){button1obj=inputs[inputs.length-2];button2obj=inputs[inputs.length-1]}else{button1obj=inputs[inputs.length-1]}}if(button1js&&button1){if(typeof button1js=="string"){eval("button1js = function(){"+button1js+"}")}button1obj.onclick=button1js}if(button2js&&button2){if(typeof button2js=="string"){eval("button2js = function(){"+button2js+"}")}button2obj.onclick=button2js}if(button3js&&button3){if(typeof button3js=="string"){eval("button3js = function(){"+button3js+"}")}button3obj.onclick=button3js}if(!this.modal){document.onkeyup=function(e){var keycode=(e&&e.which)?e.which:event.keyCode;var btn2_exists=(typeof button2obj!="undefined");var btn3_exists=(typeof button3obj!="undefined");var is_webkit=ua.safari();if(is_webkit&&keycode==13){button1obj.click()}if(keycode==27){if(btn3_exists){button3obj.click()}else{if(btn2_exists){button2obj.click()}else{button1obj.click()}}}document.onkeyup=function(){}};button1obj.focus()}return this};generic_dialog.prototype.show_choice_ajax=function(h,a,f,c,e,g,b,d,j){this.show_loading("Loading...");var k=function(m){this.show_choice(h,m.getPayload(),f,c,e,g,b,d,j)}.bind(this);new AsyncRequest().setURI(a).setHandler(k).send();return this};generic_dialog.prototype.show_form_ajax=function(g,a,d,b){this.show_loading("Loading...");var h="dialog_ajax_form__"+gen_unique();var f=function(n,m){if(m.getError()!=true){n.hide();ErrorDialog.showAsyncError(m)}else{n.show_choice(g,m.getPayload(),"Okay",function(){n.fade_out(200)})}}.bind(null,this);var k=function(n,m){var o='<form id="'+h+'" onsubmit="return false;">'+m.getPayload()+"</form>";n.show_choice(g,o,d,j,"Cancel",function(){n.fade_out(200)})}.bind(null,this);var j=function(){new AsyncRequest().setURI(a).setData(serialize_form(ge(h))).setHandler(e).setErrorHandler(c).send()};var e=function(n,m){n.show_choice(g,m.getPayload(),"Okay",function(){n.fade_out(200)});if(b){window.location.reload()}else{setTimeout(function(){n.fade_out(500)},750)}}.bind(null,this);var c=function(n,m){if(m.getError()==1346001){k(m)}else{if(m.getError()!=true){ErrorDialog.showAsyncError(m)}else{f(m)}}}.bind(null,this);new AsyncRequest().setURI(a).setReadOnly(true).setHandler(k).setErrorHandler(f).send();return this};generic_dialog.prototype.show_form=function(e,b,a,d){b='<form action="'+d+'" method="post">'+this.content_to_markup(b);var c=ge("post_form_id");if(c){b+='<input type="hidden" name="post_form_id" value="'+c.value+'" />'}b+='<div class="dialog_buttons"><input class="inputsubmit" name="confirm" type="submit" value="'+a+'" />';b+='<input type="hidden" name="next" value="'+htmlspecialchars(document.location.href)+'"/>';b+='<input class="inputsubmit" type="button" value="Cancel" onclick="generic_dialog.get_dialog(this).fade_out(100)" /></form>';this.show_prompt(e,b);return this};generic_dialog.prototype.content_to_markup=function(a){return(typeof a=="string")?'<div class="dialog_body">'+a+"</div>":'<div class="dialog_summary">'+a.summary+'</div><div class="dialog_body">'+a.body+"</div>"};generic_dialog.prototype.hide=function(b){if(this.obj){this.obj.style.display="none"}if(this.iframe){this.iframe.style.display="none"}if(this.overlay){this.overlay.style.display="none"}if(this.timeout){clearTimeout(this.timeout);this.timeout=null;return}if(this.hidden_objects.length){for(var d=0,c=this.hidden_objects.length;d<c;d++){this.hidden_objects[d].style.visibility=""}this.hidden_objects=[]}clearInterval(this.active_hiding);if(!b){if(generic_dialog.dialog_stack){var a=generic_dialog.dialog_stack;for(var d=a.length-1;d>=0;d--){if(a[d]==this){a.splice(d,1)}}if(a.length){a[a.length-1].show()}}if(this.obj){this.obj.parentNode.removeChild(this.obj);this.obj=null}}return this};generic_dialog.prototype.fade_out=function(a,b){if(!this.popup){return this}animation(this.obj).duration(b?b:0).checkpoint().to("opacity",0).hide().duration(a?a:350).ondone(this.hide.bind(this)).go();return this};generic_dialog.prototype.show=function(){if(this.obj&&this.obj.style.display){this.obj.style.visibility="hidden";this.obj.style.display="";this.reset_dialog();this.obj.style.visibility="";this.obj.dialog=this}else{this.reset_dialog()}this.hide_objects();clearInterval(this.active_hiding);this.active_hiding=setInterval(this.active_resize.bind(this),500);var a=generic_dialog.dialog_stack?generic_dialog.dialog_stack:generic_dialog.dialog_stack=[];for(var b=a.length-1;b>=0;b--){if(a[b]==this){a.splice(b,1)}else{a[b].hide(true)}}a.push(this);return this};generic_dialog.prototype.enable_buttons=function(b){var a=this.obj.getElementsByTagName("input");for(var c=0;c<a.length;c++){if(a[c].type=="button"||a[c].type=="submit"){a[c].disabled=!b}}};generic_dialog.prototype.active_resize=function(){if(this.last_offset_height!=this.content.offsetHeight){this.hide_objects();this.last_offset_height=this.content.offsetHeight}};generic_dialog.prototype.hide_objects=function(){var f=[];var c=["",0,1,2,4,5,9,3];for(var b=0;b<c.length;b++){var h=ge("ad_"+c[b]);if(h!=null){f.push(h);this.should_hide_objects=true}}if(!this.should_hide_objects){return}var e={x:elementX(this.content),y:elementY(this.content),w:this.content.offsetWidth,h:this.content.offsetHeight};var g=document.getElementsByTagName("iframe");for(var b=0;b<g.length;b++){if(g[b].className.indexOf("share_hide_on_dialog")!=-1){f.push(g[b])}}var a=document.getElementsByTagName("embed");for(var b=0;b<a.length;b++){f.push(a[b])}for(var b=0;b<f.length;b++){var d=f[b].offsetHeight?f[b]:f[b].parentNode;swf_rect={x:elementX(d),y:elementY(d),w:d.offsetWidth,h:d.offsetHeight};if(!is_descendent(f[b],this.content)&&e.y+e.h>swf_rect.y&&swf_rect.y+swf_rect.h>e.y&&e.x+e.w>swf_rect.x&&swf_rect.x+swf_rect.w>e.w&&array_indexOf(this.hidden_objects,d)==-1){this.hidden_objects.push(d);d.style.visibility="hidden";d.style.visibility="hidden"}}};generic_dialog.prototype.build_dialog=function(){if(!this.obj){this.obj=document.createElement("div")}this.obj.className="generic_dialog"+(this.className?" "+this.className:"");this.obj.style.display="none";onloadRegister(function(){document.body.appendChild(this.obj)}.bind(this));if(this.should_use_iframe||(this.modal&&ua.ie()==7)){this.build_iframe()}if(!this.popup){this.popup=document.createElement("div");this.popup.className="generic_dialog_popup"}this.popup.style.left=this.popup.style.top="";this.obj.appendChild(this.popup);if(this.modal){this.build_overlay()}};generic_dialog.prototype.build_iframe=function(){if(!this.iframe&&!(this.iframe=ge("generic_dialog_iframe"))){this.iframe=document.createElement("iframe");this.iframe.id="generic_dialog_iframe"}this.iframe.frameBorder="0";onloadRegister(function(){document.body.appendChild(this.iframe)}.bind(this))};generic_dialog.prototype.build_overlay=function(){this.overlay=document.createElement("div");this.overlay.id="generic_dialog_overlay";if(document.body.clientHeight>document.documentElement.clientHeight){this.overlay.style.height=document.body.clientHeight+"px"}else{this.overlay.style.height=document.documentElement.clientHeight+"px"}onloadRegister(function(){document.body.appendChild(this.overlay)}.bind(this))};generic_dialog.prototype.reset_dialog=function(){if(!this.popup){return}onloadRegister(function(){this.reset_dialog_obj();this.reset_iframe()}.bind(this))};generic_dialog.prototype.reset_iframe=function(){if(!this.should_use_iframe&&!(this.modal&&ua.ie()==7)){return}if(this.modal){this.iframe.style.left="0px";this.iframe.style.top="0px";this.iframe.style.width="100%";if((document.body.clientHeight>document.documentElement.clientHeight)&&(document.body.clientHeight<10000)){this.iframe.style.height=document.body.clientHeight+"px"}else{if((document.body.clientHeight<document.documentElement.clientHeight)&&(document.documentElement.clientHeight<10000)){this.iframe.style.height=document.documentElement.clientHeight+"px"}else{this.iframe.style.height="10000px"}}}else{this.iframe.style.left=elementX(this.frame)+"px";this.iframe.style.top=elementY(this.frame)+"px";this.iframe.style.width=this.frame.offsetWidth+"px";this.iframe.style.height=this.frame.offsetHeight+"px"}this.iframe.style.display=""};generic_dialog.prototype.reset_dialog_obj=function(){};generic_dialog.prototype.set_width=function(a){this.obj.style.width=a?a+"px":""};generic_dialog.get_dialog=function(a){while(!a.dialog&&a.parentNode){a=a.parentNode}return a.dialog?a.dialog:false};function pop_dialog(a,c,b){this.top=125;this.parent.construct(this,a,b);this.on_show_callback=c}pop_dialog.extend(generic_dialog);pop_dialog.prototype.build_dialog=function(){this.parent.build_dialog();this.obj.className+=" pop_dialog";this.popup.innerHTML='<table id="pop_dialog_table" class="pop_dialog_table"><tr><td class="pop_topleft"></td><td class="pop_border"></td><td class="pop_topright"></td></tr><tr><td class="pop_border"></td><td class="pop_content" id="pop_content"></td><td class="pop_border"></td></tr><tr><td class="pop_bottomleft"></td><td class="pop_border"></td><td class="pop_bottomright"></td></tr></table>';this.frame=this.popup.getElementsByTagName("tbody")[0];this.content=this.popup.getElementsByTagName("td")[4]};pop_dialog.prototype.reset_dialog_obj=function(){this.popup.style.top=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop)+this.top+"px"};pop_dialog.prototype.set_top=function(a){this.top=a};function contextual_dialog(a){this.parent.construct(this,a)}contextual_dialog.extend(generic_dialog);contextual_dialog.prototype.set_context=function(a){this.context=a;return this};contextual_dialog.prototype.build_dialog=function(){this.parent.build_dialog();this.obj.className+=" contextual_dialog";this.popup.innerHTML='<div class="contextual_arrow"><span>^_^keke1</span></div><div class="contextual_dialog_content"></div>';this.arrow=this.popup.getElementsByTagName("div")[0];this.content=this.frame=this.popup.getElementsByTagName("div")[1]};contextual_dialog.prototype.reset_dialog_obj=function(){var b=elementX(this.context);var a=(document.body.offsetWidth-this.popup.offsetWidth)/2;if(b<document.body.offsetWidth/2){this.arrow.className="contextual_arrow_rev";var d=Math.min(a,b+this.context.offsetWidth-this.arrow_padding_x);var c=b-d+this.context.offsetWidth+this.arrow_padding_x}else{this.arrow.className="contextual_arrow";var d=Math.max(a,b-this.popup.offsetWidth+this.arrow_padding_x);var c=b-d-this.arrow_padding_x-this.arrow_width}this.popup.style.top=(elementY(this.context)+this.context.offsetHeight-this.arrow.offsetHeight+this.arrow_padding_y)+"px";this.popup.style.left=d+"px";this.arrow.style.backgroundPosition=c+"px"};contextual_dialog.prototype._remove_resize_events=function(){if(this._scroll_events){for(var a=0;a<this._scroll_events.length;a++){removeEventBase(this._scroll_events[a].obj,this._scroll_events[a].event,this._scroll_events[a].func)}}this._scroll_events=[]};contextual_dialog.prototype.show=function(){this._remove_resize_events();var b=this.context;while(b){if(b.id!="content"&&(b.scrollHeight&&b.offsetHeight&&b.scrollHeight!=b.offsetHeight)||(b.scrollWidth&&b.offsetWidth&&b.scrollWidth!=b.offsetWidth)){var a={obj:b,event:"scroll",func:this.reset_dialog_obj.bind(this)};addEventBase(a.obj,a.event,a.func)}b=b.parentNode}var a={obj:window,event:"resize",func:this.reset_dialog_obj.bind(this)};addEventBase(a.obj,a.event,a.func);this.parent.show()};contextual_dialog.prototype.hide=function(){this._remove_resize_events();this.parent.hide()};contextual_dialog.prototype.arrow_padding_x=5;contextual_dialog.prototype.arrow_padding_y=10;contextual_dialog.prototype.arrow_width=13;function ErrorDialog(){this.parent.construct(this,"errorDialog",null,true);return this}ErrorDialog.extend(pop_dialog);copy_properties(ErrorDialog.prototype,{showError:function(b,a){return this.show_message(b,a)}});copy_properties(ErrorDialog,{showAsyncError:function(a){try{return(new ErrorDialog()).showError(a.getErrorSummary(),a.getErrorDescription())}catch(b){aiert(a)}}});