DomainMap={cookieDomain:'.163.com',serverHostName:'blog.163.com',serverDomain:'.blog.163.com',getParentDomain:function(s){if(s.indexOf('@')!=-1||s.indexOf('_')!=-1||s.indexOf('..')!=-1||s.charAt(s.length-1)=='.')
return this.serverHostName+'/'+s;return s+this.serverDomain;}};
var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(s){return binl2hex(core_md5(str2binl(s),s.length*chrsz));}
function b64_md5(s){return binl2b64(core_md5(str2binl(s),s.length*chrsz));}
function str_md5(s){return binl2str(core_md5(str2binl(s),s.length*chrsz));}
function hex_hmac_md5(key,data){return binl2hex(core_hmac_md5(key,data));}
function b64_hmac_md5(key,data){return binl2b64(core_hmac_md5(key,data));}
function str_hmac_md5(key,data){return binl2str(core_hmac_md5(key,data));}
function md5_vm_test()
{return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72";}
function core_md5(x,len)
{x[len>>5]|=0x80<<((len)%32);x[(((len+64)>>>9)<<4)+14]=len;var a=1732584193;var b=-271733879;var c=-1732584194;var d=271733878;for(var i=0;i<x.length;i+=16)
{var olda=a;var oldb=b;var oldc=c;var oldd=d;a=md5_ff(a,b,c,d,x[i+0],7,-680876936);d=md5_ff(d,a,b,c,x[i+1],12,-389564586);c=md5_ff(c,d,a,b,x[i+2],17,606105819);b=md5_ff(b,c,d,a,x[i+3],22,-1044525330);a=md5_ff(a,b,c,d,x[i+4],7,-176418897);d=md5_ff(d,a,b,c,x[i+5],12,1200080426);c=md5_ff(c,d,a,b,x[i+6],17,-1473231341);b=md5_ff(b,c,d,a,x[i+7],22,-45705983);a=md5_ff(a,b,c,d,x[i+8],7,1770035416);d=md5_ff(d,a,b,c,x[i+9],12,-1958414417);c=md5_ff(c,d,a,b,x[i+10],17,-42063);b=md5_ff(b,c,d,a,x[i+11],22,-1990404162);a=md5_ff(a,b,c,d,x[i+12],7,1804603682);d=md5_ff(d,a,b,c,x[i+13],12,-40341101);c=md5_ff(c,d,a,b,x[i+14],17,-1502002290);b=md5_ff(b,c,d,a,x[i+15],22,1236535329);a=md5_gg(a,b,c,d,x[i+1],5,-165796510);d=md5_gg(d,a,b,c,x[i+6],9,-1069501632);c=md5_gg(c,d,a,b,x[i+11],14,643717713);b=md5_gg(b,c,d,a,x[i+0],20,-373897302);a=md5_gg(a,b,c,d,x[i+5],5,-701558691);d=md5_gg(d,a,b,c,x[i+10],9,38016083);c=md5_gg(c,d,a,b,x[i+15],14,-660478335);b=md5_gg(b,c,d,a,x[i+4],20,-405537848);a=md5_gg(a,b,c,d,x[i+9],5,568446438);d=md5_gg(d,a,b,c,x[i+14],9,-1019803690);c=md5_gg(c,d,a,b,x[i+3],14,-187363961);b=md5_gg(b,c,d,a,x[i+8],20,1163531501);a=md5_gg(a,b,c,d,x[i+13],5,-1444681467);d=md5_gg(d,a,b,c,x[i+2],9,-51403784);c=md5_gg(c,d,a,b,x[i+7],14,1735328473);b=md5_gg(b,c,d,a,x[i+12],20,-1926607734);a=md5_hh(a,b,c,d,x[i+5],4,-378558);d=md5_hh(d,a,b,c,x[i+8],11,-2022574463);c=md5_hh(c,d,a,b,x[i+11],16,1839030562);b=md5_hh(b,c,d,a,x[i+14],23,-35309556);a=md5_hh(a,b,c,d,x[i+1],4,-1530992060);d=md5_hh(d,a,b,c,x[i+4],11,1272893353);c=md5_hh(c,d,a,b,x[i+7],16,-155497632);b=md5_hh(b,c,d,a,x[i+10],23,-1094730640);a=md5_hh(a,b,c,d,x[i+13],4,681279174);d=md5_hh(d,a,b,c,x[i+0],11,-358537222);c=md5_hh(c,d,a,b,x[i+3],16,-722521979);b=md5_hh(b,c,d,a,x[i+6],23,76029189);a=md5_hh(a,b,c,d,x[i+9],4,-640364487);d=md5_hh(d,a,b,c,x[i+12],11,-421815835);c=md5_hh(c,d,a,b,x[i+15],16,530742520);b=md5_hh(b,c,d,a,x[i+2],23,-995338651);a=md5_ii(a,b,c,d,x[i+0],6,-198630844);d=md5_ii(d,a,b,c,x[i+7],10,1126891415);c=md5_ii(c,d,a,b,x[i+14],15,-1416354905);b=md5_ii(b,c,d,a,x[i+5],21,-57434055);a=md5_ii(a,b,c,d,x[i+12],6,1700485571);d=md5_ii(d,a,b,c,x[i+3],10,-1894986606);c=md5_ii(c,d,a,b,x[i+10],15,-1051523);b=md5_ii(b,c,d,a,x[i+1],21,-2054922799);a=md5_ii(a,b,c,d,x[i+8],6,1873313359);d=md5_ii(d,a,b,c,x[i+15],10,-30611744);c=md5_ii(c,d,a,b,x[i+6],15,-1560198380);b=md5_ii(b,c,d,a,x[i+13],21,1309151649);a=md5_ii(a,b,c,d,x[i+4],6,-145523070);d=md5_ii(d,a,b,c,x[i+11],10,-1120210379);c=md5_ii(c,d,a,b,x[i+2],15,718787259);b=md5_ii(b,c,d,a,x[i+9],21,-343485551);a=safe_add(a,olda);b=safe_add(b,oldb);c=safe_add(c,oldc);d=safe_add(d,oldd);}
return Array(a,b,c,d);}
function md5_cmn(q,a,b,x,s,t)
{return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b);}
function md5_ff(a,b,c,d,x,s,t)
{return md5_cmn((b&c)|((~b)&d),a,b,x,s,t);}
function md5_gg(a,b,c,d,x,s,t)
{return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t);}
function md5_hh(a,b,c,d,x,s,t)
{return md5_cmn(b^c^d,a,b,x,s,t);}
function md5_ii(a,b,c,d,x,s,t)
{return md5_cmn(c^(b|(~d)),a,b,x,s,t);}
function core_hmac_md5(key,data)
{var bkey=str2binl(key);if(bkey.length>16)bkey=core_md5(bkey,key.length*chrsz);var ipad=Array(16),opad=Array(16);for(var i=0;i<16;i++)
{ipad[i]=bkey[i]^0x36363636;opad[i]=bkey[i]^0x5C5C5C5C;}
var hash=core_md5(ipad.concat(str2binl(data)),512+data.length*chrsz);return core_md5(opad.concat(hash),512+128);}
function safe_add(x,y)
{var lsw=(x&0xFFFF)+(y&0xFFFF);var msw=(x>>16)+(y>>16)+(lsw>>16);return(msw<<16)|(lsw&0xFFFF);}
function bit_rol(num,cnt)
{return(num<<cnt)|(num>>>(32-cnt));}
function str2binl(str)
{var bin=Array();var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz)
bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32);return bin;}
function binl2str(bin)
{var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz)
str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask);return str;}
function binl2hex(binarray)
{var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++)
{str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+
hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF);}
return str;}
function binl2b64(binarray)
{var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var str="";for(var i=0;i<binarray.length*4;i+=3)
{var triplet=(((binarray[i>>2]>>8*(i%4))&0xFF)<<16)|(((binarray[i+1>>2]>>8*((i+1)%4))&0xFF)<<8)|((binarray[i+2>>2]>>8*((i+2)%4))&0xFF);for(var j=0;j<4;j++)
{if(i*8+j*6>binarray.length*32)str+=b64pad;else str+=tab.charAt((triplet>>6*(3-j))&0x3F);}}
return str;}
var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;var isFirefox=(navigator.userAgent.indexOf("Firefox")!=-1)?true:false;var IEVer=getIEVer();function getIEVer(){var iVerNo=0;var sVer=navigator.userAgent;if(sVer.indexOf("MSIE")>-1){var sVerNo=sVer.split(";")[1];sVerNo=sVerNo.replace("MSIE","");iVerNo=parseFloat(sVerNo);}
return iVerNo;}
function getShortDateTime(str){var d=new Date(str);var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}
var day=d.getDate().toString();if(day.length<2){day="0"+day;}
var hour=d.getHours().toString();if(hour.length<2){hour="0"+hour;}
var minute=d.getMinutes().toString();if(minute.length<2){minute="0"+minute;}
return month+"月"+day+"日 "+hour+":"+minute;}
function getLongDateTime(str){var d=new Date(str);var year=d.getFullYear().toString();var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}
var day=d.getDate().toString();if(day.length<2){day="0"+day;}
var hour=d.getHours().toString();if(hour.length<2){hour="0"+hour;}
var minute=d.getMinutes().toString();if(minute.length<2){minute="0"+minute;}
var second=d.getSeconds().toString();if(second.length<2){second="0"+second;}
return year+"年"+month+"月"+day+"日 "+hour+":"+minute+":"+second;}
function getLongDate(str){var d=new Date(str);var year=d.getFullYear().toString();var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}
var day=d.getDate().toString();if(day.length<2){day="0"+day;}
return year+"年"+month+"月"+day+"日";}
function getMediumDate(str){var d=new Date(str);var year=d.getFullYear().toString();var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}
var day=d.getDate().toString();if(day.length<2){day="0"+day;}
return year+"-"+month+"-"+day;}
function getShortDate(str){var d=new Date(str);var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}
var day=d.getDate().toString();if(day.length<2){day="0"+day;}
return month+"月"+day+"日";}
function getShortTime(str){var d=new Date(str);var hour=d.getHours().toString();if(hour.length<2){hour="0"+hour;}
var minute=d.getMinutes().toString();if(minute.length<2){minute="0"+minute;}
return hour+":"+minute;}
function getDateForMysql(str){var d=new Date(str);var year=d.getFullYear().toString();var monthInt=d.getMonth()+1;var month=monthInt.toString();if(month.length<2){month="0"+month;}
var day=d.getDate().toString();if(day.length<2){day="0"+day;}
var hour=d.getHours().toString();if(hour.length<2){hour="0"+hour;}
var minute=d.getMinutes().toString();if(minute.length<2){minute="0"+minute;}
var second=d.getSeconds().toString();if(second.length<2){second="0"+second;}
return year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second;}
function Trim(TRIM_VALUE){if(TRIM_VALUE.length<1){return"";}
TRIM_VALUE=RTrim(TRIM_VALUE);TRIM_VALUE=LTrim(TRIM_VALUE);if(TRIM_VALUE==""){return"";}
else{return TRIM_VALUE;}}
function RTrim(VALUE){var w_space=String.fromCharCode(32);var v_length=VALUE.length;var strTemp="";if(v_length<0){return"";}
var iTemp=v_length-1;while(iTemp>-1){if(VALUE.charAt(iTemp)==w_space){}
else{strTemp=VALUE.substring(0,iTemp+1);break;}
iTemp=iTemp-1;}
return strTemp;}
function LTrim(VALUE){var w_space=String.fromCharCode(32);if(v_length<1){return"";}
var v_length=VALUE.length;var strTemp="";var iTemp=0;while(iTemp<v_length){if(VALUE.charAt(iTemp)==w_space){}
else{strTemp=VALUE.substring(iTemp,v_length);break;}
iTemp=iTemp+1;}
return strTemp;}
function isEmptyDiv(str){var trim=Trim(str);if(trim=="")
return true;var rep=/^<DIV>(&nbsp;<\/DIV><DIV>)*(&nbsp;)*<\/DIV>$/i;if(rep.test(trim)){return true;}
else
return false;}
function _ge(id){return document.getElementById(id);}
function removeAllChild(el){var firstChild=el.firstChild;var curChild=firstChild;while(curChild!=null){el.removeChild(curChild);curChild=curChild.nextSibling;}}
function insertAfter(parent,node,referenceNode){parent.insertBefore(node,referenceNode.nextSibling);}
function containsIllegalChar(content){var regi=/^(.*)['"‘“\/\\<>](.*)$/;if(regi.test(content))
return true;else
return false;}
function testUrl(str){var illegalChar=/^(.*)['"‘“<>](.*)$/;if(illegalChar.test(str))
return false;else
return true;}
function checkUserName(str){var illegalChar=/^(.*)[<>](.*)$/;if(illegalChar.test(str))
return false;else
return true;}
function checkMail(str){var mail=/^(.+)@(.+)\.(.+)$/;if(!mail.test(str))
return false;if(str.indexOf('@')!=str.lastIndexOf('@'))
return false;var illegalChar=/^(.*)['"‘“\/\\<>](.*)$/;if(illegalChar.test(str))
return false;else
return true;}
function checkDateFormat(str){var format=/^\d{4}\-\d{2}\-\d{2}$/;if(format.test(str))
return true;else
return false;}
function checkBirthday(str){var today=new Date();var barray=str.split(new RegExp("-","g"));var birthday=new Date(barray[0],barray[1]-1,barray[2]);if(parseInt(barray[0])<1900){return-1;}
if(birthday.getTime()>today.getTime()){return 1;}
else if(birthday.getFullYear()<1900){return-1;}
else{return 0;}}
function extractHtmlText(content){var regstr=new String("<[^<>]*>");var reg1=new RegExp(regstr,"ig");if(reg1.test(content))
{content=content.replace(reg1,"");}
regstr=new String("(&nbsp;)|(&lt;)|(&gt;)|(&amp;)|(&quot;)");reg1=new RegExp(regstr,"ig");if(reg1.test(content))
{content=content.replace(reg1,"");}
return content;}
function convertStr(str){if(str==null)
return'&nbsp;';str=Trim(str);if(str=='')
str='&nbsp;';return str;}
function replaceLineBreak(str){return str.replace("\n","<br>");}
function textareaLimit(field,maxlen){if(field.value.length>maxlen){field.value=field.value.substring(0,maxlen);alert("超过最大字数限制"+maxlen+"个! ");}}
function textLimit(text,maxlen){if(text.length>maxlen){text=text.substring(0,maxlen);alert("超过最大字数限制"+maxlen+"个! ");}}
String.prototype.nlToBr=function(){return this.trim().nl2br();}
String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");};String.prototype.nl2br=function(){return this.split("\n").join("<br />\n");};String.prototype.trimSQ=function(){return this.replace("&#39;","\\\'");};String.prototype.escape=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&#34;").replace(/'/g,"&#39;");};String.prototype.escape_freemark=function(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");};String.prototype.unescape_freemark=function(){return this.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,"\"");};function searchList(el,list){var i=0;for(i=0;i<list.length;i++){if(el==list[i]){return true;}}
return false;}
function removeSameEl(list){var newList=new Array();var i;var el;for(i=0;i<list.length;i++){el=list[i];if(el!=null){var data;if(!searchList(el,newList)){newList.push(el);}}}
return newList;}
function insertShiftAt(list,el,position){if(position<0){position=0;}else if(position>list.length){positon=list.length;}
var prevList
var nextList;for(i=list.length;i>position;i--){list[i]=list[i-1];}
list[position]=el;}
var _get_event_src=function(e){if(e){return e.target;}
if(window.event){return window.event.srcElement;}
return null;};function appendCss(elem,newCss){$(elem).className+=" "+newCss;}
function removeLastCss(elem,oldCss){$(elem).className=$(elem).className.replace(new RegExp(" "+oldCss+"\\b"),"");}
function attachFocusEvent(focusArray,focusCss){focusArray.each(function(E){if($(E)){$(E).onfocus=function(){this.className+=" "+focusCss;}
$(E).onblur=function(){this.className=this.className.replace(new RegExp(" *"+focusCss+"\\b"),"");}}});}
function attachOverEvent(focusArray,focusCss){focusArray.each(function(E){if($(E)){$(E).onmouseover=function(){this.className+=" "+focusCss;}
$(E).onmouseout=function(){this.className=this.className.replace(new RegExp(" *"+focusCss+"\\b"),"");}}});}
var lastSelectId="";function applySelectCss(id){if($(lastSelectId))
$(lastSelectId).className=$(lastSelectId).className.replace(new RegExp(" *"+"selectItem"+"\\b"),"");$(id).className+=" "+"selectItem";lastSelectId=id;}
function attachFocusEvent2(focusArray,focusCss,focusFunc,blurFunc){focusArray.each(function(E){if($(E)){$(E).onfocus=function(){this.className+=" "+focusCss;if(focusFunc!=null){focusFunc($(E));}}
$(E).onblur=function(){this.className=this.className.replace(new RegExp(" "+focusCss+"\\b"),"");if(blurFunc!=null){blurFunc($(E));}}}});}
function focusEvent(obj,focusCss){obj.className+=" "+focusCss;}
function blurEvent(obj,focusCss){obj.className=obj.className.replace(new RegExp(" "+focusCss+"\\b"),"");}
function disable(elem){$(elem).disabled=true;}
function enable(elem){$(elem).disabled=false;}
function getFloat(value,len){var str=value.toString();var index=str.indexOf(".");if(index==-1)
return parseFloat(str);if(len==0)
return parseFloat(str.substr(0,index));else
return parseFloat(str.substr(0,index+len+1));}
function copyText(elemId){ie=(document.all)?true:false
if(ie){var rng=document.body.createTextRange();rng.moveToElementText($(elemId));rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);return true;}else{alert("你的浏览器安全设置不允许自动执行复制操作，请选中文本使用键盘(Ctrl+C)复制！");return false;}}
function detectFlash(){var reqMajorVer=7;var reqMinorVer=0;var reqRevision=0;reqVer=parseFloat(reqMajorVer+"."+reqRevision);if(isIE&&isWin&&!isOpera){versionStr=VBGetSwfVer();}else{versionStr=JSGetSwfVer();}
if(versionStr==-1){return false;}else if(versionStr!=0){if(isIE&&isWin&&!isOpera){tempArray=versionStr.split(" ");tempString=tempArray[1];versionArray=tempString.split(",");}else{versionArray=versionStr.split(".");}
versionMajor=versionArray[0];versionMinor=versionArray[1];versionRevision=versionArray[2];if(versionRevision<=0&&versionArray.length>3)
versionRevision=versionArray[3];versionString=versionMajor+"."+versionRevision;versionNum=parseFloat(versionString);if((versionMajor>reqMajorVer)&&(versionNum>=reqVer)){return true;}else{return((versionNum>=reqVer&&versionMinor>=reqMinorVer)?true:false);}}}
function JSGetSwfVer(){if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var swVer2=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var flashDescription=navigator.plugins["Shockwave Flash"+swVer2].description;descArray=flashDescription.split(" ");tempArrayMajor=descArray[2].split(".");versionMajor=tempArrayMajor[0];versionMinor=tempArrayMajor[1];if(descArray[3]!=""){tempArrayMinor=descArray[3].split(/\D/);}else{tempArrayMinor=descArray[4].split(/\D/);}
versionRevision=tempArrayMinor[1]>0?tempArrayMinor[1]:0;flashVer=versionMajor+"."+versionMinor+"."+versionRevision;}else{flashVer=-1;}}
else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1)flashVer=4;else if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1)flashVer=3;else if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1)flashVer=2;else{flashVer=-1;}
return flashVer;}
function MM_swapImgRestore(){var i,x,a=document.MM_sr;for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)x.src=x.oSrc;}
function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){var i,j=0,x,a=MM_swapImage.arguments;document.MM_sr=new Array;for(i=0;i<(a.length-2);i+=3)
if((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x;if(!x.oSrc)x.oSrc=x.src;x.src=a[i+2];}}
function getBrowserPositionX(obj){var res=obj.offsetWidth+5;while(obj!=null){res+=obj.offsetLeft;obj=obj.offsetParent;}
return res;}
function getBrowserPositionY(obj){var res=0;while(obj!=null){res+=obj.offsetTop;obj=obj.offsetParent;}
return res;}
function processTagString(tags){tags=tags.replace(/，/gi,",").replace(/“/g,"\"").replace(/”/g,"\"");tags=tags.toLowerCase();var tagList=tags.split(",");for(var i=0;i<tagList.length;i++){tagList[i]=Trim(tagList[i]);}
tagList=removeSameEl(tagList);tags="";for(var i=0;i<tagList.length;i++){if(tagList[i]!=""){if(tags!="")
tags+=",";tags+=tagList[i].substring(0,36);}}
return tags;}
function getTagObjByTagname(tagName,tagId,tagList){for(var i=0;tagId&&i<tagList.length;i++){if(tagList[i].id==tagId){return tagList[i];}}
for(var i=0;tagName&&i<tagList.length;i++){if(tagList[i].tagName==tagName||tagList[i].tagName==tagName.toLowerCase()||tagList[i].tagName==tagName.escape()||tagList[i].tagName==tagName.escape_freemark()){return tagList[i];}}
return null;}
function formatnumber(value,num)
{var a,b,c,i
a=value.toString();b=a.indexOf('.');c=a.length;if(num==0){if(b!=-1)a=a.substring(0,b);}else{if(b==-1){a=a+".";for(i=1;i<=num;i++)a=a+"0";}else{a=a.substring(0,b+num+1);for(i=c;i<=b+num;i++)a=a+"0";}}
return a;}
function createJST(jstId,jstContent){var textarea=document.createElement('textarea');textarea.value=jstContent;textarea.id=jstId;textarea.style.display='none';document.body.appendChild(textarea);}
function createJSTAndParse(jstId,jstContent){createJST(jstId,jstContent);return TrimPath.parseDOMTemplate(jstId);}
function getInputCharsFromDisplayHTML(sHTML){var chars=sHTML;chars=chars.replace(/<br>/ig,(Browser.isFirefox()?"\n":"\r\n"));chars=chars.replace(/&lt;/g,"<");chars=chars.replace(/&gt;/g,">");chars=chars.replace(/&quot;/g,"\"");chars=chars.replace(/&#039;/g,"'");chars=chars.replace(/&amp;/g,"&");chars=chars.replace(/&nbsp;/g," ");return chars;}
function toHtmlStr(sChars){var html=sChars;html=html.replace(/&/g,"&amp;");html=html.replace(/</g,"&lt;");html=html.replace(/>/g,"&gt;");html=html.replace(/"/g,"&quot;");html=html.replace(/'/g,"&#039;");html=html.replace(/ /g,"&nbsp;");html=html.replace(/\n/g,"<br>");return html;}
function formatImageUrl(url){if(url!=null&&url!="-1000")
return url;return"/style/common/user_default.gif";}
function showKeywordHint(warningLevel,fields){var pagehint=$("$$_pagehint");if(pagehint!=null){if(warningLevel==1){pagehint.innerHTML="你输入的"+fields+"含有非法字符，不允许发布，我们将记录你的IP地址和ID资料备案。";pagehint.style.display="block";}
else if(warningLevel==2){pagehint.innerHTML="你输入的"+fields+"含有非法字符，我们将记录你的IP地址和ID资料备案。是否继续发布？";pagehint.style.display="block";}}}
function showPageHint(str){var pagehint=$("$$_pagehint");if(pagehint!=null){pagehint.innerHTML=str;pagehint.style.display="block";}}
function filterWarning(keywordRuntimeEx,needTip){if(keywordRuntimeEx==undefined||keywordRuntimeEx==null||keywordRuntimeEx.type!="KeyWordRuntimeException"){return 0;}
if(needTip==undefined||needTip==false){alert("你发表的内容包含敏感关键字，不允许发布！");return-1;}
return-1;}
function captchaWarning(captchaEx,hintid){if(captchaEx==undefined||captchaEx==null||captchaEx.type!="CaptchaException"){return false;}
showInfo(hintid,"验证码不正确","error");return true;}
function checkOtherSiteUrl(content){var match=false;var index=0;while((index=content.indexOf("http://"))!=-1){var url=content.substring(index+7);var endIndex=url.indexOf("163.com");if(endIndex>-1){var j=index;while(j<endIndex){var ch=url.charAt(j);if(!((ch>='0'&&ch<='9')||(ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z')||ch=='.')){match=true;break;}
j++;}
if(endIndex>0&&url.charAt(endIndex-1)!='.'){match=true;break;}
content=url;}else{match=true;break;}
if(match==true){break;}}
return match;}
function showInfo(id,msg,type){var infodiv=document.getElementById(id);if(infodiv==null){alert(msg);return false;}
infodiv.style.display='inline';if(type=="ok")
infodiv.innerHTML='<img src="/style/common/ico_alert.gif"/>'+msg;else if(type=="info")
infodiv.innerHTML='<img src="/style/common/ico_alert.gif"/>'+msg;else if(type=="error")
infodiv.innerHTML='<img src="/style/common/ico_alert.gif"/>'+msg;else
infodiv.innerHTML='<img src="/style/common/ico_alert.gif"/>'+msg;window.setTimeout(function(){fadeInfo(id);},5000);}
function fadeInfo(id){document.getElementById(id).style.display='none';}
function stripData(content,noStripTags){var badContent=["head","script","style","object","applet","noscript","frameset","noframes"];var badTag=["form","meta","body","html","label","select","optgroup","option","textarea","title","script","xmp","applet","embed","head","frameset","iframe","noframes","noscript","object","style","input","base","basefont","isindex","link","frame","param","xml","xss","st1:chsdate"];var badAction=["onabort","onblur","onchange","onclick","ondblclick","ondragdrop","onerror","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onmove","onreset","onresize","onselect","onsubmit","onunload","allowScriptAccess","disabled","id","name","class"];var badCss=["position","javascript","vbscript","actionscript","xmp","activex"];var isHarm=false;var regStr;var reg=new RegExp("(&#)|(&%)","ig");if(reg.test(content)){content=content.replace(reg,"&");}
delete reg;reg=new RegExp("(\t)","ig");if(reg.test(content)){content=content.replace(reg," ");}
delete reg;regStr="(<[^<>]*)(\r|\n)([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){content=content.replace(reg,"$1 $3");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;regStr="(<[^<>]*)(\\\\|/\\*.*\\*/)([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){content=content.replace(reg,"$1$3");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;for(var i=0;i<badContent.length;i++){if(findNoStripTag(badContent[i],noStripTags))
continue;regStr="<\\s*"+badContent[i]+"[^>]*>[\\s\\S]*?<\\s*/\\s*"+badContent[i]+"[^>]*>";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;}
for(var i=0;i<badTag.length;i++){if(findNoStripTag(badTag[i],noStripTags))
continue;regStr="<\\s*[/\?]?\\s*"+badTag[i]+"[^>]*>";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;}
for(var i=0;i<badAction.length;i++){if(findNoStripTag(badAction[i],noStripTags))
continue;regStr="(<[^<]*[\\s'\"])"+badAction[i]+"\\s*=\\s*['\"]?[^\\s'\">]*[\\s'\"]?([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){if(badAction[i]!="allowScriptAccess")
isHarm=true;content=content.replace(reg,"$1$2");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;}
reg=new RegExp("(<\\s*embed)([^>]*>)","ig");if(reg.test(content)){content=content.replace(reg,"$1 allowScriptAccess=\"never\" $2");}
delete reg;for(var i=0;i<badCss.length;i++){if(findNoStripTag(badCss[i],noStripTags))
continue;regStr="(<[^<]*)"+badCss[i]+"\\s*:\\s*[^\\s;\">]*([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"$1$2");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;}
regStr="(<[^<]*)expression\\s*\\([^\\)]*\\)([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"$1$2");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;regStr="(<[^<]*)url\\s*\\([^\\)]*\\.(js|do)\\s*\\)([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"$1$3");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;regStr="(<[^<]*[\\s'\"])src\\s*=\\s*['\"]?.*?\\.(js|do)(>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"$1$3");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;regStr="(<[^<]*[\\s'\"])src\\s*=\\s*['\"]?.*?\\.(js|do)[\\s'\"]([^>]*>)";reg=new RegExp(regStr,"ig");while(reg.test(content)){isHarm=true;content=content.replace(reg,"$1$3");delete reg;reg=new RegExp(regStr,"ig");}
delete reg;var retobj={};retobj.content=content;retobj.isHarm=isHarm;return retobj;}
function findNoStripTag(tag,tags){if(tags==null||tags=="")
return false;for(var i=0;i<tags.length;i++){if(tags[i]==tag)
return true;}
return false;}
var base64EncodeChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var base64DecodeChars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1);function base64encode(str){var out,i,len;var c1,c2,c3;len=str.length;i=0;out="";while(i<len){c1=str.charCodeAt(i++)&0xff;if(i==len)
{out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt((c1&0x3)<<4);out+="==";break;}
c2=str.charCodeAt(i++);if(i==len)
{out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt((c2&0xF)<<2);out+="=";break;}
c3=str.charCodeAt(i++);out+=base64EncodeChars.charAt(c1>>2);out+=base64EncodeChars.charAt(((c1&0x3)<<4)|((c2&0xF0)>>4));out+=base64EncodeChars.charAt(((c2&0xF)<<2)|((c3&0xC0)>>6));out+=base64EncodeChars.charAt(c3&0x3F);}
return out;}
function base64decode(str){var c1,c2,c3,c4;var i,len,out;len=str.length;i=0;out="";while(i<len){do{c1=base64DecodeChars[str.charCodeAt(i++)&0xff];}while(i<len&&c1==-1);if(c1==-1)
break;do{c2=base64DecodeChars[str.charCodeAt(i++)&0xff];}while(i<len&&c2==-1);if(c2==-1)
break;out+=String.fromCharCode((c1<<2)|((c2&0x30)>>4));do{c3=str.charCodeAt(i++)&0xff;if(c3==61)
return out;c3=base64DecodeChars[c3];}while(i<len&&c3==-1);if(c3==-1)
break;out+=String.fromCharCode(((c2&0XF)<<4)|((c3&0x3C)>>2));do{c4=str.charCodeAt(i++)&0xff;if(c4==61)
return out;c4=base64DecodeChars[c4];}while(i<len&&c4==-1);if(c4==-1)
break;out+=String.fromCharCode(((c3&0x03)<<6)|c4);}
return out;}
function utf16to8(str){var out,i,len,c;out="";len=str.length;for(i=0;i<len;i++){c=str.charCodeAt(i);if((c>=0x0001)&&(c<=0x007F)){out+=str.charAt(i);}else if(c>0x07FF){out+=String.fromCharCode(0xE0|((c>>12)&0x0F));out+=String.fromCharCode(0x80|((c>>6)&0x3F));out+=String.fromCharCode(0x80|((c>>0)&0x3F));}else{out+=String.fromCharCode(0xC0|((c>>6)&0x1F));out+=String.fromCharCode(0x80|((c>>0)&0x3F));}}
return out;}
function setHomePageUtil(url){if(document.all){document.body.style.behavior="url(#default#homepage)";document.body.setHomePage(url);}else{alert("浏览器不支持，请手动设置为首页");}
return false;}
function addFavoriteUtil(url,desc,descOther){if(desc==null||desc=="")
desc=descOther;if(document.all&&window.external){window.external.AddFavorite(url,desc+"的网易博客");}else if(window.sidebar){window.sidebar.addPanel(desc+"的网易博客",url,"");}else{alert("浏览器不支持，请手动加入收藏夹");}}
function toDHTML(str){return str.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#039;').replace(/ /g,'&nbsp;').replace(/\n/g,'<br>');}
	var Prototype={Version:'1.4.0',ScriptFragment:'(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',emptyFunction:function(){},K:function(x){return x}}
var Class={create:function(){return function(){this.initialize.apply(this,arguments);}}}
var Abstract=new Object();Object.extend=function(destination,source){for(property in source){destination[property]=source[property];}
return destination;}
Object.inspect=function(object){try{if(object==undefined)return'undefined';if(object==null)return'null';return object.inspect?object.inspect():object.toString();}catch(e){if(e instanceof RangeError)return'...';throw e;}}
Function.prototype.bind=function(){var __method=this,args=$A(arguments),object=args.shift();return function(){return __method.apply(object,args.concat($A(arguments)));}}
Function.prototype.bindAsEventListener=function(object){var __method=this;return function(event){return __method.call(object,event||window.event);}}
Function.prototype.bindEventWithArgs = function(){var __method=this,args=$A(arguments),object=args.shift();return function(event){return __method.apply(object,args.concat($A(arguments)).concat(event||window.event));}}
Object.extend(Number.prototype,{toColorPart:function(){var digits=this.toString(16);if(this<16)return'0'+digits;return digits;},succ:function(){return this+1;},times:function(iterator){$R(0,this,true).each(iterator);return this;}});var Try={these:function(){var returnValue;for(var i=0;i<arguments.length;i++){var lambda=arguments[i];try{returnValue=lambda();break;}catch(e){}}
return returnValue;}}
var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(callback,frequency){this.callback=callback;this.frequency=frequency;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}}
function $(){var elements=new Array();for(var i=0;i<arguments.length;i++){var element=arguments[i];if(typeof element=='string')
element=document.getElementById(element);if(arguments.length==1)
return element;elements.push(element);}
return elements;}
Object.extend(String.prototype,{stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'');},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'');},extractScripts:function(){var matchAll=new RegExp(Prototype.ScriptFragment,'img');var matchOne=new RegExp(Prototype.ScriptFragment,'im');return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||['',''])[1];});},evalScripts:function(){return this.extractScripts().map(eval);},escapeHTML:function(){var div=document.createElement('div');var text=document.createTextNode(this);div.appendChild(text);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement('div');div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:'';},toQueryParams:function(){var pairs=this.match(/^\??(.*)$/)[1].split('&');return pairs.inject({},function(params,pairString){var pair=pairString.split('=');params[pair[0]]=pair[1];return params;});},toArray:function(){return this.split('');},camelize:function(){var oStringList=this.split('-');if(oStringList.length==1)return oStringList[0];var camelizedString=this.indexOf('-')==0?oStringList[0].charAt(0).toUpperCase()+oStringList[0].substring(1):oStringList[0];for(var i=1,len=oStringList.length;i<len;i++){var s=oStringList[i];camelizedString+=s.charAt(0).toUpperCase()+s.substring(1);}
return camelizedString;},inspect:function(){return"'"+this.replace('\\','\\\\').replace("'",'\\\'')+"'";}});String.prototype.parseQuery=String.prototype.toQueryParams;var $break=new Object();var $continue=new Object();var Enumerable={each:function(iterator){var index=0;try{this._each(function(value){try{iterator(value,index++);}catch(e){if(e!=$continue)throw e;}});}catch(e){if(e!=$break)throw e;}},all:function(iterator){var result=true;this.each(function(value,index){result=result&&!!(iterator||Prototype.K)(value,index);if(!result)throw $break;});return result;},any:function(iterator){var result=true;this.each(function(value,index){if(result=!!(iterator||Prototype.K)(value,index))
throw $break;});return result;},collect:function(iterator){var results=[];this.each(function(value,index){results.push(iterator(value,index));});return results;},detect:function(iterator){var result;this.each(function(value,index){if(iterator(value,index)){result=value;throw $break;}});return result;},findAll:function(iterator){var results=[];this.each(function(value,index){if(iterator(value,index))
results.push(value);});return results;},grep:function(pattern,iterator){var results=[];this.each(function(value,index){var stringValue=value.toString();if(stringValue.match(pattern))
results.push((iterator||Prototype.K)(value,index));})
return results;},include:function(object){var found=false;this.each(function(value){if(value==object){found=true;throw $break;}});return found;},inject:function(memo,iterator){this.each(function(value,index){memo=iterator(memo,value,index);});return memo;},invoke:function(method){var args=$A(arguments).slice(1);return this.collect(function(value){return value[method].apply(value,args);});},max:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value>=(result||value))
result=value;});return result;},min:function(iterator){var result;this.each(function(value,index){value=(iterator||Prototype.K)(value,index);if(value<=(result||value))
result=value;});return result;},partition:function(iterator){var trues=[],falses=[];this.each(function(value,index){((iterator||Prototype.K)(value,index)?trues:falses).push(value);});return[trues,falses];},pluck:function(property){var results=[];this.each(function(value,index){results.push(value[property]);});return results;},reject:function(iterator){var results=[];this.each(function(value,index){if(!iterator(value,index))
results.push(value);});return results;},sortBy:function(iterator){return this.collect(function(value,index){return{value:value,criteria:iterator(value,index)};}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0;}).pluck('value');},toArray:function(){return this.collect(Prototype.K);},zip:function(){var iterator=Prototype.K,args=$A(arguments);if(typeof args.last()=='function')
iterator=args.pop();var collections=[this].concat(args).map($A);return this.map(function(value,index){iterator(value=collections.pluck(index));return value;});},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>';}}
Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(iterable){if(!iterable)return[];if(iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0;i<iterable.length;i++)
results.push(iterable[i]);return results;}}
Object.extend(Array.prototype,Enumerable);Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(iterator){for(var i=0;i<this.length;i++)
iterator(this[i]);},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(value){return value!=undefined||value!=null;});},flatten:function(){return this.inject([],function(array,value){return array.concat(value.constructor==Array?value.flatten():[value]);});},without:function(){var values=$A(arguments);return this.select(function(value){return!values.include(value);});},indexOf:function(object){for(var i=0;i<this.length;i++)
if(this[i]==object)return i;return-1;},reverse:function(inline){return(inline!==false?this:this.toArray())._reverse();},shift:function(){var result=this[0];for(var i=0;i<this.length-1;i++)
this[i]=this[i+1];this.length--;return result;},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']';}});var Hash={_each:function(iterator){for(key in this){var value=this[key];if(typeof value=='function')continue;var pair=[key,value];pair.key=key;pair.value=value;iterator(pair);}},keys:function(){return this.pluck('key');},values:function(){return this.pluck('value');},merge:function(hash){return $H(hash).inject($H(this),function(mergedHash,pair){mergedHash[pair.key]=pair.value;return mergedHash;});},toQueryString:function(){return this.map(function(pair){return pair.map(encodeURIComponent).join('=');}).join('&');},inspect:function(){return'#<Hash:{'+this.map(function(pair){return pair.map(Object.inspect).join(': ');}).join(', ')+'}>';}}
function $H(object){var hash=Object.extend({},object||{});Object.extend(hash,Enumerable);Object.extend(hash,Hash);return hash;}
ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(start,end,exclusive){this.start=start;this.end=end;this.exclusive=exclusive;},_each:function(iterator){var value=this.start;do{iterator(value);value=value.succ();}while(this.include(value));},include:function(value){if(value<this.start)
return false;if(this.exclusive)
return value<this.end;return value<=this.end;}});var $R=function(start,end,exclusive){return new ObjectRange(start,end,exclusive);}
var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')},function(){return new XMLHttpRequest()})||false;},activeRequestCount:0}
Ajax.Responders={responders:[],_each:function(iterator){this.responders._each(iterator);},register:function(responderToAdd){if(!this.include(responderToAdd))
this.responders.push(responderToAdd);},unregister:function(responderToRemove){this.responders=this.responders.without(responderToRemove);},dispatch:function(callback,request,transport,json){this.each(function(responder){if(responder[callback]&&typeof responder[callback]=='function'){try{responder[callback].apply(responder,[request,transport,json]);}catch(e){}}});}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++;},onComplete:function(){Ajax.activeRequestCount--;}});Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(options){this.options={method:'post',asynchronous:true,parameters:''}
Object.extend(this.options,options||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return!this.responseIsSuccess();}}
Ajax.Request=Class.create();Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Request.prototype=Object.extend(new Ajax.Base(),{initialize:function(url,options){this.transport=Ajax.getTransport();this.setOptions(options);this.request(url);},request:function(url){var parameters=this.options.parameters||'';if(parameters.length>0)parameters+='&_=';try{this.url=url;if(this.options.method=='get'&&parameters.length>0)
this.url+=(this.url.match(/\?/)?'&':'?')+parameters;Ajax.Responders.dispatch('onCreate',this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1)}).bind(this),10);}
this.setRequestHeaders();var body=this.options.postBody?this.options.postBody:parameters;this.transport.send(this.options.method=='post'?body:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var requestHeaders=['X-Requested-With','XMLHttpRequest','X-Prototype-Version',Prototype.Version];if(this.options.method=='post'){requestHeaders.push('Content-type','application/x-www-form-urlencoded');if(this.transport.overrideMimeType)
requestHeaders.push('Connection','close');}
if(this.options.requestHeaders)
requestHeaders.push.apply(requestHeaders,this.options.requestHeaders);for(var i=0;i<requestHeaders.length;i+=2)
this.transport.setRequestHeader(requestHeaders[i],requestHeaders[i+1]);},onStateChange:function(){var readyState=this.transport.readyState;if(readyState!=1)
this.respondToReadyState(this.transport.readyState);},header:function(name){try{return this.transport.getResponseHeader(name);}catch(e){}},evalJSON:function(){try{return eval(this.header('X-JSON'));}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(readyState){var event=Ajax.Request.Events[readyState];var transport=this.transport,json=this.evalJSON();if(event=='Complete'){try{(this.options['on'+this.transport.status]||this.options['on'+(this.responseIsSuccess()?'Success':'Failure')]||Prototype.emptyFunction)(transport,json);}catch(e){this.dispatchException(e);}
if((this.header('Content-type')||'').match(/^text\/javascript/i))
this.evalResponse();}
try{(this.options['on'+event]||Prototype.emptyFunction)(transport,json);Ajax.Responders.dispatch('on'+event,this,transport,json);}catch(e){this.dispatchException(e);}
if(event=='Complete')
this.transport.onreadystatechange=Prototype.emptyFunction;},dispatchException:function(exception){(this.options.onException||Prototype.emptyFunction)(this,exception);Ajax.Responders.dispatch('onException',this,exception);}});Ajax.Updater=Class.create();Object.extend(Object.extend(Ajax.Updater.prototype,Ajax.Request.prototype),{initialize:function(container,url,options){this.containers={success:container.success?$(container.success):$(container),failure:container.failure?$(container.failure):(container.success?null:$(container))}
this.transport=Ajax.getTransport();this.setOptions(options);var onComplete=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(transport,object){this.updateContent();onComplete(transport,object);}).bind(this);this.request(url);},updateContent:function(){var receiver=this.responseIsSuccess()?this.containers.success:this.containers.failure;var response=this.transport.responseText;if(!this.options.evalScripts)
response=response.stripScripts();if(receiver){if(this.options.insertion){new this.options.insertion(receiver,response);}else{Element.update(receiver,response);}}
if(this.responseIsSuccess()){if(this.onComplete)
setTimeout(this.onComplete.bind(this),10);}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=Object.extend(new Ajax.Base(),{initialize:function(container,url,options){this.setOptions(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(request){if(this.options.decay){this.decay=(request.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=request.responseText;}
this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});document.getElementsByClassName=function(className,parentElement){var children=($(parentElement)||document.body).getElementsByTagName('*');return $A(children).inject([],function(elements,child){if(child.className.match(new RegExp("(^|\\s)"+className+"(\\s|$)")))
elements.push(child);return elements;});}
if(!window.Element){var Element=new Object();}
Object.extend(Element,{visible:function(element){return $(element).style.display!='none';},toggle:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);Element[Element.visible(element)?'hide':'show'](element);}},hide:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display='none';}},show:function(){for(var i=0;i<arguments.length;i++){var element=$(arguments[i]);element.style.display='';}},remove:function(element){element=$(element);element.parentNode.removeChild(element);},update:function(element,html){$(element).innerHTML=html.stripScripts();setTimeout(function(){html.evalScripts()},10);},getHeight:function(element){element=$(element);return element.offsetHeight;},classNames:function(element){return new Element.ClassNames(element);},hasClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).include(className);},addClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).add(className);},removeClassName:function(element,className){if(!(element=$(element)))return;return Element.classNames(element).remove(className);},cleanWhitespace:function(element){element=$(element);for(var i=0;i<element.childNodes.length;i++){var node=element.childNodes[i];if(node.nodeType==3&&!/\S/.test(node.nodeValue))
Element.remove(node);}},empty:function(element){return $(element).innerHTML.match(/^\s*$/);},scrollTo:function(element){element=$(element);var x=element.x?element.x:element.offsetLeft,y=element.y?element.y:element.offsetTop;window.scrollTo(x,y);},getStyle:function(element,style){element=$(element);var value=element.style[style.camelize()];if(!value){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(element,null);value=css?css.getPropertyValue(style):null;}else if(element.currentStyle){value=element.currentStyle[style.camelize()];}}
if(window.opera&&['left','top','right','bottom'].include(style))
if(Element.getStyle(element,'position')=='static')value='auto';return value=='auto'?null:value;},setStyle:function(element,style){element=$(element);for(name in style)
element.style[name.camelize()]=style[name];},getDimensions:function(element){element=$(element);if(Element.getStyle(element,'display')!='none')
return{width:element.offsetWidth,height:element.offsetHeight};var els=element.style;var originalVisibility=els.visibility;var originalPosition=els.position;els.visibility='hidden';els.position='absolute';els.display='';var originalWidth=element.clientWidth;var originalHeight=element.clientHeight;els.display='none';els.position=originalPosition;els.visibility=originalVisibility;return{width:originalWidth,height:originalHeight};},makePositioned:function(element){element=$(element);var pos=Element.getStyle(element,'position');if(pos=='static'||!pos){element._madePositioned=true;element.style.position='relative';if(window.opera){element.style.top=0;element.style.left=0;}}},undoPositioned:function(element){element=$(element);if(element._madePositioned){element._madePositioned=undefined;element.style.position=element.style.top=element.style.left=element.style.bottom=element.style.right='';}},makeClipping:function(element){element=$(element);if(element._overflow)return;element._overflow=element.style.overflow;if((Element.getStyle(element,'overflow')||'visible')!='hidden')
element.style.overflow='hidden';},undoClipping:function(element){element=$(element);if(element._overflow)return;element.style.overflow=element._overflow;element._overflow=undefined;}});var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(adjacency){this.adjacency=adjacency;}
Abstract.Insertion.prototype={initialize:function(element,content){this.element=$(element);this.content=content.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(e){if(this.element.tagName.toLowerCase()=='tbody'){this.insertContent(this.contentFromAnonymousTable());}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange)this.initializeRange();this.insertContent([this.range.createContextualFragment(this.content)]);}
setTimeout(function(){content.evalScripts()},10);},contentFromAnonymousTable:function(){var div=document.createElement('div');div.innerHTML='<table><tbody>'+this.content+'</tbody></table>';return $A(div.childNodes[0].childNodes[0].childNodes);}}
var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion('beforeBegin'),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion('afterBegin'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(fragments){fragments.reverse(false).each((function(fragment){this.element.insertBefore(fragment,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion('beforeEnd'),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.appendChild(fragment);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion('afterEnd'),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(fragments){fragments.each((function(fragment){this.element.parentNode.insertBefore(fragment,this.element.nextSibling);}).bind(this));}});Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(element){this.element=$(element);},_each:function(iterator){this.element.className.split(/\s+/).select(function(name){return name.length>0;})._each(iterator);},set:function(className){this.element.className=className;},add:function(classNameToAdd){if(this.include(classNameToAdd))return;this.set(this.toArray().concat(classNameToAdd).join(' '));},remove:function(classNameToRemove){if(!this.include(classNameToRemove))return;this.set(this.select(function(className){return className!=classNameToRemove;}).join(' '));},toString:function(){return this.toArray().join(' ');}}
Object.extend(Element.ClassNames.prototype,Enumerable);var Field={clear:function(){for(var i=0;i<arguments.length;i++)
$(arguments[i]).value='';},focus:function(element){$(element).focus();},present:function(){for(var i=0;i<arguments.length;i++)
if($(arguments[i]).value=='')return false;return true;},select:function(element){$(element).select();},activate:function(element){element=$(element);element.focus();if(element.select)
element.select();}}
var Form={serialize:function(form){var elements=Form.getElements($(form));var queryComponents=new Array();for(var i=0;i<elements.length;i++){var queryComponent=Form.Element.serialize(elements[i]);if(queryComponent)
queryComponents.push(queryComponent);}
return queryComponents.join('&');},getElements:function(form){form=$(form);var elements=new Array();for(tagName in Form.Element.Serializers){var tagElements=form.getElementsByTagName(tagName);for(var j=0;j<tagElements.length;j++)
elements.push(tagElements[j]);}
return elements;},getInputs:function(form,typeName,name){form=$(form);var inputs=form.getElementsByTagName('input');if(!typeName&&!name)
return inputs;var matchingInputs=new Array();for(var i=0;i<inputs.length;i++){var input=inputs[i];if((typeName&&input.type!=typeName)||(name&&input.name!=name))
continue;matchingInputs.push(input);}
return matchingInputs;},disable:function(form){var elements=Form.getElements(form);for(var i=0;i<elements.length;i++){var element=elements[i];element.blur();element.disabled='true';}},enable:function(form){var elements=Form.getElements(form);for(var i=0;i<elements.length;i++){var element=elements[i];element.disabled='';}},findFirstElement:function(form){return Form.getElements(form).find(function(element){return element.type!='hidden'&&!element.disabled&&['input','select','textarea'].include(element.tagName.toLowerCase());});},focusFirstElement:function(form){Field.activate(Form.findFirstElement(form));},reset:function(form){$(form).reset();}}
Form.Element={serialize:function(element){element=$(element);var method=element.tagName.toLowerCase();var parameter=Form.Element.Serializers[method](element);if(parameter){var key=encodeURIComponent(parameter[0]);if(key.length==0)return;if(parameter[1].constructor!=Array)
parameter[1]=[parameter[1]];return parameter[1].map(function(value){return key+'='+encodeURIComponent(value);}).join('&');}},getValue:function(element){element=$(element);var method=element.tagName.toLowerCase();var parameter=Form.Element.Serializers[method](element);if(parameter)
return parameter[1];}}
Form.Element.Serializers={input:function(element){switch(element.type.toLowerCase()){case'submit':case'hidden':case'password':case'text':return Form.Element.Serializers.textarea(element);case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(element);}
return false;},inputSelector:function(element){if(element.checked)
return[element.name,element.value];},textarea:function(element){return[element.name,element.value];},select:function(element){return Form.Element.Serializers[element.type=='select-one'?'selectOne':'selectMany'](element);},selectOne:function(element){var value='',opt,index=element.selectedIndex;if(index>=0){opt=element.options[index];value=opt.value;if(!value&&!('value'in opt))
value=opt.text;}
return[element.name,value];},selectMany:function(element){var value=new Array();for(var i=0;i<element.length;i++){var opt=element.options[i];if(opt.selected){var optValue=opt.value;if(!optValue&&!('value'in opt))
optValue=opt.text;value.push(optValue);}}
return[element.name,value];}}
var $F=Form.Element.getValue;Abstract.TimedObserver=function(){}
Abstract.TimedObserver.prototype={initialize:function(element,frequency,callback){this.frequency=frequency;this.element=$(element);this.callback=callback;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}}}
Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){}
Abstract.EventObserver.prototype={initialize:function(element,callback){this.element=$(element);this.callback=callback;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')
this.registerFormCallbacks();else
this.registerCallback(this.element);},onElementEvent:function(){var value=this.getValue();if(this.lastValue!=value){this.callback(this.element,value);this.lastValue=value;}},registerFormCallbacks:function(){var elements=Form.getElements(this.element);for(var i=0;i<elements.length;i++)
this.registerCallback(elements[i]);},registerCallback:function(element){if(element.type){switch(element.type.toLowerCase()){case'checkbox':case'radio':Event.observe(element,'click',this.onElementEvent.bind(this));break;case'password':case'text':case'textarea':case'select-one':case'select-multiple':Event.observe(element,'change',this.onElementEvent.bind(this));break;}}}}
Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=Object.extend(new Abstract.EventObserver(),{getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}
Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(event){return event.target||event.srcElement;},isLeftClick:function(event){return(((event.which)&&(event.which==1))||((event.button)&&(event.button==1)));},pointerX:function(event){return event.pageX||(event.clientX+
(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(event){return event.pageY||(event.clientY+
(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}},findElement:function(event,tagName){var element=Event.element(event);while(element.parentNode&&(!element.tagName||(element.tagName.toUpperCase()!=tagName.toUpperCase())))
element=element.parentNode;return element;},observers:false,_observeAndCache:function(element,name,observer,useCapture){if(!this.observers)this.observers=[];if(element.addEventListener){this.observers.push([element,name,observer,useCapture]);element.addEventListener(name,observer,useCapture);}else if(element.attachEvent){this.observers.push([element,name,observer,useCapture]);element.attachEvent('on'+name,observer);}},unloadCache:function(){if(!Event.observers)return;for(var i=0;i<Event.observers.length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}
Event.observers=false;},observe:function(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.attachEvent))
name='keydown';this._observeAndCache(element,name,observer,useCapture);},stopObserving:function(element,name,observer,useCapture){var element=$(element);useCapture=useCapture||false;if(name=='keypress'&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||element.detachEvent))
name='keydown';if(element.removeEventListener){element.removeEventListener(name,observer,useCapture);}else if(element.detachEvent){element.detachEvent('on'+name,observer);}}});Event.observe(window,'unload',Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.scrollTop||0;valueL+=element.scrollLeft||0;element=element.parentNode;}while(element);return[valueL,valueT];},cumulativeOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;}while(element);return[valueL,valueT];},positionedOffset:function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;element=element.offsetParent;if(element){p=Element.getStyle(element,'position');if(p=='relative'||p=='absolute')break;}}while(element);return[valueL,valueT];},offsetParent:function(element){if(element.offsetParent)return element.offsetParent;if(element==document.body)return element;while((element=element.parentNode)&&element!=document.body)
if(Element.getStyle(element,'position')!='static')
return element;return document.body;},within:function(element,x,y){if(this.includeScrollOffsets)
return this.withinIncludingScrolloffsets(element,x,y);this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(element);return(y>=this.offset[1]&&y<this.offset[1]+element.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+element.offsetWidth);},withinIncludingScrolloffsets:function(element,x,y){var offsetcache=this.realOffset(element);this.xcomp=x+offsetcache[0]-this.deltaX;this.ycomp=y+offsetcache[1]-this.deltaY;this.offset=this.cumulativeOffset(element);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+element.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+element.offsetWidth);},overlap:function(mode,element){if(!mode)return 0;if(mode=='vertical')
return((this.offset[1]+element.offsetHeight)-this.ycomp)/element.offsetHeight;if(mode=='horizontal')
return((this.offset[0]+element.offsetWidth)-this.xcomp)/element.offsetWidth;},clone:function(source,target){source=$(source);target=$(target);target.style.position='absolute';var offsets=this.cumulativeOffset(source);target.style.top=offsets[1]+'px';target.style.left=offsets[0]+'px';target.style.width=source.offsetWidth+'px';target.style.height=source.offsetHeight+'px';},page:function(forElement){var valueT=0,valueL=0;var element=forElement;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;}while(element=element.offsetParent);element=forElement;do{valueT-=element.scrollTop||0;valueL-=element.scrollLeft||0;}while(element=element.parentNode);return[valueL,valueT];},clone:function(source,target){var options=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{})
source=$(source);var p=Position.page(source);target=$(target);var delta=[0,0];var parent=null;if(Element.getStyle(target,'position')=='absolute'){parent=Position.offsetParent(target);delta=Position.page(parent);}
if(parent==document.body){delta[0]-=document.body.offsetLeft;delta[1]-=document.body.offsetTop;}
if(options.setLeft)target.style.left=(p[0]-delta[0]+options.offsetLeft)+'px';if(options.setTop)target.style.top=(p[1]-delta[1]+options.offsetTop)+'px';if(options.setWidth)target.style.width=source.offsetWidth+'px';if(options.setHeight)target.style.height=source.offsetHeight+'px';},absolutize:function(element){element=$(element);if(element.style.position=='absolute')return;Position.prepare();var offsets=Position.positionedOffset(element);var top=offsets[1];var left=offsets[0];var width=element.clientWidth;var height=element.clientHeight;element._originalLeft=left-parseFloat(element.style.left||0);element._originalTop=top-parseFloat(element.style.top||0);element._originalWidth=element.style.width;element._originalHeight=element.style.height;element.style.position='absolute';element.style.top=top+'px';;element.style.left=left+'px';;element.style.width=width+'px';;element.style.height=height+'px';;},relativize:function(element){element=$(element);if(element.style.position=='relative')return;Position.prepare();element.style.position='relative';var top=parseFloat(element.style.top||0)-(element._originalTop||0);var left=parseFloat(element.style.left||0)-(element._originalLeft||0);element.style.top=top+'px';element.style.left=left+'px';element.style.height=element._originalHeight;element.style.width=element._originalWidth;}}
if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(element){var valueT=0,valueL=0;do{valueT+=element.offsetTop||0;valueL+=element.offsetLeft||0;if(element.offsetParent==document.body)
if(Element.getStyle(element,'position')=='absolute')break;element=element.offsetParent;}while(element);return[valueL,valueT];}}
Element.getOpacity=function(element){var opacity;if(opacity=Element.getStyle(element,"opacity"))
return parseFloat(opacity);if(opacity=(Element.getStyle(element,"filter")||'').match(/alpha\(opacity=(.*)\)/))
if(opacity[1])return parseFloat(opacity[1])/100;return 1.0;}
Element.setOpacity=function(element,value){element=$(element);var els=element.style;if(value==1){els.opacity='0.999999';if(/MSIE/.test(navigator.userAgent))
els.filter=Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')+"alpha(opacity=100)";}else{if(value<0.00001)value=0;els.opacity=value;if(/MSIE/.test(navigator.userAgent))
els.filter=Element.getStyle(element,'filter').replace(/alpha\([^\)]*\)/gi,'')+"alpha(opacity="+value*100+")";}}
Element.getInlineOpacity=function(element){element=$(element);var op;op=element.style.opacity;if(typeof op!="undefined"&&op!="")return op;return"";}
Element.setInlineOpacity=function(element,value){element=$(element);var els=element.style;els.opacity=value;}
Element.setStyle=function(element,style){element=$(element);for(k in style)element.style[k.camelize()]=style[k];}
Element.childrenWithClassName=function(element,className){return $A($(element).getElementsByTagName('*')).select(function(c){return Element.hasClassName(c,className)});}
var Effect={tagifyText:function(element){var tagifyStyle="position:relative";if(/MSIE/.test(navigator.userAgent))tagifyStyle+=";zoom:1";element=$(element);$A(element.childNodes).each(function(child){if(child.nodeType==3){child.nodeValue.toArray().each(function(character){element.insertBefore(Builder.node('span',{style:tagifyStyle},character==" "?String.fromCharCode(160):character),child);});Element.remove(child);}});},multiple:function(element,effect){var elements;if(((typeof element=='object')||(typeof element=='function'))&&(element.length))
elements=element;else
elements=$(element).childNodes;var options=Object.extend({speed:0.1,delay:0.0},arguments[2]||{});var speed=options.speed;var delay=options.delay;$A(elements).each(function(element,index){new effect(element,Object.extend(options,{delay:delay+index*speed}));});}};var Effect2=Effect;Effect.Transitions={}
Effect.Transitions.linear=function(pos){return pos;}
Effect.Transitions.sinoidal=function(pos){return(-Math.cos(pos*Math.PI)/2)+0.5;}
Effect.Transitions.reverse=function(pos){return 1-pos;}
Effect.Transitions.flicker=function(pos){return((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;}
Effect.Transitions.wobble=function(pos){return(-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;}
Effect.Transitions.pulse=function(pos){return(Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));}
Effect.Transitions.none=function(pos){return 0;}
Effect.Transitions.full=function(pos){return 1;}
Effect.Queue={effects:[],_each:function(iterator){this.effects._each(iterator);},interval:null,add:function(effect){var timestamp=new Date().getTime();switch(effect.options.queue){case'front':this.effects.findAll(function(e){return e.state=='idle'}).each(function(e){e.startOn+=effect.finishOn;e.finishOn+=effect.finishOn;});break;case'end':timestamp=this.effects.pluck('finishOn').max()||timestamp;break;}
effect.startOn+=timestamp;effect.finishOn+=timestamp;this.effects.push(effect);if(!this.interval)
this.interval=setInterval(this.loop.bind(this),40);},remove:function(effect){this.effects=this.effects.reject(function(e){return e==effect});if(this.effects.length==0){clearInterval(this.interval);this.interval=null;}},loop:function(){var timePos=new Date().getTime();this.effects.invoke('loop',timePos);}}
Object.extend(Effect.Queue,Enumerable);Effect.Base=function(){};Effect.Base.prototype={position:null,setOptions:function(options){this.options=Object.extend({transition:Effect.Transitions.sinoidal,duration:1.0,fps:25.0,sync:false,from:0.0,to:1.0,delay:0.0,queue:'parallel'},options||{});},start:function(options){this.setOptions(options||{});this.currentFrame=0;this.state='idle';this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.event('beforeStart');var bAdd=true;if(this.options.stateId){bAdd=this.startState();if(typeof this.options.succObj=="object")
this.options.succObj.success=bAdd;}
if(!this.options.sync&&bAdd)Effect.Queue.add(this);},loop:function(timePos){if(timePos>=this.startOn){if(timePos>=this.finishOn){this.render(1.0);this.cancel();this.event('beforeFinish');if(this.finish)this.finish();this.event('afterFinish');if(this.options.stateId)this.finishState();if(this.options.userCallBack)this.options.userCallBack();return;}
var pos=(timePos-this.startOn)/(this.finishOn-this.startOn);var frame=Math.round(pos*this.options.fps*this.options.duration);if(frame>this.currentFrame){this.render(pos);this.currentFrame=frame;}}},render:function(pos){if(this.state=='idle'){this.state='running';this.event('beforeSetup');if(this.setup)this.setup();this.event('afterSetup');}
if(this.options.transition)pos=this.options.transition(pos);pos*=(this.options.to-this.options.from);pos+=this.options.from;this.position=pos;this.event('beforeUpdate');if(this.update)this.update(pos);this.event('afterUpdate');},cancel:function(){if(!this.options.sync)Effect.Queue.remove(this);this.state='finished';},event:function(eventName){if(this.options[eventName+'Internal'])this.options[eventName+'Internal'](this);if(this.options[eventName])this.options[eventName](this);},startState:function(){if(!this.element._state){this.element._state="running";return true;}
else if(this.element._state=="running")
return false;else{this.element._state="running";return true;}},finishState:function(){this.element._state="finished";}}
Effect.Opacity=Class.create();Object.extend(Object.extend(Effect.Opacity.prototype,Effect.Base.prototype),{initialize:function(element){this.element=$(element);if(/MSIE/.test(navigator.userAgent)&&(!this.element.hasLayout))
this.element.style.zoom=1;var options=Object.extend({from:Element.getOpacity(this.element)||0.0,to:1.0},arguments[1]||{});this.start(options);},update:function(position){Element.setOpacity(this.element,position);}});Effect.Move=Class.create();Object.extend(Object.extend(Effect.Move.prototype,Effect.Base.prototype),{initialize:function(element){this.element=$(element);var options=Object.extend({x:0,y:0,mode:'relative'},arguments[1]||{});this.start(options);},setup:function(){Element.makePositioned(this.element);this.originalLeft=parseFloat(Element.getStyle(this.element,'left')||'0');this.originalTop=parseFloat(Element.getStyle(this.element,'top')||'0');if(this.options.mode=='absolute'){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop;}},update:function(position){Element.setStyle(this.element,{left:this.options.x*position+this.originalLeft+'px',top:this.options.y*position+this.originalTop+'px'});}});Effect.MoveBy=Class.create();Object.extend(Object.extend(Effect.MoveBy.prototype,Effect.Base.prototype),{initialize:function(element,toTop,toLeft){this.element=$(element);this.toTop=toTop;this.toLeft=toLeft;this.start(arguments[3]);},setup:function(){Element.makePositioned(this.element);this.originalTop=parseFloat(Element.getStyle(this.element,'top')||'0');this.originalLeft=parseFloat(Element.getStyle(this.element,'left')||'0');},update:function(position){var topd=this.toTop*position+this.originalTop;var leftd=this.toLeft*position+this.originalLeft;this.setPosition(topd,leftd);},setPosition:function(topd,leftd){this.element.style.top=topd+"px";this.element.style.left=leftd+"px";}});Effect.Scale=Class.create();Object.extend(Object.extend(Effect.Scale.prototype,Effect.Base.prototype),{initialize:function(element,percent){this.element=$(element)
var options=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:'box',scaleFrom:100.0,scaleTo:percent},arguments[2]||{});this.start(options);},setup:function(){var effect=this;this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=Element.getStyle(this.element,'position');effect.originalStyle={};['top','left','width','height','fontSize'].each(function(k){effect.originalStyle[k]=effect.element.style[k];});this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var fontSize=Element.getStyle(this.element,'font-size')||"100%";['em','px','%'].each(function(fontSizeType){if(fontSize.indexOf(fontSizeType)>0){effect.fontSize=parseFloat(fontSize);effect.fontSizeType=fontSizeType;}});this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=='box'){if(/MSIE/.test(navigator.userAgent)){var width=(this.element.clientWidth=="")?this.element.scrollHeight:this.element.clientWidth;var height=(this.element.clientHeight=="")?this.element.scrollHeight:this.element.clientHeight;this.dims=[height,width];}
else
this.dims=[this.element.clientHeight,this.element.clientWidth];}
if(/^content/.test(this.options.scaleMode))
this.dims=[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)
this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth];},update:function(position){var currentScale=(this.options.scaleFrom/100.0)+(this.factor*position);if(this.options.scaleContent&&this.fontSize)
this.element.style.fontSize=this.fontSize*currentScale+this.fontSizeType;this.setDimensions(this.dims[0]*currentScale,this.dims[1]*currentScale);},finish:function(position){if(this.restoreAfterFinish){var effect=this;['top','left','width','height','fontSize'].each(function(k){effect.element.style[k]=effect.originalStyle[k];});}},setDimensions:function(height,width){var els=this.element.style;if(this.options.scaleX)els.width=width+'px';if(this.options.scaleY){if(/MSIE/.test(navigator.userAgent))
if(height<1)height=1;els.height=height+'px';}
if(this.options.scaleFromCenter){var topd=(height-this.dims[0])/2;var leftd=(width-this.dims[1])/2;if(this.elementPositioning=='absolute'){if(this.options.scaleY)els.top=this.originalTop-topd+"px";if(this.options.scaleX)els.left=this.originalLeft-leftd+"px";}else{if(this.options.scaleY)els.top=-topd+"px";if(this.options.scaleX)els.left=-leftd+"px";}}}});Effect.ScrollTo=Class.create();Object.extend(Object.extend(Effect.ScrollTo.prototype,Effect.Base.prototype),{initialize:function(element){this.element=$(element);this.start(arguments[1]||{});},setup:function(){Position.prepare();var offsets=Position.cumulativeOffset(this.element);var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-
(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(offsets[1]>max?max:offsets[1])-this.scrollStart;},update:function(position){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(position*this.delta));}});Effect.Fade=function(element){var oldOpacity=Element.getInlineOpacity(element);var options=Object.extend({from:Element.getOpacity(element)||1.0,to:0.0,afterFinishInternal:function(effect)
{if(effect.options.to==0){Element.hide(effect.element);Element.setInlineOpacity(effect.element,oldOpacity);}}},arguments[1]||{});return new Effect.Opacity(element,options);}
Effect.Appear=function(element){var options=Object.extend({from:(Element.getStyle(element,"display")=="none"?0.0:Element.getOpacity(element)||0.0),to:1.0,beforeSetup:function(effect){Element.setOpacity(effect.element,effect.options.from);Element.show(effect.element);}},arguments[1]||{});return new Effect.Opacity(element,options);}
Effect.BlindUp=function(element){element=$(element);Element.makeClipping(element);return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(effect)
{Element.hide(effect.element);Element.undoClipping(effect.element);}},arguments[1]||{}));}
Effect.BlindDown=function(element){element=$(element);var oldHeight=element.style.height;var elementDimensions=Element.getDimensions(element);return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){Element.makeClipping(effect.element);if(/MSIE/.test(navigator.userAgent))
effect.element.style.height="1px";else
effect.element.style.height="0px";Element.show(effect.element);},afterFinishInternal:function(effect){Element.undoClipping(effect.element);effect.element.style.height=oldHeight;}},arguments[1]||{}));}
Effect.SlideDown=function(element){element=$(element);Element.cleanWhitespace(element);var oldInnerBottom=element.firstChild.style.bottom;var elementDimensions=Element.getDimensions(element);return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){Element.makePositioned(effect.element.firstChild);if(window.opera)effect.element.firstChild.style.top="";Element.makeClipping(effect.element);element.style.height='0';Element.show(element);},afterUpdateInternal:function(effect){effect.element.firstChild.style.bottom=(effect.dims[0]-effect.element.clientHeight)+'px';},afterFinishInternal:function(effect){Element.undoClipping(effect.element);Element.undoPositioned(effect.element.firstChild);effect.element.firstChild.style.bottom=oldInnerBottom;}},arguments[1]||{}));}
Effect.SlideUp=function(element){element=$(element);Element.cleanWhitespace(element);var oldInnerBottom=element.firstChild.style.bottom;return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleX:false,scaleMode:'box',scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(effect){Element.makePositioned(effect.element.firstChild);if(window.opera)effect.element.firstChild.style.top="";Element.makeClipping(effect.element);Element.show(element);},afterUpdateInternal:function(effect){effect.element.firstChild.style.bottom=(effect.dims[0]-effect.element.clientHeight)+'px';},afterFinishInternal:function(effect){Element.hide(effect.element);Element.undoClipping(effect.element);Element.undoPositioned(effect.element.firstChild);effect.element.firstChild.style.bottom=oldInnerBottom;}},arguments[1]||{}));}
Effect.SlideRight=function(element){element=$(element);Element.cleanWhitespace(element);var oldInnerRight=element.firstChild.style.right;var elementDimensions=Element.getDimensions(element);return new Effect.Scale(element,100,Object.extend({scaleContent:false,scaleY:false,scaleFrom:0,scaleMode:{originalHeight:elementDimensions.height,originalWidth:elementDimensions.width},restoreAfterFinish:true,afterSetup:function(effect){Element.makePositioned(effect.element.firstChild);if(window.opera)effect.element.firstChild.style.top="";Element.makeClipping(effect.element);Element.show(element);},afterUpdateInternal:function(effect){effect.element.firstChild.style.right=(effect.dims[1]-effect.element.clientWidth)+'px';},afterFinishInternal:function(effect){Element.undoClipping(effect.element);Element.undoPositioned(effect.element.firstChild);effect.element.firstChild.style.right=oldInnerRight;}},arguments[1]||{}));}
Effect.SlideLeft=function(element){element=$(element);Element.cleanWhitespace(element);var oldInnerRight=element.firstChild.style.right;return new Effect.Scale(element,0,Object.extend({scaleContent:false,scaleY:false,scaleMode:'box',scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(effect){Element.makePositioned(effect.element.firstChild);if(window.opera)effect.element.firstChild.style.top="";Element.makeClipping(effect.element);Element.show(element);},afterUpdateInternal:function(effect){effect.element.firstChild.style.right=(effect.dims[1]-effect.element.clientWidth)+'px';},afterFinishInternal:function(effect){Element.hide(effect.element);Element.undoClipping(effect.element);Element.undoPositioned(effect.element.firstChild);effect.element.firstChild.style.right=oldInnerRight;}},arguments[1]||{}));}



if(dwr==null)var dwr={};if(dwr.engine==null)dwr.engine={};if(DWREngine==null)var DWREngine=dwr.engine;dwr.engine.setErrorHandler=function(handler){dwr.engine._errorHandler=handler;};dwr.engine.setWarningHandler=function(handler){dwr.engine._warningHandler=handler;};dwr.engine.setTextHtmlHandler=function(handler){dwr.engine._textHtmlHandler=handler;}
dwr.engine.setTimeout=function(timeout){dwr.engine._timeout=timeout;};dwr.engine.setPreHook=function(handler){dwr.engine._preHook=handler;};dwr.engine.setPostHook=function(handler){dwr.engine._postHook=handler;};dwr.engine.setHeaders=function(headers){dwr.engine._headers=headers;};dwr.engine.setParameters=function(parameters){dwr.engine._parameters=parameters;};dwr.engine.XMLHttpRequest=1;dwr.engine.IFrame=2;dwr.engine.ScriptTag=3;dwr.engine.setRpcType=function(newType){if(newType!=dwr.engine.XMLHttpRequest&&newType!=dwr.engine.IFrame&&newType!=dwr.engine.ScriptTag){dwr.engine._handleError(null,{name:"dwr.engine.invalidRpcType",message:"RpcType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame or dwr.engine.ScriptTag"});return;}
dwr.engine._rpcType=newType;};dwr.engine.setHttpMethod=function(httpMethod){if(httpMethod!="GET"&&httpMethod!="POST"){dwr.engine._handleError(null,{name:"dwr.engine.invalidHttpMethod",message:"Remoting method must be one of GET or POST"});return;}
dwr.engine._httpMethod=httpMethod;};dwr.engine.setOrdered=function(ordered){dwr.engine._ordered=ordered;};dwr.engine.setAsync=function(async){dwr.engine._async=async;};dwr.engine.setActiveReverseAjax=function(activeReverseAjax){if(activeReverseAjax){if(dwr.engine._activeReverseAjax)return;dwr.engine._activeReverseAjax=true;dwr.engine._poll();}
else{if(dwr.engine._activeReverseAjax&&dwr.engine._pollReq)dwr.engine._pollReq.abort();dwr.engine._activeReverseAjax=false;}};dwr.engine.setPollType=function(newPollType){if(newPollType!=dwr.engine.XMLHttpRequest&&newPollType!=dwr.engine.IFrame){dwr.engine._handleError(null,{name:"dwr.engine.invalidPollType",message:"PollType must be one of dwr.engine.XMLHttpRequest or dwr.engine.IFrame"});return;}
dwr.engine._pollType=newPollType;};dwr.engine.defaultErrorHandler=function(message,ex){dwr.engine._debug("Error: "+ex.name+", "+ex.message,true);if(message==null||message=="")alert("A server error has occured. More information may be available in the console.");else if(message.indexOf("0x80040111")!=-1)dwr.engine._debug(message);else {};};dwr.engine.defaultWarningHandler=function(message,ex){dwr.engine._debug(message);};dwr.engine.beginBatch=function(){if(dwr.engine._batch){dwr.engine._handleError(null,{name:"dwr.engine.batchBegun",message:"Batch already begun"});return;}
dwr.engine._batch=dwr.engine._createBatch();};dwr.engine.endBatch=function(options){var batch=dwr.engine._batch;if(batch==null){dwr.engine._handleError(null,{name:"dwr.engine.batchNotBegun",message:"No batch in progress"});return;}
dwr.engine._batch=null;if(batch.map.callCount==0)return;if(options)dwr.engine._mergeBatch(batch,options);if(dwr.engine._ordered&&dwr.engine._batchesLength!=0){dwr.engine._batchQueue[dwr.engine._batchQueue.length]=batch;}
else{dwr.engine._sendData(batch);}};dwr.engine.setPollMethod=function(type){dwr.engine.setPollType(type);};dwr.engine.setMethod=function(type){dwr.engine.setRpcType(type);};dwr.engine.setVerb=function(verb){dwr.engine.setHttpMethod(verb);};dwr.engine._origScriptSessionId="4FC528EBDD341FE22046F074D587F373";dwr.engine._sessionCookieName="JSESSIONID";dwr.engine._allowGetForSafariButMakeForgeryEasier="false";dwr.engine._scriptTagProtection="throw 'allowScriptTagRemoting is false.';";dwr.engine._defaultPath="/dwr";dwr.engine._scriptSessionId=null;dwr.engine._getScriptSessionId=function(){if(dwr.engine._scriptSessionId==null){dwr.engine._scriptSessionId=dwr.engine._origScriptSessionId+Math.floor(Math.random()*1000);}
return dwr.engine._scriptSessionId;};dwr.engine._errorHandler=dwr.engine.defaultErrorHandler;dwr.engine._warningHandler=dwr.engine.defaultWarningHandler;dwr.engine._preHook=null;dwr.engine._postHook=null;dwr.engine._batches={};dwr.engine._batchesLength=0;dwr.engine._batchQueue=[];dwr.engine._rpcType=dwr.engine.XMLHttpRequest;dwr.engine._httpMethod="POST";dwr.engine._ordered=false;dwr.engine._async=true;dwr.engine._batch=null;dwr.engine._timeout=0;dwr.engine._DOMDocument=["Msxml2.DOMDocument.6.0","Msxml2.DOMDocument.5.0","Msxml2.DOMDocument.4.0","Msxml2.DOMDocument.3.0","MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];dwr.engine._XMLHTTP=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"];dwr.engine._activeReverseAjax=false;dwr.engine._pollType=dwr.engine.XMLHttpRequest;dwr.engine._outstandingIFrames=[];dwr.engine._pollReq=null;dwr.engine._pollCometInterval=200;dwr.engine._pollRetries=0;dwr.engine._maxPollRetries=0;dwr.engine._textHtmlHandler=null;dwr.engine._headers=null;dwr.engine._parameters=null;dwr.engine._postSeperator="\n";dwr.engine._defaultInterceptor=function(data){return data;}
dwr.engine._urlRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._contentRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._replyRewriteHandler=dwr.engine._defaultInterceptor;dwr.engine._nextBatchId=0;dwr.engine._propnames=["rpcType","httpMethod","async","timeout","errorHandler","warningHandler","textHtmlHandler"];dwr.engine._partialResponseNo=0;dwr.engine._partialResponseYes=1;dwr.engine._partialResponseFlush=2;dwr.engine._execute=function(path,scriptName,methodName,vararg_params){var singleShot=false;if(dwr.engine._batch==null){dwr.engine.beginBatch();singleShot=true;}
var batch=dwr.engine._batch;var args=[];for(var i=0;i<arguments.length-3;i++){args[i]=arguments[i+3];}
if(batch.path==null){batch.path=path;}
else{if(batch.path!=path){dwr.engine._handleError(batch,{name:"dwr.engine.multipleServlets",message:"Can't batch requests to multiple DWR Servlets."});return;}}
var callData;var lastArg=args[args.length-1];if(typeof lastArg=="function"||lastArg==null)callData={callback:args.pop()};else callData=args.pop();dwr.engine._mergeBatch(batch,callData);batch.handlers[batch.map.callCount]={exceptionHandler:callData.exceptionHandler,callback:callData.callback};var prefix="c"+batch.map.callCount+"-";batch.map[prefix+"scriptName"]=scriptName;batch.map[prefix+"methodName"]=methodName;batch.map[prefix+"id"]=batch.map.callCount;for(i=0;i<args.length;i++){dwr.engine._serializeAll(batch,[],args[i],prefix+"param"+i);}
batch.map.callCount++;if(singleShot)dwr.engine.endBatch();};dwr.engine._poll=function(overridePath){if(!dwr.engine._activeReverseAjax)return;var batch=dwr.engine._createBatch();batch.map.id=0;batch.map.callCount=1;batch.isPoll=true;if(navigator.userAgent.indexOf("Gecko/")!=-1){batch.rpcType=dwr.engine._pollType;batch.map.partialResponse=dwr.engine._partialResponseYes;}
else if(document.all){batch.rpcType=dwr.engine.IFrame;batch.map.partialResponse=dwr.engine._partialResponseFlush;}
else{batch.rpcType=dwr.engine._pollType;batch.map.partialResponse=dwr.engine._partialResponseNo;}
batch.httpMethod="POST";batch.async=true;batch.timeout=0;batch.path=(overridePath)?overridePath:dwr.engine._defaultPath;batch.preHooks=[];batch.postHooks=[];batch.errorHandler=dwr.engine._pollErrorHandler;batch.warningHandler=dwr.engine._pollErrorHandler;batch.handlers[0]={callback:function(pause){dwr.engine._pollRetries=0;setTimeout("dwr.engine._poll()",pause);}};dwr.engine._sendData(batch);if(batch.rpcType==dwr.engine.XMLHttpRequest){dwr.engine._checkCometPoll();}};dwr.engine._pollErrorHandler=function(msg,ex){dwr.engine._pollRetries++;dwr.engine._debug("Reverse Ajax poll failed (pollRetries="+dwr.engine._pollRetries+"): "+ex.name+" : "+ex.message);if(dwr.engine._pollRetries<dwr.engine._maxPollRetries){setTimeout("dwr.engine._poll()",10000);}
else{dwr.engine._debug("Giving up.");}};dwr.engine._createBatch=function(){var batch={map:{callCount:0,page:window.location.pathname+window.location.search,httpSessionId:dwr.engine._getJSessionId(),scriptSessionId:dwr.engine._getScriptSessionId()},charsProcessed:0,paramCount:0,headers:[],parameters:[],isPoll:false,headers:{},handlers:{},preHooks:[],postHooks:[],rpcType:dwr.engine._rpcType,httpMethod:dwr.engine._httpMethod,async:dwr.engine._async,timeout:dwr.engine._timeout,errorHandler:dwr.engine._errorHandler,warningHandler:dwr.engine._warningHandler,textHtmlHandler:dwr.engine._textHtmlHandler};if(dwr.engine._preHook)batch.preHooks.push(dwr.engine._preHook);if(dwr.engine._postHook)batch.postHooks.push(dwr.engine._postHook);var propname,data;if(dwr.engine._headers){for(propname in dwr.engine._headers){data=dwr.engine._headers[propname];if(typeof data!="function")batch.headers[propname]=data;}}
if(dwr.engine._parameters){for(propname in dwr.engine._parameters){data=dwr.engine._parameters[propname];if(typeof data!="function")batch.parameters[propname]=data;}}
return batch;}
dwr.engine._mergeBatch=function(batch,overrides){var propname,data;for(var i=0;i<dwr.engine._propnames.length;i++){propname=dwr.engine._propnames[i];if(overrides[propname]!=null)batch[propname]=overrides[propname];}
if(overrides.preHook!=null)batch.preHooks.unshift(overrides.preHook);if(overrides.postHook!=null)batch.postHooks.push(overrides.postHook);if(overrides.headers){for(propname in overrides.headers){data=overrides.headers[propname];if(typeof data!="function")batch.headers[propname]=data;}}
if(overrides.parameters){for(propname in overrides.parameters){data=overrides.parameters[propname];if(typeof data!="function")batch.map["p-"+propname]=""+data;}}};dwr.engine._getJSessionId=function(){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=cookies[i];while(cookie.charAt(0)==' ')cookie=cookie.substring(1,cookie.length);if(cookie.indexOf(dwr.engine._sessionCookieName+"=")==0){return cookie.substring(11,cookie.length);}}
return"";}
dwr.engine._checkCometPoll=function(){for(var i=0;i<dwr.engine._outstandingIFrames.length;i++){var text="";var iframe=dwr.engine._outstandingIFrames[i];try{text=dwr.engine._getTextFromCometIFrame(iframe);}
catch(ex){dwr.engine._handleWarning(iframe.batch,ex);}
if(text!="")dwr.engine._processCometResponse(text,iframe.batch);}
if(dwr.engine._pollReq){var req=dwr.engine._pollReq;var text=req.responseText;dwr.engine._processCometResponse(text,req.batch);}
if(dwr.engine._outstandingIFrames.length>0||dwr.engine._pollReq){setTimeout("dwr.engine._checkCometPoll()",dwr.engine._pollCometInterval);}};dwr.engine._getTextFromCometIFrame=function(frameEle){var body=frameEle.contentWindow.document.body;if(body==null)return"";var text=body.innerHTML;if(text.indexOf("<PRE>")==0||text.indexOf("<pre>")==0){text=text.substring(5,text.length-7);}
return text;};dwr.engine._processCometResponse=function(response,batch){if(batch.charsProcessed==response.length)return;if(response.length==0){batch.charsProcessed=0;return;}
var firstStartTag=response.indexOf("//#DWR-START#",batch.charsProcessed);if(firstStartTag==-1){batch.charsProcessed=response.length;return;}
var lastEndTag=response.lastIndexOf("//#DWR-END#");if(lastEndTag==-1){return;}
if(response.charCodeAt(lastEndTag+11)==13&&response.charCodeAt(lastEndTag+12)==10){batch.charsProcessed=lastEndTag+13;}
else{batch.charsProcessed=lastEndTag+11;}
var exec=response.substring(firstStartTag+13,lastEndTag);dwr.engine._receivedBatch=batch;dwr.engine._eval(exec);dwr.engine._receivedBatch=null;};dwr.engine._sendData=function(batch){batch.map.batchId=dwr.engine._nextBatchId++;dwr.engine._batches[batch.map.batchId]=batch;dwr.engine._batchesLength++;batch.completed=false;for(var i=0;i<batch.preHooks.length;i++){batch.preHooks[i]();}
batch.preHooks=null;if(batch.timeout&&batch.timeout!=0){batch.interval=setInterval(function(){dwr.engine._abortRequest(batch);},batch.timeout);}
if(batch.rpcType==dwr.engine.XMLHttpRequest){if(window.XMLHttpRequest){batch.req=new XMLHttpRequest();}
else if(window.ActiveXObject&&!(navigator.userAgent.indexOf("Mac")>=0&&navigator.userAgent.indexOf("MSIE")>=0)){batch.req=dwr.engine._newActiveXObject(dwr.engine._XMLHTTP);}}
var prop,request;if(batch.req){if(batch.async){batch.req.onreadystatechange=function(){dwr.engine._stateChange(batch);};}
if(batch.isPoll){dwr.engine._pollReq=batch.req;batch.req.batch=batch;}
var indexSafari=navigator.userAgent.indexOf("Safari/");if(indexSafari>=0){var version=navigator.userAgent.substring(indexSafari+7);if(parseInt(version,10)<400){if(dwr.engine._allowGetForSafariButMakeForgeryEasier=="true")batch.httpMethod="GET";else dwr.engine._handleWarning(batch,{name:"dwr.engine.oldSafari",message:"Safari GET support disabled. See getahead.org/dwr/server/servlet and allowGetForSafariButMakeForgeryEasier."});}}
batch.mode=batch.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;request=dwr.engine._constructRequest(batch);try{batch.req.open(batch.httpMethod,request.url,batch.async);try{for(prop in batch.headers){var value=batch.headers[prop];if(typeof value=="string")batch.req.setRequestHeader(prop,value);}
if(!batch.headers["Content-Type"])batch.req.setRequestHeader("Content-Type","text/plain");}
catch(ex){dwr.engine._handleWarning(batch,ex);}
batch.req.send(request.body);if(!batch.async)dwr.engine._stateChange(batch);}
catch(ex){dwr.engine._handleError(batch,ex);}}
else if(batch.rpcType!=dwr.engine.ScriptTag){var idname=batch.isPoll?"dwr-if-poll-"+batch.map.batchId:"dwr-if-"+batch.map["c0-id"];batch.div=document.createElement("div");batch.div.innerHTML="<iframe src='javascript:void(0)' frameborder='0' style='width:0px;height:0px;border:0;' id='"+idname+"' name='"+idname+"'></iframe>";document.body.appendChild(batch.div);batch.iframe=document.getElementById(idname);batch.iframe.batch=batch;batch.mode=batch.isPoll?dwr.engine._ModeHtmlPoll:dwr.engine._ModeHtmlCall;if(batch.isPoll)dwr.engine._outstandingIFrames.push(batch.iframe);request=dwr.engine._constructRequest(batch);if(batch.httpMethod=="GET"){batch.iframe.setAttribute("src",request.url);}
else{batch.form=document.createElement("form");batch.form.setAttribute("id","dwr-form");batch.form.setAttribute("action",request.url);batch.form.setAttribute("target",idname);batch.form.target=idname;batch.form.setAttribute("method",batch.httpMethod);for(prop in batch.map){var value=batch.map[prop];if(typeof value!="function"){var formInput=document.createElement("input");formInput.setAttribute("type","hidden");formInput.setAttribute("name",prop);formInput.setAttribute("value",value);batch.form.appendChild(formInput);}}
document.body.appendChild(batch.form);batch.form.submit();}}
else{batch.httpMethod="GET";batch.mode=batch.isPoll?dwr.engine._ModePlainPoll:dwr.engine._ModePlainCall;request=dwr.engine._constructRequest(batch);batch.script=document.createElement("script");batch.script.id="dwr-st-"+batch.map["c0-id"];batch.script.src=request.url;document.body.appendChild(batch.script);}};dwr.engine._ModePlainCall="/call/plaincall/";dwr.engine._ModeHtmlCall="/call/htmlcall/";dwr.engine._ModePlainPoll="/call/plainpoll/";dwr.engine._ModeHtmlPoll="/call/htmlpoll/";dwr.engine._constructRequest=function(batch){var request={url:batch.path+batch.mode,body:null};if(batch.isPoll==true){request.url+="ReverseAjax.dwr";}
else if(batch.map.callCount==1){request.url+=batch.map["c0-scriptName"]+"."+batch.map["c0-methodName"]+".dwr";}
else{request.url+="Multiple."+batch.map.callCount+".dwr";}
var sessionMatch=location.href.match(/jsessionid=([^?]+)/);if(sessionMatch!=null){request.url+=";jsessionid="+sessionMatch[1];}
var prop;if(batch.httpMethod=="GET"){batch.map.callCount=""+batch.map.callCount;request.url+="?";for(prop in batch.map){if(typeof batch.map[prop]!="function"){request.url+=encodeURIComponent(prop)+"="+encodeURIComponent(batch.map[prop])+"&";}}
request.url=request.url.substring(0,request.url.length-1);}
else{request.body="";for(prop in batch.map){if(typeof batch.map[prop]!="function"){request.body+=prop+"="+batch.map[prop]+dwr.engine._postSeperator;}}
request.body=dwr.engine._contentRewriteHandler(request.body);}
request.url=dwr.engine._urlRewriteHandler(request.url);return request;};dwr.engine._stateChange=function(batch){var toEval;if(batch.completed){dwr.engine._debug("Error: _stateChange() with batch.completed");return;}
var req=batch.req;try{if(req.readyState!=4)return;}
catch(ex){dwr.engine._handleWarning(batch,ex);dwr.engine._clearUp(batch);return;}
try{var reply=req.responseText;reply=dwr.engine._replyRewriteHandler(reply);var status=req.status;if(reply==null||reply==""){dwr.engine._handleWarning(batch,{name:"dwr.engine.missingData",message:"No data received from server"});}
else if(status!=200){dwr.engine._handleError(batch,{name:"dwr.engine.http."+status,message:req.statusText});}
else{var contentType=req.getResponseHeader("Content-Type");if(!contentType.match(/^text\/plain/)&&!contentType.match(/^text\/javascript/)){if(contentType.match(/^text\/html/)&&typeof batch.textHtmlHandler=="function"){batch.textHtmlHandler();}
else{dwr.engine._handleWarning(batch,{name:"dwr.engine.invalidMimeType",message:"Invalid content type: '"+contentType+"'"});}}
else{if(batch.isPoll&&batch.map.partialResponse==dwr.engine._partialResponseYes){dwr.engine._processCometResponse(reply,batch);}
else{if(reply.search("//#DWR")==-1){dwr.engine._handleWarning(batch,{name:"dwr.engine.invalidReply",message:"Invalid reply from server"});}
else{toEval=reply;}}}}}
catch(ex){dwr.engine._handleWarning(batch,ex);}
dwr.engine._callPostHooks(batch);dwr.engine._receivedBatch=batch;if(toEval!=null)toEval=toEval.replace(dwr.engine._scriptTagProtection,"");dwr.engine._eval(toEval);dwr.engine._receivedBatch=null;dwr.engine._clearUp(batch);};dwr.engine._remoteHandleCallback=function(batchId,callId,reply){var batch=dwr.engine._batches[batchId];if(batch==null){dwr.engine._debug("Warning: batch == null in remoteHandleCallback for batchId="+batchId,true);return;}
try{var handlers=batch.handlers[callId];if(!handlers){dwr.engine._debug("Warning: Missing handlers. callId="+callId,true);}
else if(typeof handlers.callback=="function")handlers.callback(reply);}
catch(ex){dwr.engine._handleError(batch,ex);}};dwr.engine._remoteHandleException=function(batchId,callId,ex){var batch=dwr.engine._batches[batchId];if(batch==null){dwr.engine._debug("Warning: null batch in remoteHandleException",true);return;}
var handlers=batch.handlers[callId];if(handlers==null){dwr.engine._debug("Warning: null handlers in remoteHandleException",true);return;}
if(ex.message==undefined)ex.message="";if(typeof handlers.exceptionHandler=="function")handlers.exceptionHandler(ex.message,ex);else if(typeof batch.errorHandler=="function")batch.errorHandler(ex.message,ex);};dwr.engine._remoteHandleBatchException=function(ex,batchId){var searchBatch=(dwr.engine._receivedBatch==null&&batchId!=null);if(searchBatch){dwr.engine._receivedBatch=dwr.engine._batches[batchId];}
if(ex.message==undefined)ex.message="";dwr.engine._handleError(dwr.engine._receivedBatch,ex);if(searchBatch){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[batchId]);}};dwr.engine._remotePollCometDisabled=function(ex,batchId){dwr.engine.setActiveReverseAjax(false);var searchBatch=(dwr.engine._receivedBatch==null&&batchId!=null);if(searchBatch){dwr.engine._receivedBatch=dwr.engine._batches[batchId];}
if(ex.message==undefined)ex.message="";dwr.engine._handleError(dwr.engine._receivedBatch,ex);if(searchBatch){dwr.engine._receivedBatch=null;dwr.engine._clearUp(dwr.engine._batches[batchId]);}};dwr.engine._remoteBeginIFrameResponse=function(iframe,batchId){if(iframe!=null)dwr.engine._receivedBatch=iframe.batch;dwr.engine._callPostHooks(dwr.engine._receivedBatch);};dwr.engine._remoteEndIFrameResponse=function(batchId){dwr.engine._clearUp(dwr.engine._receivedBatch);dwr.engine._receivedBatch=null;};dwr.engine._eval=function(script){if(script==null)return null;if(script==""){dwr.engine._debug("Warning: blank script",true);return null;}
return eval(script);};dwr.engine._abortRequest=function(batch){if(batch&&!batch.completed){clearInterval(batch.interval);dwr.engine._clearUp(batch);if(batch.req)batch.req.abort();dwr.engine._handleError(batch,{name:"dwr.engine.timeout",message:"Timeout"});}};dwr.engine._callPostHooks=function(batch){if(batch.postHooks){for(var i=0;i<batch.postHooks.length;i++){batch.postHooks[i]();}
batch.postHooks=null;}}
dwr.engine._clearUp=function(batch){if(!batch){dwr.engine._debug("Warning: null batch in dwr.engine._clearUp()",true);return;}
if(batch.completed=="true"){dwr.engine._debug("Warning: Double complete",true);return;}
if(batch.div)batch.div.parentNode.removeChild(batch.div);if(batch.iframe){for(var i=0;i<dwr.engine._outstandingIFrames.length;i++){if(dwr.engine._outstandingIFrames[i]==batch.iframe){dwr.engine._outstandingIFrames.splice(i,1);}}
batch.iframe.parentNode.removeChild(batch.iframe);}
if(batch.form)batch.form.parentNode.removeChild(batch.form);if(batch.req){if(batch.req==dwr.engine._pollReq)dwr.engine._pollReq=null;delete batch.req;}
if(batch.map&&batch.map.batchId){delete dwr.engine._batches[batch.map.batchId];dwr.engine._batchesLength--;}
batch.completed=true;if(dwr.engine._batchQueue.length!=0){var sendbatch=dwr.engine._batchQueue.shift();dwr.engine._sendData(sendbatch);}};dwr.engine._handleError=function(batch,ex){if(typeof ex=="string")ex={name:"unknown",message:ex};if(ex.message==null)ex.message="";if(ex.name==null)ex.name="unknown";if(batch&&typeof batch.errorHandler=="function")batch.errorHandler(ex.message,ex);else if(dwr.engine._errorHandler)dwr.engine._errorHandler(ex.message,ex);dwr.engine._clearUp(batch);};dwr.engine._handleWarning=function(batch,ex){if(typeof ex=="string")ex={name:"unknown",message:ex};if(ex.message==null)ex.message="";if(ex.name==null)ex.name="unknown";if(batch&&typeof batch.warningHandler=="function")batch.warningHandler(ex.message,ex);else if(dwr.engine._warningHandler)dwr.engine._warningHandler(ex.message,ex);dwr.engine._clearUp(batch);};dwr.engine._serializeAll=function(batch,referto,data,name){if(data==null){batch.map[name]="null:null";return;}
switch(typeof data){case"boolean":batch.map[name]="boolean:"+data;break;case"number":batch.map[name]="number:"+data;break;case"string":batch.map[name]="string:"+encodeURIComponent(data);break;case"object":if(data instanceof String)batch.map[name]="String:"+encodeURIComponent(data);else if(data instanceof Boolean)batch.map[name]="Boolean:"+data;else if(data instanceof Number)batch.map[name]="Number:"+data;else if(data instanceof Date)batch.map[name]="Date:"+data.getTime();else if(data&&data.join)batch.map[name]=dwr.engine._serializeArray(batch,referto,data,name);else batch.map[name]=dwr.engine._serializeObject(batch,referto,data,name);break;case"function":break;default:dwr.engine._handleWarning(null,{name:"dwr.engine.unexpectedType",message:"Unexpected type: "+typeof data+", attempting default converter."});batch.map[name]="default:"+data;break;}};dwr.engine._lookup=function(referto,data,name){var lookup;for(var i=0;i<referto.length;i++){if(referto[i].data==data){lookup=referto[i];break;}}
if(lookup)return"reference:"+lookup.name;referto.push({data:data,name:name});return null;};dwr.engine._serializeObject=function(batch,referto,data,name){var ref=dwr.engine._lookup(referto,data,name);if(ref)return ref;if(data.nodeName&&data.nodeType){return dwr.engine._serializeXml(batch,referto,data,name);}
var reply="Object_"+dwr.engine._getObjectClassName(data)+":{";var element;for(element in data){if(typeof data[element]!="function"){batch.paramCount++;var childName="c"+dwr.engine._batch.map.callCount+"-e"+batch.paramCount;dwr.engine._serializeAll(batch,referto,data[element],childName);reply+=encodeURIComponent(element)+":reference:"+childName+", ";}}
if(reply.substring(reply.length-2)==", "){reply=reply.substring(0,reply.length-2);}
reply+="}";return reply;};dwr.engine._errorClasses={"Error":Error,"EvalError":EvalError,"RangeError":RangeError,"ReferenceError":ReferenceError,"SyntaxError":SyntaxError,"TypeError":TypeError,"URIError":URIError};dwr.engine._getObjectClassName=function(obj){if(obj&&obj.constructor&&obj.constructor.toString)
{var str=obj.constructor.toString();var regexpmatch=str.match(/function\s+(\w+)/);if(regexpmatch&&regexpmatch.length==2){return regexpmatch[1];}}
if(obj&&obj.constructor){for(var errorname in dwr.engine._errorClasses){if(obj.constructor==dwr.engine._errorClasses[errorname])return errorname;}}
if(obj){var str=Object.prototype.toString.call(obj);var regexpmatch=str.match(/\[object\s+(\w+)/);if(regexpmatch&&regexpmatch.length==2){return regexpmatch[1];}}
return"Object";};dwr.engine._serializeXml=function(batch,referto,data,name){var ref=dwr.engine._lookup(referto,data,name);if(ref)return ref;var output;if(window.XMLSerializer)output=new XMLSerializer().serializeToString(data);else if(data.toXml)output=data.toXml;else output=data.innerHTML;return"XML:"+encodeURIComponent(output);};dwr.engine._serializeArray=function(batch,referto,data,name){var ref=dwr.engine._lookup(referto,data,name);if(ref)return ref;var reply="Array:[";for(var i=0;i<data.length;i++){if(i!=0)reply+=",";batch.paramCount++;var childName="c"+dwr.engine._batch.map.callCount+"-e"+batch.paramCount;dwr.engine._serializeAll(batch,referto,data[i],childName);reply+="reference:";reply+=childName;}
reply+="]";return reply;};dwr.engine._unserializeDocument=function(xml){var dom;if(window.DOMParser){var parser=new DOMParser();dom=parser.parseFromString(xml,"text/xml");if(!dom.documentElement||dom.documentElement.tagName=="parsererror"){var message=dom.documentElement.firstChild.data;message+="\n"+dom.documentElement.firstChild.nextSibling.firstChild.data;throw message;}
return dom;}
else if(window.ActiveXObject){dom=dwr.engine._newActiveXObject(dwr.engine._DOMDocument);dom.loadXML(xml);return dom;}
else{var div=document.createElement("div");div.innerHTML=xml;return div;}};dwr.engine._newActiveXObject=function(axarray){var returnValue;for(var i=0;i<axarray.length;i++){try{returnValue=new ActiveXObject(axarray[i]);break;}
catch(ex){}}
return returnValue;};dwr.engine._debug=function(message,stacktrace){var written=false;try{if(window.console){if(stacktrace&&window.console.trace)window.console.trace();window.console.log(message);written=true;}
else if(window.opera&&window.opera.postError){window.opera.postError(message);written=true;}}
catch(ex){}
if(!written){var debug=document.getElementById("dwr-debug");if(debug){var contents=message+"<br/>"+debug.innerHTML;if(contents.length>2048)contents=contents.substring(0,2048);debug.innerHTML=contents;}}};

var TrimPath;(function(){if(TrimPath==null)
TrimPath=new Object();if(TrimPath.evalEx==null)
TrimPath.evalEx=function(src){return eval(src);};var UNDEFINED;if(Array.prototype.pop==null)
Array.prototype.pop=function(){if(this.length===0){return UNDEFINED;}
return this[--this.length];};if(Array.prototype.push==null)
Array.prototype.push=function(){for(var i=0;i<arguments.length;++i){this[this.length]=arguments[i];}
return this.length;};TrimPath.parseTemplate=function(tmplContent,optTmplName,optEtc){if(optEtc==null)
optEtc=TrimPath.parseTemplate_etc;var funcSrc=parse(tmplContent,optTmplName,optEtc);var func=TrimPath.evalEx(funcSrc,optTmplName,1);if(func!=null)
return new optEtc.Template(optTmplName,tmplContent,funcSrc,func,optEtc);return null;}
try{String.prototype.process=function(context,optFlags){var template=TrimPath.parseTemplate(this,null);if(template!=null)
return template.process(context,optFlags);return this;}}catch(e){}
TrimPath.parseTemplate_etc={};TrimPath.parseTemplate_etc.statementTag="forelse|for|if|elseif|else|var|macro";TrimPath.parseTemplate_etc.statementDef={"if":{delta:1,prefix:"if (",suffix:") {",paramMin:1},"else":{delta:0,prefix:"} else {"},"elseif":{delta:0,prefix:"} else if (",suffix:") {",paramDefault:"true"},"/if":{delta:-1,prefix:"}"},"for":{delta:1,paramMin:3,prefixFunc:function(stmtParts,state,tmplName,etc){if(stmtParts[2]!="in")
throw new etc.ParseError(tmplName,state.line,"bad for loop statement: "+stmtParts.join(' '));var iterVar=stmtParts[1];var listVar="__LIST__"+iterVar;return["var ",listVar," = ",stmtParts[3],";","var __LENGTH_STACK__;","if (typeof(__LENGTH_STACK__) == 'undefined' || !__LENGTH_STACK__.length) __LENGTH_STACK__ = new Array();","__LENGTH_STACK__[__LENGTH_STACK__.length] = 0;","if ((",listVar,") != null) { ","var ",iterVar,"_ct = 0;","for (var ",iterVar,"_index in ",listVar,") { ",iterVar,"_ct++;","if (typeof(",listVar,"[",iterVar,"_index]) == 'function') {continue;}","__LENGTH_STACK__[__LENGTH_STACK__.length - 1]++;","var ",iterVar," = ",listVar,"[",iterVar,"_index];"].join("");}},"forelse":{delta:0,prefix:"} } if (__LENGTH_STACK__[__LENGTH_STACK__.length - 1] == 0) { if (",suffix:") {",paramDefault:"true"},"/for":{delta:-1,prefix:"} }; delete __LENGTH_STACK__[__LENGTH_STACK__.length - 1];"},"var":{delta:0,prefix:"var ",suffix:";"},"macro":{delta:1,prefixFunc:function(stmtParts,state,tmplName,etc){var macroName=stmtParts[1].split('(')[0];return["var ",macroName," = function",stmtParts.slice(1).join(' ').substring(macroName.length),"{ var _OUT_arr = []; var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } }; "].join('');}},"/macro":{delta:-1,prefix:" return _OUT_arr.join(''); };"}}
TrimPath.parseTemplate_etc.modifierDef={"eat":function(v){return"";},"escape":function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");},"capitalize":function(s){return String(s).toUpperCase();},"default":function(s,d){return s!=null?s:d;}}
TrimPath.parseTemplate_etc.modifierDef.h=TrimPath.parseTemplate_etc.modifierDef.escape;TrimPath.parseTemplate_etc.Template=function(tmplName,tmplContent,funcSrc,func,etc){this.process=function(context,flags){if(context==null)
context={};if(context._MODIFIERS==null)
context._MODIFIERS={};if(context.defined==null)
context.defined=function(str){return(context[str]!=undefined);};for(var k in etc.modifierDef){if(context._MODIFIERS[k]==null)
context._MODIFIERS[k]=etc.modifierDef[k];}
if(flags==null)
flags={};var resultArr=[];var resultOut={write:function(m){resultArr.push(m);}};try{func(resultOut,context,flags);}catch(e){if(flags.throwExceptions==true)
throw e;var result=new String(resultArr.join("")+"[ERROR: "+e.toString()+(e.message?'; '+e.message:'')+"]");result["exception"]=e;return result;}
return resultArr.join("");}
this.name=tmplName;this.source=tmplContent;this.sourceFunc=funcSrc;this.toString=function(){return"TrimPath.Template ["+tmplName+"]";}}
TrimPath.parseTemplate_etc.ParseError=function(name,line,message){this.name=name;this.line=line;this.message=message;}
TrimPath.parseTemplate_etc.ParseError.prototype.toString=function(){return("TrimPath template ParseError in "+this.name+": line "+this.line+", "+this.message);}
var parse=function(body,tmplName,etc){body=cleanWhiteSpace(body);var funcText=["var TrimPath_Template_TEMP = function(_OUT, _CONTEXT, _FLAGS) { with (_CONTEXT) {"];var state={stack:[],line:1};var endStmtPrev=-1;while(endStmtPrev+1<body.length){var begStmt=endStmtPrev;begStmt=body.indexOf("{",begStmt+1);while(begStmt>=0){var endStmt=body.indexOf('}',begStmt+1);var stmt=body.substring(begStmt,endStmt);var blockrx=stmt.match(/^\{(cdata|minify|eval)/);if(blockrx){var blockType=blockrx[1];var blockMarkerBeg=begStmt+blockType.length+1;var blockMarkerEnd=body.indexOf('}',blockMarkerBeg);if(blockMarkerEnd>=0){var blockMarker;if(blockMarkerEnd-blockMarkerBeg<=0){blockMarker="{/"+blockType+"}";}else{blockMarker=body.substring(blockMarkerBeg+1,blockMarkerEnd);}
var blockEnd=body.indexOf(blockMarker,blockMarkerEnd+1);if(blockEnd>=0){emitSectionText(body.substring(endStmtPrev+1,begStmt),funcText);var blockText=body.substring(blockMarkerEnd+1,blockEnd);if(blockType=='cdata'){emitText(blockText,funcText);}else if(blockType=='minify'){emitText(scrubWhiteSpace(blockText),funcText);}else if(blockType=='eval'){if(blockText!=null&&blockText.length>0)
funcText.push('_OUT.write( (function() { '+blockText+' })() );');}
begStmt=endStmtPrev=blockEnd+blockMarker.length-1;}}}else if(body.charAt(begStmt-1)!='$'&&body.charAt(begStmt-1)!='\\'){var offset=(body.charAt(begStmt+1)=='/'?2:1);if(body.substring(begStmt+offset,begStmt+10+offset).search(TrimPath.parseTemplate_etc.statementTag)==0)
break;}
begStmt=body.indexOf("{",begStmt+1);}
if(begStmt<0)
break;var endStmt=body.indexOf("}",begStmt+1);if(endStmt<0)
break;emitSectionText(body.substring(endStmtPrev+1,begStmt),funcText);emitStatement(body.substring(begStmt,endStmt+1),state,funcText,tmplName,etc);endStmtPrev=endStmt;}
emitSectionText(body.substring(endStmtPrev+1),funcText);if(state.stack.length!=0)
throw new etc.ParseError(tmplName,state.line,"unclosed, unmatched statement(s): "+state.stack.join(","));funcText.push("}}; TrimPath_Template_TEMP");return funcText.join("");}
var emitStatement=function(stmtStr,state,funcText,tmplName,etc){var parts=stmtStr.slice(1,-1).split(' ');var stmt=etc.statementDef[parts[0]];if(stmt==null){emitSectionText(stmtStr,funcText);return;}
if(stmt.delta<0){if(state.stack.length<=0)
throw new etc.ParseError(tmplName,state.line,"close tag does not match any previous statement: "+stmtStr);state.stack.pop();}
if(stmt.delta>0)
state.stack.push(stmtStr);if(stmt.paramMin!=null&&stmt.paramMin>=parts.length)
throw new etc.ParseError(tmplName,state.line,"statement needs more parameters: "+stmtStr);if(stmt.prefixFunc!=null)
funcText.push(stmt.prefixFunc(parts,state,tmplName,etc));else
funcText.push(stmt.prefix);if(stmt.suffix!=null){if(parts.length<=1){if(stmt.paramDefault!=null)
funcText.push(stmt.paramDefault);}else{for(var i=1;i<parts.length;i++){if(i>1)
funcText.push(' ');funcText.push(parts[i]);}}
funcText.push(stmt.suffix);}}
var emitSectionText=function(text,funcText){if(text.length<=0)
return;var nlPrefix=0;var nlSuffix=text.length-1;while(nlPrefix<text.length&&(text.charAt(nlPrefix)=='\n'))
nlPrefix++;while(nlSuffix>=0&&(text.charAt(nlSuffix)==' '||text.charAt(nlSuffix)=='\t'))
nlSuffix--;if(nlSuffix<nlPrefix)
nlSuffix=nlPrefix;if(nlPrefix>0){funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=text.substring(0,nlPrefix).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')
s=s.substring(0,s.length-1);funcText.push(s);funcText.push('");');}
var lines=text.substring(nlPrefix,nlSuffix+1).split('\n');for(var i=0;i<lines.length;i++){emitSectionTextLine(lines[i],funcText);if(i<lines.length-1)
funcText.push('_OUT.write("\\n");\n');}
if(nlSuffix+1<text.length){funcText.push('if (_FLAGS.keepWhitespace == true) _OUT.write("');var s=text.substring(nlSuffix+1).replace('\n','\\n');if(s.charAt(s.length-1)=='\n')
s=s.substring(0,s.length-1);funcText.push(s);funcText.push('");');}}
var emitSectionTextLine=function(line,funcText){var endMarkPrev='}';var endExprPrev=-1;while(endExprPrev+endMarkPrev.length<line.length){var begMark="${",endMark="}";var begExpr=line.indexOf(begMark,endExprPrev+endMarkPrev.length);if(begExpr<0)
break;if(line.charAt(begExpr+2)=='%'){begMark="${%";endMark="%}";}
var endExpr=line.indexOf(endMark,begExpr+begMark.length);if(endExpr<0)
break;emitText(line.substring(endExprPrev+endMarkPrev.length,begExpr),funcText);var exprArr=line.substring(begExpr+begMark.length,endExpr).replace(/\|\|/g,"#@@#").split('|');for(var k in exprArr){if(exprArr[k].replace)
exprArr[k]=exprArr[k].replace(/#@@#/g,'||');}
funcText.push('_OUT.write(');emitExpression(exprArr,exprArr.length-1,funcText);funcText.push(');');endExprPrev=endExpr;endMarkPrev=endMark;}
emitText(line.substring(endExprPrev+endMarkPrev.length),funcText);}
var emitText=function(text,funcText){if(text==null||text.length<=0)
return;text=text.replace(/\\/g,'\\\\');text=text.replace(/\n/g,'\\n');text=text.replace(/"/g,'\\"');funcText.push('_OUT.write("');funcText.push(text);funcText.push('");');}
var emitExpression=function(exprArr,index,funcText){var expr=exprArr[index];if(index<=0){funcText.push(expr);return;}
var parts=expr.split(':');funcText.push('_MODIFIERS["');funcText.push(parts[0]);funcText.push('"](');emitExpression(exprArr,index-1,funcText);if(parts.length>1){funcText.push(',');funcText.push(parts[1]);}
funcText.push(')');}
var cleanWhiteSpace=function(result){result=result.replace(/\t/g,"    ");result=result.replace(/\r\n/g,"\n");result=result.replace(/\r/g,"\n");result=result.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return result;}
var scrubWhiteSpace=function(result){result=result.replace(/^\s+/g,"");result=result.replace(/\s+$/g,"");result=result.replace(/\s+/g," ");result=result.replace(/^(\s*\S*(\s+\S+)*)\s*$/,'$1');return result;}
TrimPath.parseDOMTemplate=function(elementId,optDocument,optEtc){if(optDocument==null)
optDocument=document;var element=optDocument.getElementById(elementId);var content=element.value;if(content==null)
content=element.innerHTML;content=content.replace(/&lt;/g,"<").replace(/&gt;/g,">");return TrimPath.parseTemplate(content,elementId,optEtc);}
TrimPath.processDOMTemplate=function(elementId,context,optFlags,optDocument,optEtc){return TrimPath.parseDOMTemplate(elementId,optDocument,optEtc).process(context,optFlags);}})();TrimPath.parseTemplate_etc.modifierDef.escape=function(s){return String(s).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;");}
TrimPath.parseTemplate_etc.modifierDef.js_string=function(s){return String(s).replace(/\\/g,"\\\\").replace(/'/g,"\\&#39;").replace(/"/g,"\\&#34;");}
TrimPath.parseTemplate_etc.modifierDef.substring=function(s,s1,s2){return String(s).substr(s1,s2);}
TrimPath.parseTemplate_etc.modifierDef.replace=function(s,s1,s2){return String(s).replace(s1,s2)}
TrimPath.parseTemplate_etc.modifierDef.parentDomain=function(s){return DomainMap.getParentDomain(s);}
TrimPath.parseTemplate_etc.modifierDef.to_url=function(s){if(s==null)
return"#";var url=/^(.+):\/\/(.*)$/;if(!url.test(s))
s="http://"+s;return s;}
TrimPath.parseTemplate_etc.modifierDef.showBr=function(s){return String(s).replace(/\n/g,"<br>");}
TrimPath.parseTemplate_etc.modifierDef.erase=function(s,i){s=s+'';if(s.length<=i)
return s;return s.substr(0,i)+'...';}
if(NetEase==undefined){var NetEase={};}
NetEase.SimpleDragDrop=Class.create();NetEase.SimpleDragDrop.prototype={initialize:function(){this.drags=[];this.options=Object.extend({top:-1,left:0,width:0,height:0,constraint:'all'},arguments[0]||{});this.options.top=parseInt(this.options.top||'0');this.options.left=parseInt(this.options.left||'0');this.options.width=parseInt(this.options.width||'0');this.options.height=parseInt(this.options.height||'0');},addDraggable:function(element){new NetEase.Draggable(element,this,Object.extend(this.options,arguments[1]||{}));},removeDraggable:function(element){element=$(element);this.drags.select(function(e){return e.getElement()==element;}).each(function(e){e.destroy()});},register:function(draggable){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress);}
this.drags.push(draggable);},unregister:function(draggable){this.drags=this.drags.reject(function(d){return d==draggable});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress);}},activate:function(draggable){window.focus();this.activeDraggable=draggable;},deactivate:function(){this.activeDraggable=null;},updateDrag:function(event){if(!this.activeDraggable)return;var pointer=[Event.pointerX(event),Event.pointerY(event)];if(this._lastPointer&&(this._lastPointer.inspect()==pointer.inspect()))return;this._lastPointer=pointer;this.activeDraggable.updateDrag(event,pointer);},endDrag:function(event){if(!this.activeDraggable)return;this._lastPointer=null;this.activeDraggable.endDrag(event);this.activeDraggable=null;},keyPress:function(event){if(this.activeDraggable)
this.activeDraggable.keyPress(event);}};NetEase.Draggable=Class.create();NetEase.Draggable.prototype={initialize:function(element,draggables){var options=Object.extend({handle:false,starteffect:function(element){new Effect.Opacity(element,{duration:0.2,from:1.0,to:0.7});},endeffect:function(element){new Effect.Opacity(element,{duration:0.2,from:0.7,to:1.0});},zindex:1000,onDrag:Prototype.emptyFunction},arguments[2]||{});this.element=$(element);if(options.handle&&(typeof options.handle=='string'))
this.handle=this._childrenWithClassName(this.element,options.handle)[0];if(!this.handle)this.handle=$(options.handle);if(!this.handle)this.handle=this.element;Element.makePositioned(this.element);this.delta=this.currentDelta();this.options=options;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);this.draggables=draggables;this.draggables.register(this);},getElement:function(){return this.element;},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);this.draggables.unregister(this);},currentDelta:function(){return([parseInt(Element.getStyle(this.element,'left')||'0'),parseInt(Element.getStyle(this.element,'top')||'0')]);},initDrag:function(event){if(Event.isLeftClick(event)){var src=Event.element(event);if(src.tagName&&(src.tagName=='INPUT'||src.tagName=='SELECT'||src.tagName=='OPTION'||src.tagName=='BUTTON'||src.tagName=='TEXTAREA'))return;var pointer=[Event.pointerX(event),Event.pointerY(event)];var pos=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(i){return(pointer[i]-pos[i])});this.draggables.activate(this);Event.stop(event);}},startDrag:function(event){this.dragging=true;if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,'z-index')||0);this.element.style.zIndex=this.options.zindex;}
if(this.options.starteffect)this.options.starteffect(this.element);},updateDrag:function(event,pointer){if(!this.dragging)this.startDrag(event);Position.prepare();this.draw(pointer);if(navigator.appVersion.indexOf('AppleWebKit')>0)window.scrollBy(0,0);this.options.onDrag();Event.stop(event);},finishDrag:function(event,success){this.dragging=false;this.delta=this.currentDelta();this.element.style.zIndex=this.originalZ;if(this.options.endeffect)
this.options.endeffect(this.element);this.draggables.deactivate(this);},keyPress:function(event){if(event.keyCode!=Event.KEY_ESC)return;this.finishDrag(event,false);Event.stop(event);},endDrag:function(event){if(!this.dragging)return;this.finishDrag(event,true);Event.stop(event);},draw:function(point){var pos=Position.cumulativeOffset(this.element);var d=this.currentDelta();pos[0]-=d[0];pos[1]-=d[1];var p=[0,1].map(function(i){return(point[i]-pos[i]-this.offset[i])}.bind(this));if(this.options.left!=0){if((this.options.width!=0)&&(p[0]>this.options.left+this.options.width))
p[0]=this.options.left+this.options.width;else if(p[0]<this.options.left)
p[0]=this.options.left;}
if(this.options.top!=0){if((this.options.height!=0)&&(p[1]>this.options.top+this.options.height))
p[1]=this.options.top+this.options.height;else if(p[1]<this.options.top)
p[1]=this.options.top;}
if(this.options.constraint=='horizontal')
Element.setStyle(this.element,{left:p[0]+'px'});else if(this.options.constraint=='vertical')
Element.setStyle(this.element,{top:p[1]+'px'});else
Element.setStyle(this.element,{left:p[0]+'px',top:p[1]+'px'});if(Element.getStyle(this.element,'visibility')=='hidden')
Element.setStyle(this.element,{visibility:''});},_childrenWithClassName:function(element,className){return $A($(element).getElementsByTagName('*')).select(function(c){return Element.hasClassName(c,className)});}}

Element.removeChild = Element.remove;
if(NetEase==undefined){var NetEase={};}
NetEase.JSWindowManager=Class.create();NetEase.JSWindowManager.prototype={initialize:function(){this.options=Object.extend({prefix:"$_",systemBarPostfix:"_system_bar",panelPostfix:"_panel",titlePostfix:"_title",closePostfix:"_close",allowDrag:true,useDragOpacity:true,simpleDrag:false},arguments[0]||{});this.jsWindowList=[];this.baseIndex=10000;this.indexAdd=0;this.topIndex=99999;if(this.options.allowDrag)
this.simpleDragDrop=new NetEase.SimpleDragDrop({useDragOpacity:this.options.useDragOpacity,simpleDrag:this.options.simpleDrag});this.curWindow=null;Event.observe(document,"keyup",this._closeCurrentWindow.bindAsEventListener(this));},_closeCurrentWindow:function(event){if(this.curWindow&&event.keyCode==Event.KEY_ESC){this.curWindow.hiddenWindow();}},existWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));return jsWindow?true:false;},getWindow:function(id){return this.jsWindowList.detect(this._detectIter.bind(this,id));},createWindow:function(id,params){if($(id)!=null){alert("该窗口已经存在!");return;}
var options=Object.extend({className:false,left:false,top:false,width:600,height:400,allowDrag:true,notKeepPos:true,onTop:false,hasSystemBar:true,systemBarClassName:'titlebar',handleClass:'$$_handle_class',titleId:false,title:'JSWindow',hasCloseId:true,closeId:false,hiddenOnClose:true,panelClassName:'content',useShadow:true,needCover:false,allowScroll:false,opacity:0.25,beforShowFunc:Prototype.emptyFunction,afterShowFunc:Prototype.emptyFunction,beforeHiddenFunc:Prototype.emptyFunction,afterHiddenFunc:Prototype.emptyFunction,beforeCloseFunc:Prototype.emptyFunction,afterCloseFunc:Prototype.emptyFunction},params||{});if(!this.options.allowDrag)options.allowDrag=false;this._buildPos(options);if(options.onTop){options.zIndex=this.topIndex;}else{options.zIndex=this.baseIndex+(this.indexAdd++);}
if(options.titleId==false)
options.titleId=this.options.prefix+id+this.options.systemBarPostfix+this.options.titlePostfix;if(options.hasSystemBar&&options.hasCloseId&&options.closeId==false)
options.closeId=this.options.prefix+id+this.options.systemBarPostfix+this.options.closePostfix;var jsWindow=this._createJSWindow(id,options);jsWindow.windowHtml=this._createWindowHtml(id,options);if(options.hasSystemBar)
jsWindow.systemBar=this._createSystemBar(jsWindow.windowHtml,id,options);jsWindow.panel=this._createPanel(jsWindow.windowHtml,id,options);this.jsWindowList.push(jsWindow);return jsWindow;},_getContainer:function(options){var conDiv=(options.notKeepPos)?UD.layer:UD.body;if(conDiv==null)conDiv=document.body;return conDiv;},_getLeft:function(width){var left=(document.documentElement.clientWidth-width)/2;if(left<10)left=10;return left;},_getTop:function(height,container){var top=0;if(container==UD.layer||container==document.body){top=document.documentElement.scrollTop+
(document.documentElement.clientHeight-height)/2;}
else{top=UD.body.parentNode.scrollTop+
(document.documentElement.clientHeight-height)/2;}
if(top<10)top=10;return top;},_buildPos:function(options){if(!options.left){options.left=this._getLeft(options.width);options._caluLeft=true;}
if(!options.top){options.top=this._getTop(options.height,this._getContainer(options));options._caluTop=true;}},setPos:function(id,pos){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._setPos(jsWindow,pos);return jsWindow;},_setPos:function(jsWindow,pos){if(jsWindow){Object.extend(jsWindow.options,pos);jsWindow.options.notKeepPos=true;this._buildPos(jsWindow.options);}},showWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._showWindow(jsWindow);return jsWindow;},_showWindow:function(jsWindow){if(jsWindow){this._showMode(jsWindow,true);jsWindow.options.beforShowFunc(jsWindow);if(jsWindow.options.notKeepPos){if(jsWindow.options._caluLeft){jsWindow.options.left=this._getLeft(jsWindow.options.width);;}
jsWindow.windowHtml.style.left=jsWindow.options.left+"px";if(jsWindow.options._caluTop){jsWindow.options.top=this._getTop(jsWindow.options.height,jsWindow.containerDiv);}
jsWindow.windowHtml.style.top=jsWindow.options.top+"px";}
jsWindow.windowHtml.style.display="";this._hideSelect(true);jsWindow.options.afterShowFunc(jsWindow);this.curWindow=jsWindow;}},_showMode:function(jsWindow,show){if(!jsWindow.options.needCover)return;var conDiv=jsWindow.containerDiv;if(jsWindow.options.allowScroll)
conDiv=UD.layer;var gapDiv=$(conDiv.id+"_gap");if(!gapDiv){gapDiv=document.createElement('div');gapDiv.id=conDiv.id+"_gap";
gapDiv.style.position='absolute';gapDiv.style.display='none';gapDiv.style.left='0px';gapDiv.style.top='0px';gapDiv.style.backgroundColor="#ffffff";gapDiv.style.MozOpacity=""+jsWindow.options.opacity;gapDiv.style.filter="alpha(opacity="+jsWindow.options.opacity*100+")";gapDiv.style.width=conDiv.parentNode.scrollWidth+'px';gapDiv.style.height=conDiv.parentNode.scrollHeight+'px';gapDiv.style.zIndex=this.baseIndex-1;conDiv.parentNode.appendChild(gapDiv);}
gapDiv.style.display=show?'block':'none';},updateTitle:function(id,title){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._updateTitle(jsWindow,title);return jsWindow;},_updateTitle:function(jsWindow,title){if(jsWindow){jsWindow.options.title=title;$(jsWindow.options.titleId).innerHTML=title;}},hiddenWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));this._hiddenWindow(jsWindow);return jsWindow},_hiddenWindow:function(jsWindow){if(jsWindow){this._showMode(jsWindow,false);jsWindow.options.beforeHiddenFunc(jsWindow);jsWindow.windowHtml.style.display="none";this._hideSelect(false);jsWindow.options.afterHiddenFunc(jsWindow);if(this.curWindow==jsWindow)this.curWindow=null;}},closeWindow:function(id){var jsWindow=this.jsWindowList.detect(this._detectIter.bind(this,id));return this._closeWindow(jsWindow);},_closeWindow:function(jsWindow){if(jsWindow){this._showMode(jsWindow,false);jsWindow.options.beforeCloseFunc(jsWindow);jsWindow.windowHtml.style.display="none";this._hideSelect(false);if(jsWindow.options.allowDrag)
this.simpleDragDrop.removeDraggable(jsWindow.windowHtml.id);if(jsWindow.options.hasSystemBar){Element.removeChild(jsWindow.systemBar);jsWindow.systemBar=null;}
Element.removeChild(jsWindow.panel);jsWindow.panel=null;Element.removeChild(jsWindow.windowHtml);jsWindow.windowHtml=null;this.jsWindowList=this.jsWindowList.reject(this._detectIter.bind(this,jsWindow.id));jsWindow.options.afterCloseFunc();if(this.curWindow==jsWindow)this.curWindow=null;}},focusWindow:function(jsWindow){if(jsWindow){this._focusWindow(jsWindow.id);}},_focusWindow:function(id){var pos=-1;this.indexAdd=0;for(var i=0;i<this.jsWindowList.length;i++){if(this.jsWindowList[i].id!=id){if(!this.jsWindowList[i].options.onTop){this.jsWindowList[i].options.zIndex=this.baseIndex+(this.indexAdd++);this.jsWindowList[i].windowHtml.style.zIndex=this.jsWindowList[i].options.zIndex;}}else{pos=i;}}
if(pos>-1){this.jsWindowList[pos].options.zIndex=this.baseIndex+(this.indexAdd++);this.jsWindowList[pos].windowHtml.style.zIndex=this.jsWindowList[pos].options.zIndex;this.curWindow=this.jsWindowList[pos];}},_detectIter:function(id,element){if(id==element.id){return true;}
return false;},_createWindowHtml:function(id,options){var windowHtml=document.createElement('div');windowHtml.id=this.options.prefix+id;windowHtml.className='g_lay_com '+(options.className?options.className:'')+(options.useShadow?' g_f_shw':'');windowHtml.style.display="none";windowHtml.style.position="absolute";windowHtml.style.left=options.left+"px";windowHtml.style.top=options.top+"px";windowHtml.style.width=options.width+"px";if(!options.notKeepPos)
windowHtml.container='in';if(options.height!="auto"){if(isIE){if(IEVer==7){windowHtml.style.minHeight=options.height+"px";windowHtml.style.height="auto";}else{windowHtml.style.height=options.height+"px";}}else{windowHtml.style.minHeight=options.height+"px";windowHtml.style.height="auto";}}
windowHtml.style.zIndex=options.zIndex;this._getContainer(options).appendChild(windowHtml);Event.observe(windowHtml.id,'click',this._focusWindow.bind(this,id));return windowHtml;},_createSystemBar:function(windowHtml,id,options){var systemBar=document.createElement('div');systemBar.id=this.options.prefix+id+this.options.systemBarPostfix;if(options.systemBarClassName)
systemBar.className=options.systemBarClassName;var g_c_move=options.allowDrag?'g_c_move':'';var html='<div>';if(options.hasCloseId){html+='<span id ="'+options.closeId+'" class="r" title="关闭">&nbsp;</span>';}
html+='<span style="display:block;" class="g_t_hide $$_handle_class '+g_c_move+'" id="'+options.titleId+'">'+options.title+'</span></div>';systemBar.innerHTML=html;windowHtml.appendChild(systemBar);if(options.hasCloseId){if(options.hiddenOnClose){Event.observe(options.closeId,'click',this.hiddenWindow.bind(this,id));}else{Event.observe(options.closeId,'click',this.closeWindow.bind(this,id));}}
if(options.allowDrag){this.simpleDragDrop.removeDraggable(windowHtml.id);this.simpleDragDrop.addDraggable(windowHtml.id,{handle:'$$_handle_class',zindex:this.topIndex-1});}
return systemBar;},_createPanel:function(windowHtml,id,options){var panel=document.createElement('div');panel.id=this.options.prefix+id+this.options.panelPostfix;if(options.panelClassName)
panel.className=options.panelClassName;windowHtml.appendChild(panel);return panel;},_hideSelect:function(hide){if(isIE&&IEVer<7){var selectArray=document.getElementsByTagName("select");if(selectArray){for(var i=0;i<selectArray.length;i++){if(selectArray[i].getAttribute("nohide")!="true"){selectArray[i].style.visibility=(hide==true)?'hidden':'inherit';}}}}},_createJSWindow:function(id,options){var jsWindow={};jsWindow.id=id;jsWindow.options=options;jsWindow.containerDiv=this._getContainer(options);jsWindow.setPos=function(pos){this._setPos(jsWindow,pos);}.bind(this);jsWindow.showWindow=function(){this._showWindow(jsWindow);}.bind(this);jsWindow.updateTitle=function(title){this._updateTitle(jsWindow,title);}.bind(this);jsWindow.hiddenWindow=function(){this._hiddenWindow(jsWindow);}.bind(this);jsWindow.closeWindow=function(){this._closeWindow(jsWindow);}.bind(this);jsWindow.focusWindow=function(){this.focusWindow(jsWindow);}.bind(this);return jsWindow;}}


if(NetEase==undefined){var NetEase={};}
NetEase.quickLoginTemplate=null;NetEase.indexLoginTemplate=null;var type163=0;var typePopo=1;var type126=2;var type188=3;var typeVip=4;var typeYeah=5;var ckLoginInfoKey="NEBLOG_LOGIN";var ckLoginInfo={type:null,name:null,pass:null};var ckPath="/";var ckDomain=DomainMap.cookieDomain;var errInfo=["用户名或密码不正确，请重新输入","该网易博客用户名不存在","超时退出或无权限访问，请重新登录"];NetEase.QuickLogin=Class.create();NetEase.QuickLogin.prototype={initialize:function(presentShowId,serverName,bFromIndex){this.options=Object.extend({err:false,jsWindowManager:null},arguments[3]||{});this.presentShowId=presentShowId;this.serverName=serverName;this.bFromIndex=bFromIndex;this.err=false;this.jsWindowManager=this.options.jsWindowManager;this.objUsername;this.objPassword;this.objSetCkCheck;this.frmLogin;this.divNotice;this.btn_login;this.btn_reg;this.curUserType=0;this.noticeInit="请输入用户名和密码登录";this.noticeAccount="请输入网易通行证用户名";this.noticePassword="请完整填写登录信息，密码不能为空";this.isPwdFromCk=false;this.pwdFromCk;this.pwdFromCkTrim;this.strUsername;this.strPassword;this.qLoginZone=null;this._load();},_load:function(){getLoginCookie();this.curUserType=ckLoginInfo.type;if(this.curUserType==null){this.curUserType=type163;}else{this.curUserType=parseInt(this.curUserType);}
if(!this.bFromIndex||this.presentShowId=="qIndexLoginDiv"){if(NetEase.quickLoginTemplate==null)
NetEase.quickLoginTemplate=quicklogin_jst;var data={err:false};var result=NetEase.quickLoginTemplate;if(this.presentShowId){this.qLoginZone=this.jsWindowManager.createWindow(this.presentShowId,{className:'g_lay_com g_win_4 g_f_shw',width:500,height:250,hideFlash:true,title:'登录网易博客',onTop:true,notKeepPos:true});this.qLoginZone.panel.innerHTML=result;this.qLoginZone.showWindow();}}else{if(NetEase.indexLoginTemplate==null)
NetEase.indexLoginTemplate=indexlogin_jst;var data={err:false};var result=NetEase.indexLoginTemplate;$("outLoginDiv").innerHTML=result;}
this.frmLogin=$("frmLogin");this.divNotice=$("notice_bar");this.objUsername=$("in_username");this.objPassword=$("in_password");this.objSetCkCheck=$("setCookieCheck");if(document.all){this.objUsername.attachEvent("onblur",this.checkUsername.bind(this));this.objPassword.attachEvent("onfocus",this.fnPassOnFocus.bind(this));this.objPassword.attachEvent("onblur",this.checkPassword.bind(this));if(!this.bFromIndex){for(var i=0;i<6;i++){if($("tab_a_"+i))
$("tab_a_"+i).attachEvent("onclick",this.selectUserType.bind(this,i));else
$("tab_"+i).attachEvent("onclick",this.selectUserType.bind(this,i));}}
$("qLoginButt").attachEvent("onclick",this.dologin.bind(this));this.frmLogin.attachEvent("onkeypress",this.frmDologinIE.bind(this));this.objSetCkCheck.attachEvent("onclick",this.changeCookieCheck.bind(this));}
else{this.objUsername.addEventListener("blur",this.checkUsername.bind(this),true);this.objPassword.addEventListener("focus",this.fnPassOnFocus.bind(this),true);this.objPassword.addEventListener("blur",this.checkPassword.bind(this),true);if(!this.bFromIndex){for(var i=0;i<6;i++){if($("tab_a_"+i))
$("tab_a_"+i).onclick=this.selectUserType.bind(this,i);else
$("tab_"+i).onclick=this.selectUserType.bind(this,i);}}
$("qLoginButt").onclick=this.dologin.bind(this);this.frmLogin.onkeypress=this.frmDologin.bind(this);this.objSetCkCheck.onclick=this.changeCookieCheck.bind(this);}
if(this.bFromIndex)
showLoginType(this.curUserType);this.selectUserType(this.curUserType);},showWindow:function(target){if(target){this.loginTarget=target;}
this.qLoginZone.showWindow();},frmDologinIE:function(){if(event.keyCode==13)
this.dologin();},frmDologin:function(event){if(event.keyCode==13)
this.dologin();},changeCookieCheck:function(){if(!this.objSetCkCheck.checked){clearLoginCookie();}},checkUsername:function(){var strUsername=this.objUsername.value;if(strUsername.length>0){this.divNotice.innerHTML=this.noticeAccount;}else{this.divNotice.innerHTML=this.noticeInit;}
return true;},checkPasswordFocus:function(){var strPassword=this.objPassword.value;if(strPassword==""){var strUsername=this.objUsername.value+getNameSuffix(this.curUserType);strPassword=ckLoginInfo.pass;if(null!=strPassword){this.pwdFromCk=strPassword;this.pwdFromCkTrim=strPassword.substring(0,11);this.isPwdFromCk=true;this.objPassword.value=strPassword.substring(0,11);}}
this.checkPassword();},fnPassOnFocus:function(){this.objPassword.select();this.checkPassword();},checkPassword:function(){var strPassword=this.objPassword.value;if(null==strPassword||strPassword==""){this.isPwdFromCk=false;}
var rePassword=/^[\s]*$/g;if(strPassword.match(rePassword)!=null){this.divNotice.innerHTML=this.noticePassword;return false;}else{this.divNotice.innerHTML=this.noticeInit;return true;}},dologin:function(){if(this.checkUsername()&&this.checkPassword()){this.divNotice.innerHTML="正在登录，请稍候...";this.objUsername.disabled=true;this.objPassword.disabled=true;if(document.all){this.objUsername.detachEvent("onblur",this.checkUsername);this.objPassword.detachEvent("onfocus",this.checkPassword);this.objPassword.detachEvent("onblur",this.checkPassword);$("frmLogin").detachEvent("onkeypress",this.frmDologinIE);$("qLoginButt").detachEvent("onclick",this.dologin);this.objSetCkCheck.detachEvent("onclick",this.changeCookieCheck);}else{this.objUsername.removeEventListener("blur",this.checkUsername,true);this.objPassword.removeEventListener("focus",this.checkPassword,true);this.objPassword.removeEventListener("blur",this.checkPassword,true);}
var strPassword=this.objPassword.value;var strPwdOld;if(!this.isPwdFromCk||strPassword!=this.pwdFromCkTrim){if(this.curUserType==type163||this.curUserType==typeVip)
strPassword=this.pwd_js_string(strPassword);if(this.curUserType==type163||this.curUserType==typeVip){strPassword=strPassword.substring(0,16);}else if(this.curUserType==typePopo){strPassword=strPassword.substring(0,21);}
strPwdOld=strPassword;strPassword=hex_md5(strPassword);}else{strPassword=this.pwdFromCk;strPwdOld=strPassword;}
var strUsername=Trim(this.objUsername.value);var strUsernameOld=strUsername;strUsername+=getNameSuffix(this.curUserType);if(this.curUserType==type126||this.curUserType==type188||this.curUserType==typeYeah){strPassword=strPwdOld;}
if(this.objSetCkCheck.checked){clearLoginCookie();setLoginCookie(1,strUsernameOld);setLoginCookie(2,strPassword);}else{clearLoginCookie();}
setLoginCookie(0,this.curUserType);this.strUsername=strUsername;this.strPassword=strPassword;if(this.bFromIndex||this.presentShowId=="qIndexLoginDiv"){loginFromIndex(strUsername,strPassword);}else{UserBean.check(strUsername,strPassword,this.dologinCb.bind(this));}}
return false;},dologinCb:function(b){if(b!=null){if(b=="not reg!!"){window.open("http://blog.163.com/passportIn.do?in_username="+this.strUsername+"&in_password="+this.strPassword);}else{if(this.loginTarget==null){if($("$_oppoPageUrlForLogin")&&(UD.hostName==this.strUsername)){if(UD.hostPath=="")
this.loginTarget="http://"+DomainMap.getParentDomain(this.strUsername)+$("$_oppoPageUrlForLogin").value;else
this.loginTarget=$("$_oppoPageUrlForLogin").value;}
else
this.loginTarget=window.location.href;}
this.loginTarget=this.loginTarget.replace("{username}",this.strUsername)
location.href="http://blog.163.com/loginGate.do?username="+this.strUsername+"&target="+encodeURIComponent(this.loginTarget);}}else{this.objPassword.value="";this.objUsername.disabled=false;this.objPassword.disabled=false;this.divNotice.innerHTML="<span class='clr03'>用户名或密码不正确，请重新输入。</span>";$("in_username").focus();}
return false;},pwd_js_string:function(s){return String(s).replace(/\\/g,"\\\\").replace(/'/g,"\\\'").replace(/"/g,"\\\"");},updateSuffix:function(suffix){var e=$("account_suffix");e.innerHTML=suffix;},selectUserType:function(type){if(!this.bFromIndex){for(var i=0;i<6;i++){if($("tab_"+i)){if(type==i){if(!this.bFromIndex)
$("tab_"+i).className="g_f_hov selected";}else{if(!this.bFromIndex)
$("tab_"+i).className="g_f_hov";}}}}
var regAdd=$("reg_add");var getPassAdd=$("getPass_add");var innerLoginDiv=$("innerLoginDiv");var sbStr="bg_taglog";if(!this.bFromIndex){sbStr="bg_menu";}
if(!this.bFromIndex&&innerLoginDiv)
innerLoginDiv.style.backgroundImage="url(http://b.bst.126.net/style/common/index/"+sbStr+type+".gif)";if(this.bFromIndex){this.noticeInit="已开通网易博客的＂"+getShowLogName(type)+"＂用户直接登录";this.noticeAccount="请输入"+getShowLogName(type)+"用户名";}
else{this.noticeInit="请输入"+getShowLogName(type)+"用户名和密码登录";this.noticeAccount="请输入"+getShowLogName(type)+"用户名";}
if(type==type163){this.updateSuffix("@163.com");regAdd.href="http://reg.163.com/reg/reg0.jsp?url=http://blog.163.com/ntesRegBlank.html";getPassAdd.setAttribute("href","http://reg.163.com/RecoverPasswd1.shtml");}else if(type==type126){this.updateSuffix("@126.com");getPassAdd.setAttribute("href","http://reg.126.com/recoverpass/");}else if(type==typePopo){this.updateSuffix(".popo&nbsp;&nbsp;&nbsp;");regAdd.href="http://reg.popo.163.com/";getPassAdd.setAttribute("href","http://popo.163.com/prtpass/getpass.sp");getPassAdd.href="http://popo.163.com/prtpass/getpass.sp";}else if(type==type188){this.updateSuffix("@188.com");regAdd.href="http://reg.mail.188.com/index.jsp?from=";getPassAdd.setAttribute("href","http://reg.mail.188.com/rstpsw/rpsel.htm");}else if(type==typeVip){this.updateSuffix("@vip.163.com");regAdd.href="http://vip.163.com/register.m";getPassAdd.setAttribute("href","http://vip.163.com/PwdRepair/index.htm");}
else if(type==typeYeah){this.updateSuffix("@yeah.net");regAdd.href="http://reg.mail.yeah.net/reg/reg1.jsp";getPassAdd.setAttribute("href","http://reg.mail.yeah.net/reg/recoverpass/");}
$("reg_add").innerHTML="注册"+getShowRegName(type)+" -->";this.curUserType=type;this.objUsername.value="";this.objPassword.value="";var userNameInit=ckLoginInfo.name;if(userNameInit&&ckLoginInfo.type==type){this.objUsername.value=userNameInit;this.checkPasswordFocus();this.objSetCkCheck.checked=true;this.noticeAccount="请点击登录按钮";this.noticeInit="请点击登录按钮";}else{this.objSetCkCheck.checked=false;}
var urlStr=window.location.href;var i=urlStr.indexOf("err=");if(i!=-1){var errStr=urlStr.charAt(i+4);if(errStr=="1"||errStr=="2"||errStr=="3"||errStr=="4"){var n=parseInt(errStr);if(n>3)n=1;this.noticeInit=this.noticeAccount="<span class='cr'>"+errInfo[n-1]+"</span>";}}
this.checkUsername();if($("in_username"))try{Field.activate("in_username");}catch(e){};if(this.bFromIndex)showLoginType(type);return false;}}
function closeLogin(){$("loginNewDiv").style.display="none";}
function getLogStr(type){if(type==type163)
return"163";else if(type==typePopo)
return"POPO";else if(type==type126)
return"126";else if(type==type188)
return"188";else if(type==typeVip)
return"VIP";else if(type==typeYeah)
return"YEAH";}
function getNameSuffix(type){if(type==type163)
return"";else if(type==typePopo)
return".popo";else if(type==type126)
return"@126";else if(type==type188)
return"@188";else if(type==typeVip)
return".vip";else if(type==typeYeah)
return"@yeah";}
function getShowLogName(type){if(type==type163)
return"网易通行证";else if(type==typePopo)
return"POPO";else if(type==type126)
return"126邮箱";else if(type==type188)
return"188邮箱";else if(type==typeVip)
return"VIP邮箱";else if(type==typeYeah)
return"YEAH邮箱";}
function getShowRegName(type){if(type==type163)
return"通行证";else if(type==typePopo)
return"POPO";else if(type==type126)
return"126邮箱";else if(type==type188)
return"188邮箱";else if(type==typeVip)
return"VIP邮箱";else if(type==typeYeah)
return"YEAH邮箱";}
function getLoginCookie(){var a;var v=Cookie.get(ckLoginInfoKey);if(v){a=v.split("|");var type=null;if(a[0])
ckLoginInfo.type=parseInt(a[0]);if(ckLoginInfo.type==null||ckLoginInfo.type==undefined||ckLoginInfo.type<0||ckLoginInfo.type>4){ckLoginInfo.type=null;return;}
if(a[1]!=null&&a[1]!=undefined&&a[1]!="null"&&a[2]!=null&&a[2]!=undefined){ckLoginInfo.name=a[1];var pos=v.indexOf('|',2);ckLoginInfo.pass=v.substring(pos+1);}}}
function setLoginCookie(which,value){getLoginCookie();if(which==0)
ckLoginInfo.type=value;else if(which==1)
ckLoginInfo.name=value;else if(which==2)
ckLoginInfo.pass=value;Cookie.clear(ckLoginInfoKey,ckPath);Cookie.set(ckLoginInfoKey,ckLoginInfo.type+"|"+ckLoginInfo.name+"|"+ckLoginInfo.pass,30,ckPath,ckDomain);}
function clearLoginCookie(){ckLoginInfo.name=null;ckLoginInfo.pass=null;Cookie.clear(ckLoginInfoKey,ckPath);if(ckLoginInfo.type!=null&&ckLoginInfo.type!=undefined&&ckLoginInfo.type!="null")
Cookie.set(ckLoginInfoKey,ckLoginInfo.type,30,ckPath,ckDomain);}
var Cookie={set:function(name,value,expirationInDays,path,domain){var cookie=escape(name)+"="+escape(value);if(expirationInDays){var date=new Date();date.setDate(date.getDate()+expirationInDays);cookie+="; expires="+date.toGMTString();}
if(path){cookie+=";path="+path;}
if(domain){cookie+=";domain="+domain;}
document.cookie=cookie;if(value&&(expirationInDays==undefined||expirationInDays>0)&&!this.get(name)){return false;}},clear:function(name,path){this.set(name,"",-1,path,ckDomain);},get:function(name){var pattern="(^|;)\\s*"+escape(name)+"=([^;]+)";var m=document.cookie.match(pattern);if(m&&m[2]){return unescape(m[2]);}else{return null;}}}
var quicklogin_jst='<div>'+'   <form name="frmLogin"  id="frmLogin"  method="post">'+'      <div class="g_tab_btn03">'+'        <div class="g_f_hov"  id="tab_0">网易通行证</div>'+'       <div class="g_f_hov" id="tab_2">126邮箱</div>'+'       <div class="g_f_hov" id="tab_1">POPO</div>'+'       <div class="g_f_hov" id="tab_3">188邮箱</div>'+'       <div class="g_f_hov" id="tab_4">VIP邮箱</div>'+'       <div class="g_f_hov" id="tab_5">YEAH邮箱</div>'+'      </div>'+'      <!-- 通行证 -->'+'      <div class="case">'+'       <div class="mgntxt clr02" id="notice_bar" style="display-left:0px;"></div>'+'          <div class="input"><label for="text0">用户名：</label><input class="g_h_ipt" type="text" name="in_username" id="in_username"/>&nbsp;<span id="account_suffix">@163.com</span></div>'+'       <div class="input"><label for="text1">密　码：</label><input class="g_h_ipt" type="password" name="in_password" id="in_password"/>&nbsp;<a class="a_a d_d" href="http://reg.163.com/RecoverPasswd1.shtml" target="_blank" id="getPass_add">忘记密码了?</a></div>'+'       <div class="btnbar"><input type="checkbox"  name="setCookieCheck" id="setCookieCheck" ><label for="setCookieCheck">自动登录</label>&nbsp;<input type="button" class="btncm btnok" value="登录网易博客"  id="qLoginButt"/></div>'+'         </div>'+'      <div class="bottom">'+'        <span>还没有网易博客?</span>&nbsp;<input type="button" class="btncm btncc" id="regBtn" value="立即注册" onclick="window.open(\'http://reg.163.com/reg/reg0.jsp?url=http://blog.163.com/ntesRegBlank.html\');" />'+'      </div>'+'   </form><span id="reg_add" style="display:none;" href="#">ww</span>'+'</div>';
if (UserBean == null) var UserBean = {};
UserBean._path = '/dwr';
UserBean.clearSession=function(callback){DWREngine._execute(UserBean._path,'UserBean','clearSession',false,callback);}
UserBean.check=function(p0,p1,callback){DWREngine._execute(UserBean._path,'UserBean','check',p0,p1,false,false,false,callback);}
UserBean.getProvinceAndCity=function(callback){DWREngine._execute(UserBean._path,'UserBean','getProvinceAndCity',false,false,callback);}
NetEase.QuickLoginOther=NetEase.QuickLogin
NetEase.QuickLoginOther.prototype.showWindow=function(){var clientHeight=document.documentElement.clientHeight;var scrollTop=document.documentElement.scrollTop;if(this!=top){try{scrollTop=top.document.documentElement.scrollTop;clientHeight=top.document.documentElement.clientHeight;}catch(e){}}
var posTop=scrollTop+(clientHeight-400)/2;if(posTop<10)
posTop=10;var left=(document.documentElement.clientWidth-600)/2;if(left<10)
left=10;$("$_qLoginDiv").style.left=left+"px";$("$_qLoginDiv").style.top=posTop+"px";$("$_qLoginDiv").style.display="";}
function fnLoadInitOther(){new NetEase.QuickLoginOther(null,null,true,{err:false});}

if (UD==null)var UD={}
UD.body=$("_$$_inner_layer");
UD.layer=$("_$$_outer_layer");
UD.window=$("blog-163-com-body");
UD.bar=$("theme_selector_pointer");
	

if(NetEase==undefined){var NetEase={};}
NetEase.DwrLogger=Class.create();NetEase.DwrLogger.prototype={initialize:function(){this.options=Object.extend({fade:true,style:'http://b.bst.126.net/style/common',relativeId:false,width:200,opacity:0.80,timeout:3000,delay:1500},arguments[0]||{});this._init();this.loggerIndex=-1;this.cacheLogger=[];},_init:function(){this.loggerZone=$('$_loggerZone');if(!this.loggerZone){this.loggerZone=document.createElement('div');this.loggerZone.setAttribute('id','$_loggerZone');this.loggerZone.style.position="absolute";this.loggerZone.style.zIndex="100019";var offset=0;if(this.options.relativeId&&$(this.options.relativeId)){offset=$(this.options.relativeId).offsetLeft;}
this.loggerZone.style.left=document.documentElement.scrollLeft+
document.documentElement.clientWidth-this.options.width-offset-20+'px';this.loggerZone.style.top=document.documentElement.scrollTop+25+'px';document.body.appendChild(this.loggerZone);var callback=this._onResizeOb.bind(this);if(window.attachEvent){window.attachEvent('onresize',callback);window.attachEvent('onscroll',callback)}else{window.addEventListener('resize',callback,false);window.addEventListener('scroll',callback,false);}}},_onResizeOb:function(){if(this.loggerZone){var offset=0;if(this.options.relativeId&&$(this.options.relativeId)){offset=$(this.options.relativeId).offsetLeft;}
this.loggerZone.style.left=document.documentElement.scrollLeft+
document.documentElement.clientWidth-this.options.width-offset-20+'px';this.loggerZone.style.top=document.documentElement.scrollTop+25+'px';}},appendMsg:function(msg,type){this.loggerIndex++;var logger={};logger.id="$_loggerMsg"+this.loggerIndex;logger.msg=msg;logger.type=type;var messageZone=document.createElement('div');messageZone.setAttribute('id',logger.id);if(logger.type=="info"){messageZone.innerHTML='<img src="'+this.options.style+'/ico_info.gif"/>&nbsp;'+msg;}else
if(logger.type=="ok"){messageZone.innerHTML='<img src="'+this.options.style+'/ico_confirm.gif"/>&nbsp;'+msg;}
else
if(logger.type=="error"){messageZone.innerHTML='<img src="'+this.options.style+'/ico_error.gif"/>&nbsp;'+msg;}else
messageZone.innerHTML='<img src="'+this.options.style+'/ico_info.gif"/>&nbsp;'+msg;messageZone.style.display="block";messageZone.style.backgroundColor="#ffffff";messageZone.style.margin="5px";messageZone.style.padding="2px";messageZone.style.textAlign="left";messageZone.style.MozOpacity=this.options.opacity+"";messageZone.style.filter="alpha(opacity="+this.options.opacity*100+")";messageZone.style.width=this.options.width+'px';this.loggerZone.insertBefore(messageZone,this.loggerZone.firstChild);this.cacheLogger.push(logger);if(!this.toFadeCheck)
this.toFadeCheck=window.setTimeout(this._clean.bind(this,logger),this.options.timeout);},_clean:function(logger){if(this.options.fade){if($(logger.id)){Effect.Fade(logger.id,{duration:0.5,userCallBack:this._remove.bind(this,logger)});}}else{this._remove(logger);}},_remove:function(logger){if($(logger.id)){$(logger.id).innerHTML='';$(logger.id).style.display='none';this.loggerZone.removeChild($(logger.id));this.cacheLogger.shift(logger);if(this.cacheLogger.length>0){logger=this.cacheLogger[0];this.toFadeCheck=window.setTimeout(this._clean.bind(this,logger),this.options.delay);}else{this.toFadeCheck=null;}}}}
NetEase.DwrLogger.TYPE_INFO="info";NetEase.DwrLogger.TYPE_OK="ok";NetEase.DwrLogger.TYPE_ERROR="error";
if(NetEase==undefined){var NetEase={};}
NetEase.CachePage=Class.create();NetEase.CachePage.prototype={initialize:function(){this.options=Object.extend({loadFunc:Prototype.emptyFunction,loadParam:{},presentFunc:Prototype.emptyFunction,presentSlideFunc:Prototype.emptyFunction,filterFunc:Prototype.emptyFunction,organizeFunc:function(list){return list},userPresentFuncParam:{},pageSize:0,prefetchMulti:1,prefetch:false,markID:'',customPageIds:false,totalSize:-1,styleDir:null,onlyLoadOnce:false,beforeID:'',beforePrev:Prototype.emptyFunction,beforeNext:Prototype.emptyFunction,detSlideIterator:Prototype.emptyFunction,delIterator:Prototype.emptyFunction,updateIterator:Prototype.emptyFunction,needRefreshAfterUpdate:true,RefreshAfterAdd:true,initData:false},arguments[0]||{});this.cacheData=[];this.markIDArray=[];this._initial();this.bMarkFirst=true;},setUserPresetFuncParam:function(param){this.options.userPresentFuncParam=param;},reset:function(){this.cacheData=[];if(this.options.totalSize!=-1)
this.lastPage=1;else
this.lastPage=0;this.curPage=0;this.canNext=false;this.canPrev=false;this.getState=1;this.isEnd=true;this.loadCount=0;this._generateMark();},_loadMoreDataFunc:function(type){if(this.curPage<0)
this.curPage=0;this.options.loadParam.offset=this.cacheData.length-((this.options.initData)?this.options.initData.length:0);this.options.loadParam.limit=((this.options.prefetch)?this.options.prefetchMulti:0)*this.options.pageSize+((this.curPage+1)*this.options.pageSize-this.cacheData.length);if(type==0)
this.options.loadFunc(this.options.loadParam,this._mergeDataFunc.bind(this));else
this.options.loadFunc(this.options.loadParam,this._mergeMoreDataFunc.bind(this));},_mergeDataFunc:function(dataList){dataList=this.options.organizeFunc(dataList);if(dataList==null||dataList.length==0){this.canNext=false;this.getState=0;if(this.isEnd==true){this._generateMark();return false;}}
else if(dataList.length<((this.curPage+1)*this.options.pageSize-this.cacheData.length)){this.canNext=false;this.getState=0;}else if(dataList.length<this.options.loadParam.limit){this.canNext=true;this.getState=0;}else{this.canNext=true;this.getState=1;}
this.curPage++;if(this.lastPage&&this.curPage>this.lastPage)
this.lastPage=this.curPage;this.options.filterFunc(dataList);dataList.each(this._iterator.bind(this));this._generateMark();this._presentTemplate();},_mergeMoreDataFunc:function(dataList){dataList=this.options.organizeFunc(dataList);if(dataList==null||dataList.length<=this.curPage*this.options.pageSize-this.cacheData.length){this.canNext=false;this.getState=0;}else if(dataList.length<((this.curPage+1)*this.options.pageSize-this.cacheData.length)){this.canNext=true;this.getState=0;}else if(dataList.length<this.options.loadParam.limit){this.canNext=true;this.getState=0;}else{this.canNext=true;this.getState=1;}
this.options.filterFunc(dataList);dataList.each(this._iterator.bind(this));this._generateMark();this._presentTemplate();},_iterator:function(e){this.cacheData.push(e);},nextPage:function(){if(!this.canNext)
return false;this.canNext=false;var canGetMore=true;if(this.options.onlyLoadOnce&&this.loadCount>=1)
canGetMore=false;if((this.curPage+1)*this.options.pageSize>this.cacheData.length&&this.getState==1&&canGetMore){this.loadCount++;this._loadMoreDataFunc(0);}else{if(this.curPage*this.options.pageSize<this.cacheData.length){this.canNext=true;if(this.getState==0&&(this.curPage+1)*this.options.pageSize>=this.cacheData.length)
this.canNext=false;this.curPage++;}
this._generateMark();this._presentTemplate();}},prevPage:function(){if(!this.canPrev)
return false;this.canPrev=false;this.curPage--;if(this.curPage<=1)
this.curPage=1;this.canNext=true;this._generateMark();this._presentTemplate();},refreshCurPage:function(bRefreshPage){this._setSlideMode(false);if(bRefreshPage==true){this.is_first_load=null;}
this._generateMark();this._presentTemplate();},selectPage:function(page){if(page<1)
page=1;if(page>this.curPage){this._setSlideMode(false);this.nextPage();return;}
if(page<this.curPage){if(page>1)
this.canPrev=true;else
this.canPrev=false;this.canNext=true;this.curPage=page;}
this.refreshCurPage();},_generateMark:function(){this._generateMarkData();this._generateMarkHTML();this._registerCachePageEvent();},_presentTemplate:function(){if(this.slideMode==true){this.options.presentSlideFunc(this.cacheData[this.curDataIndex],this.options.userPresentFuncParam);}else{this.options.presentFunc(this._prepareForPresent(),this.options.userPresentFuncParam);}},_prepareForPresent:function(){var result=[];if(this.cacheData.length<=(this.curPage-1)*this.options.pageSize){if(this.curPage>1){this.curPage--;this._generateMark();}}
var i=0;for(i=(this.curPage-1)*this.options.pageSize;i<this.curPage*this.options.pageSize&&i<this.cacheData.length;i++)
result.push(this.cacheData[i]);if(i==this.cacheData.length)
this.isEnd=true;else
this.isEnd=false;return result;},_clickPrev:function(sId){if(sId!=null&&this.beforeIDArray!=null){for(var i=0;i<this.beforeIDArray.length;i++){if(this.beforeIDArray[i]==sId){this.options.beforePrev();}}}
this.op="prev";this.prevPage();return false;},_clickNext:function(sId){if(sId!=null&&this.beforeIDArray!=null){for(var i=0;i<this.beforeIDArray.length;i++){if(this.beforeIDArray[i]==sId){this.options.beforeNext();}}}
this.op="next";this.nextPage();return false;},removeOne:function(item,notRefresh){var removed=this.cacheData.select(this._rejectIter.bind(this,item));this._removeItem(item);this._afterRemove(1,notRefresh);return removed;},removeItems:function(itemList,notRefresh){itemList.each(this._removeItem.bind(this));this._afterRemove(itemList.length,notRefresh);},_removeItem:function(item){this.cacheData=this.cacheData.reject(this._rejectIter.bind(this,item));},_afterRemove:function(count,notRefresh){if(this.curPage>1&&this.cacheData.length%this.options.pageSize==0){this.curPage--;}
if(this.options.totalSize>(-1)*count){this.options.totalSize-=count;this.lastPage=this._getTotalSize();}
if(this.canNext){if(this.isEnd&&this.getState==1){this._loadMoreDataFunc(1);}else{if(notRefresh!=true){this._generateMark();this._presentTemplate();}}}else{if(notRefresh!=true){this._generateMark();this._presentTemplate();}}},_rejectIter:function(item,e){return this.options.delIterator(item,e);},getSelectSlide:function(){return this.cacheData[this.curDataIndex];},changeToSlideMode:function(item){var data=this.cacheData.detect(this._detectItr.bind(this,item));if(data){this._setSlideMode(true);this._generateMark();this._presentTemplate();}},_detectItr:function(item,e,index){var value=this.options.detSlideIterator(item,e);if(value){this.curDataIndex=index;return true;}
return false;},_slideNext:function(){if(!this.canNextSlide)
return false;this.canNextSlide=false;if(this.options.totalSize>-1){if(this.curDataIndex>=(this.options.totalSize-1)){this._generateMark();return false;}}
this.curDataIndex++;this._setSlideMode(true);if(this.curDataIndex%this.options.pageSize==0){this.nextPage();}else{this._generateMark();this._presentTemplate();}
return false;},_slidePrev:function(){if(!this.canPrevSlide)
return false;this.canPrevSlide=false;if(this.curDataIndex<=0){this._generateMark();return false;}
this.curDataIndex--;this._setSlideMode(true);if(this.curDataIndex%this.options.pageSize==(this.options.pageSize-1)){this.prevPage();}else{this._generateMark();this._presentTemplate();}
return false;},_setSlideMode:function(isSlide){if(isSlide==true){this.slideMode=true;}else{this.slideMode=false;}},addOne:function(item,head,notRefresh){if(head){var temp=[];temp.push(item);this.options.filterFunc(temp);this.cacheData.unshift(item);}
else{var temp=[];temp.push(item);this.options.filterFunc(temp);this.cacheData.push(item);}
if(this.cacheData.length>this.curPage*this.options.pageSize){if(!this.canNext){this.canNext=true;}}
if(this.options.totalSize>-1){this.options.totalSize++;this.lastPage=this._getTotalSize();}
if(this.options.RefreshAfterAdd){if(notRefresh!=true){this._generateMark();this._presentTemplate();}}},getAllCachedData:function(){return this.cacheData;},updateOne:function(item,notRefresh){this.cacheData.each(this._updateIter.bind(this,item));if(notRefresh!=true){this._generateMark();if(this.options.needRefreshAfterUpdate)
this._presentTemplate();}},_updateIter:function(item,e,index){if(this.options.updateIterator(item,e)){Object.extend(this.cacheData[index],item);}},getCurPage:function(){return this.curPage;},getPageSize:function(){return this.options.pageSize;},getTotalSize:function(){return this.options.totalSize;},_getTotalSize:function(){var d=(this.options.totalSize%this.options.pageSize==0)?0:1;var r=parseInt(this.options.totalSize/this.options.pageSize+d+'');if(r<1)
r=1;return r;},_initial:function(){if(this.options.totalSize>-1)
this.lastPage=this._getTotalSize();this.curPage=0;this.canNext=true;this.canPrev=false;this.getState=1;this.isEnd=false;this.loadCount=0;if(this.options.markID)
this.markIDArray=this.options.markID.split(":");if(this.options.beforeID)
this.beforeIDArray=this.options.beforeID.split(":");if(this.options.initData){this.options.initData.each(this._iterator.bind(this));}},initCacheData:function(dataList,isListEnd){dataList=this.options.organizeFunc(dataList);if(dataList==null||dataList.length==0){this.canNext=false;this.getState=0;}
else if(dataList.length<((this.curPage+1)*this.options.pageSize-this.cacheData.length)){this.canNext=false;this.getState=0;}else{this.canNext=true;if(isListEnd)
this.getState=0;else
this.getState=1;}
this.curPage++;if(this.lastPage&&this.curPage>this.lastPage)
this.lastPage=this.curPage;this.options.filterFunc(dataList);dataList.each(this._iterator.bind(this));this._generateMark();this._presentTemplate();},_generateMarkData:function(){if(this.curPage>1)
this.canPrev=true;else
this.canPrev=false;if(this.curPage<1)
this.curPage=1;if(this.lastPage&&this.curPage>this.lastPage)
this.curPage=this.lastPage;if(this.lastPage){if(!this.canNext)
this.lastPage=this.curPage;if(this.curPage==this.lastPage)
this.canNext=false;}
if(this.slideMode==true){if(this.canNext)
this.canNextSlide=true;else{if(this.cacheData[this.curDataIndex+1]==null)
this.canNextSlide=false;else
this.canNextSlide=true;}
if(this.canPrev)
this.canPrevSlide=true;else{if(this.cacheData[this.curDataIndex-1]==null)
this.canPrevSlide=false;else
this.canPrevSlide=true;}}},_generateMarkHTML:function(){if(this.options.customPageIds){if(this.slideMode==true){if(this.canPrevSlide)
$(this.options.customPageIds[0]).style.visibility="visible";else
$(this.options.customPageIds[0]).style.visibility="hidden";if(this.canNextSlide)
$(this.options.customPageIds[1]).style.visibility="visible";else
$(this.options.customPageIds[1]).style.visibility="hidden";}else{if(this.canPrev)
$(this.options.customPageIds[0]).style.visibility="visible";else
$(this.options.customPageIds[0]).style.visibility="hidden";if(this.canNext)
$(this.options.customPageIds[1]).style.visibility="visible";else
$(this.options.customPageIds[1]).style.visibility="hidden";}}
if(this.options.markID){if(this.is_first_load==null){this.markIDArray.each((function(a){return function(markId){if($(markId)){var innerHTML='<span id="$$_prev_img_'+markId+'" style="cursor:pointer">上页</span>'+'<span id="$$_num'+markId+'">&nbsp;'+a.curPage;if(a.lastPage){innerHTML+='/'+a.lastPage;}
innerHTML+='&nbsp;</span><span id="$$_next_img_'+markId+'" style="cursor:pointer">下页</span>';$(markId).innerHTML=innerHTML;}};})(this));this.is_first_load=true;}else{this.markIDArray.each((function(a){return function(markId){if($(markId)){var innerHTML='&nbsp;'+a.curPage;if(a.lastPage){innerHTML+='/'+a.lastPage;}
innerHTML+='&nbsp;';$('$$_num'+markId).innerHTML=innerHTML;}};})(this));}
this._adjustStyle();}},_adjustStyle:function(){this.markIDArray.each((function(a){return function(markId){if($(markId)){$('$$_prev_img_'+markId).style.cursor=(a.canPrev)?'pointer':'';$('$$_next_img_'+markId).style.cursor=(a.canNext)?'pointer':'';}};})(this));},_registerCachePageEvent:function(){if(this.slideMode==true){if(this.options.customPageIds){if(this.register_custom_event_is!="slideevent"){$(this.options.customPageIds[0]).onclick=this._slidePrev.bind(this);$(this.options.customPageIds[1]).onclick=this._slideNext.bind(this);this.register_custom_event_is="slideevent";}}
if(this.options.markID){if(this.register_mark_event_is!="slideevent"){this.markIDArray.each((function(a){return function(markId){if($(markId)){$('$$_prev_img_'+markId).onclick=a._slidePrev.bind(a,markId);$('$$_next_img_'+markId).onclick=a._slideNext.bind(a,markId);this.register_mark_event_is="slideevent";}};})(this));}}}else{if(this.options.customPageIds){if(this.register_custom_event_is!="notslideevent"){$(this.options.customPageIds[0]).onclick=this._clickPrev.bind(this);$(this.options.customPageIds[1]).onclick=this._clickNext.bind(this);this.register_custom_event_is="notslideevent";}}
if(this.options.markID){if(this.register_mark_event_is!="notslideevent"){this.markIDArray.each((function(a){return function(markId){if($(markId)){$('$$_prev_img_'+markId).onclick=a._clickPrev.bind(a,markId);$('$$_next_img_'+markId).onclick=a._clickNext.bind(a,markId);this.register_mark_event_is="notslideevent";}};})(this));}}}},resetCachePageEvent:function(){this.register_mark_event_is=null;this.register_custom_event_is=null;}}

if(typeof Array.prototype.splice==='undefined'){Array.prototype.splice=function(ind,cnt)
{if(arguments.length==0){return ind;}
if(typeof ind!="number"){ind=0;}
if(ind<0){ind=Math.max(0,this.length+ind);}
if(ind>this.length){if(arguments.length>2){ind=this.length;}
else{return[];}}
if(arguments.length<2){cnt=this.length-ind;}
cnt=(typeof cnt=="number")?Math.max(0,cnt):0;removeArray=this.slice(ind,ind+cnt);endArray=this.slice(ind+cnt);this.length=ind;for(var i=2;i<arguments.length;i++){this[this.length]=arguments[i];}
for(i=0;i<endArray.length;i++){this[this.length]=endArray[i];}
return removeArray;}}
if(typeof Array.prototype.shift==='undefined'){Array.prototype.shift=function(str){var val=this[0];for(var i=1;i<this.length;++i){this[i-1]=this[i];}
this.length--;return val;}}
if(typeof Array.prototype.unshift==='undefined'){Array.prototype.unshift=function(){var i=unshift.arguments.length;for(var j=this.length-1;j>=0;--j){this[j+i]=this[j];}
for(j=0;j<i;++j){this[j]=unshift.arguments[j];}}}
if(typeof Array.prototype.push==='undefined'){Array.prototype.push=function(){var sub=this.length;for(var i=0;i<push.arguments.length;++i){this[sub]=push.arguments[i];sub++;}}}
if(typeof Array.prototype.pop==='undefined'){Array.prototype.pop=function(){var lastElement=this[this.length-1];this.length--;return lastElement;}}



if(NetEase==undefined){var NetEase={};}
NetEase.PageNumber=Class.create();NetEase.PageNumber.prototype={initialize:function(){this.options=Object.extend({loadFunc:Prototype.emptyFunction,loadParam:{},presentFunc:Prototype.emptyFunction,filterFunc:Prototype.emptyFunction,userPresentFuncParam:{},pageSize:0,prefetchMulti:1,markID:'',totalSize:-1,beforeID:'',beforePrev:Prototype.emptyFunction,beforeNext:Prototype.emptyFunction,beforeChange:Prototype.emptyFunction,delIterator:Prototype.emptyFunction,updateIterator:Prototype.emptyFunction,needRefreshAfterUpdate:true,RefreshAfterAdd:true,RefreshAfterDel:true,useCache:true,isDiv:false},arguments[0]||{});this.totalPages=0;this.curPage;this.cacheData=[];this.markIDArray=[];this.beforeIDArray=[];this._iTextSpanWidth;this._init();},_init:function(){if(this.options.totalSize>-1)
this.totalPages=this._getTotalPages();this.curPage=1;if(this.options.markID)
this.markIDArray=this.options.markID.split(":");if(this.options.beforeID)
this.beforeIDArray=this.options.beforeID.split(":");},reset:function(){this.cacheData=[];this.curPage=1;this.options.totalSize=0;this.totalPages=1;this._generateMarks();},initCacheData:function(oData){this.options.filterFunc(oData);if(this.options.useCache){for(var i=0;i<oData.length;i++){this.cacheData[i]=oData[i];}}},getAllCachedData:function(){var datas=[];this.cacheData.each(function(e){if(e!=null){datas.push(e)}})
return datas;},getTotalPages:function(){return this.totalPages;},getCurPageNum:function(){return this.curPage;},getCurOffset:function(){return this.options.pageSize*(this.curPage-1);},getTotalSize:function(){return this.options.totalSize;},refreshCurPage:function(){this.show();},nextPage:function(){this.curPage++;if(this.curPage>this.totalPages)
this.curPage=this.totalPages;this.show();return false;},prevPage:function(){this.curPage--;if(this.curPage<1)
this.curPage=1;this.show();return false;},setPageSize:function(iSize){this.options.pageSize=iSize;},show:function(){var _iOffset=this.options.pageSize*(this.curPage-1);var _iLimit=this.options.pageSize;if(this.options.useCache){var _data=this._hasFullData(_iOffset,_iLimit)
if(_data!=null){this._display(_data);}else{this.options.loadParam.offset=_iOffset;this.options.loadParam.limit=_iLimit*(this.options.prefetchMulti?this.options.prefetchMulti:1);this.options.loadFunc(this.options.loadParam,this._display.bind(this));}}else{this.options.loadParam.offset=_iOffset;this.options.loadParam.limit=_iLimit;this.options.loadFunc(this.options.loadParam,this._display.bind(this));}},_display:function(oData){if(oData==null||oData.length==0){if(this.curPage>1){this.curPage--;this.options.totalSize=this.curPage*this.options.pageSize;this.totalPages=this._getTotalPages();this.cacheData=[];this.show();return false;}}
this.options.filterFunc(oData);if(this.options.useCache){var _iOffset=this.options.pageSize*(this.curPage-1);for(var i=0;i<oData.length;i++){this.cacheData[_iOffset+i]=oData[i];}}
this.options.presentFunc(oData.slice(0,this.options.pageSize),this.options.userPresentFuncParam);this._generateMarks();},_hasFullData:function(iOffset,iLimit){var _oDataDisplay=[];var _iLen=iOffset+iLimit>this.options.totalSize?this.options.totalSize-iOffset:iLimit;for(var i=0;i<_iLen;i++){var _oData=this.cacheData[iOffset+i];if(_oData==undefined||_oData==null)
return null;_oDataDisplay[i]=_oData;}
return _oDataDisplay;},_generateMarks:function(){var _iMarkLen=this.markIDArray.length;for(var i=0;i<_iMarkLen;i++){var markId=this.markIDArray[i];var _oMark=$(markId);if(_oMark){_oMark.innerHTML=this._generateHTML(markId);this._setUIEvent(markId);}}
return false;},_getTotalPages:function(){if(this.options.pageSize==0){return 1;}
var _iLast=(this.options.totalSize%this.options.pageSize==0)?0:1;var _iPages=parseInt(this.options.totalSize/this.options.pageSize+_iLast+'');if(_iPages<1)
_iPages=1;return _iPages;},goToPage:function(iPageIndex){if(iPageIndex>this.totalPages||iPageIndex<1)
return;this.curPage=iPageIndex;this.show();},addOne:function(item,head,notRefresh){if(this.options.totalSize>-1){this.options.totalSize++;this.totalPages=this._getTotalPages();}
if(this.options.useCache){if(head){this.cacheData.unshift(item);}else{this.cacheDate[this.options.totalSize-1]=item;}}
if(this.options.RefreshAfterAdd&&notRefresh!=true){this.show();}},removeOne:function(item,notRefresh){var removed=null;if(this.options.useCache){removed=this._removeItem(item);}
this._afterRemove(1,notRefresh);return removed;},removeItems:function(items,notRefresh){if(this.options.useCache){items.each(this._removeItem.bind(this));}
this._afterRemove(items.length,notRefresh);},_removeItem:function(item){var index=-1;for(var i=0;i<this.options.totalSize;i++){if(this.cacheData[i]==undefined||this.cacheData[i]==null)
continue;if(this.options.delIterator(item,this.cacheData[i])){index=i;break;}}
if(index==-1){return null;}
var removed=this.cacheData[index];if(index+1<this.options.totalSize){this.cacheData[index]=this.cacheData[index+1];this.cacheData[index+1]=null;}else{this.cacheData[index]=null;}
for(++index;index<this.options.totalSize-1;index++){if(this.cacheData[index+1]!=undefined&&this.cacheData[index+1]!=null){this.cacheData[index]=this.cacheData[index+1];this.cacheData[index+1]=null;}}
return removed;},_afterRemove:function(len,notRefresh){if(this.options.totalSize>-1){this.options.totalSize-=len;this.totalPages=this._getTotalPages();}
if(this.curPage==this.totalPages+1&&this.options.totalSize%this.options.pageSize==0){this.curPage--;}
if(this.options.RefreshAfterDel&&notRefresh!=true){this.show();}},updateOne:function(oItem,bNotRefresh){if(this.options.useCache){var _iOffset=this.options.pageSize*(this.curPage-1);var index=-1;for(var i=0;i<this.options.pageSize;i++){if(this.options.updateIterator(oItem,this.cacheData[i+_iOffset])){index=i+_iOffset;break;}}
if(index==-1){this.cacheData=[];return;}
Object.extend(this.cacheData[index],oItem);}
if(bNotRefresh!=true&&this.options.needRefreshAfterUpdate){this.show();}},_generateHTML:function(sMarkId){var s=[];if(this.totalPages==this.curPage){s.push('<div class="updownPageNolink c09"><span>下页</span></div>');}else{if(this.options.isDiv==false)
s.push('<div style="float:right;" class="c06"><a href="#" class="updownPage" id="$$_next_'+sMarkId+'">下页</a></div>');else
s.push('<div style="float:right;" class="divTxtColr"><a href="#" class="updownPage" id="$$_next_'+sMarkId+'">下页</a></div>');}
s.push('<div class="pageSelect floatRight">');s.push('<div id="$$_textBorder_'+sMarkId+'" class="textBorder">');if(this.options.isDiv==false)
s.push('<span id="$$_pageText_'+sMarkId+'" class="pageText c06">'+this.curPage+'/'+this.totalPages+'</span>');else
s.push('<span id="$$_pageText_'+sMarkId+'" class="pageText divTxtColr">'+this.curPage+'/'+this.totalPages+'</span>');s.push('</div>');s.push('<div id="$$_opt_'+sMarkId+'" class="opt" style="display:none;">');for(var i=1;i<=this.totalPages;i++){s.push('<a href="#">');s.push(i);s.push('</a>');}
s.push('</div></div>');if(this.curPage==1){s.push('<div class="updownPageNolink c09"><span>上页</span></div>');}else{if(this.options.isDiv==false)
s.push('<div style="float:right;" class="c06"><a href="#" class="updownPage" id="$$_prev_'+sMarkId+'">上页</a><div>');else
s.push('<div style="float:right;" class="divTxtColr"><a href="#" class="updownPage" id="$$_prev_'+sMarkId+'">上页</a><div>');}
return s.join('');},_setUIEvent:function(sMarkId){if(this.curPage!=1){var _oPrev=$('$$_prev_'+sMarkId);_oPrev.onclick=this._clickPrev.bind(this,sMarkId);_oPrev.onmouseover=this.updownPageMouseOvr.bind(this,_oPrev);_oPrev.onmouseout=this.updownPageMouseOut.bind(this,_oPrev);}
if(this.totalPages!=this.curPage){var _oNext=$('$$_next_'+sMarkId);_oNext.onclick=this._clickNext.bind(this,sMarkId);_oNext.onmouseover=this.updownPageMouseOvr.bind(this,_oNext);_oNext.onmouseout=this.updownPageMouseOut.bind(this,_oNext);}
var _oTextBorder=$('$$_textBorder_'+sMarkId);var _oPageText=$('$$_pageText_'+sMarkId);var _opt=$('$$_opt_'+sMarkId);var _optA=_opt.getElementsByTagName("a");this._iTextSpanWidth=_oPageText.offsetWidth;_oTextBorder.style.width=this._iTextSpanWidth+18+"px";_opt.style.width=this._iTextSpanWidth+18+"px";_opt.onmouseover=function(){var _oA=_optA[this.curPage-1];_oA.className="";}.bind(this);if(isIE){_oTextBorder.attachEvent("onclick",function(){if(_opt.style.display=="none"){this.closeAllPopup();var _oChildren=document.body.childNodes;var _iChildLen=_oChildren.length;var m=null;for(var k=_iChildLen-1;k>=0;k--){if('$$_opt_'+sMarkId==_oChildren[k].id){m=_oChildren[k];break;}}
if(m!=null){document.body.removeChild(m);}
document.body.appendChild(_opt);_opt.style.display="block";_opt.scrollTop=(this.curPage-1)*14;var _oA=_optA[this.curPage-1];_oA.className="ttt";var _oPageOffset=Position.cumulativeOffset(_oTextBorder);var iPageTopOffset=_oPageOffset[1]-document.documentElement.scrollTop;var iPageBottomOffset=document.documentElement.clientHeight-iPageTopOffset;if(_opt.offsetHeight>iPageBottomOffset){_opt.style.left=_oPageOffset[0]+"px";_opt.style.top=_oPageOffset[1]-_opt.offsetHeight+"px";}else{_opt.style.left=_oPageOffset[0]+"px";_opt.style.top=_oPageOffset[1]+18+"px";}
window.event.cancelBubble=true;}else{_opt.style.display="none";}
return false;}.bind(this));_oTextBorder.attachEvent("onmouseover",this.textBorderMouseOvr.bind(this,_oTextBorder));_oTextBorder.attachEvent("onmouseout",this.textBorderMouseOut.bind(this,_oTextBorder,sMarkId));for(var i=0,_a;_a=_optA[i];i++){_a.onclick=this.clickPageNumber.bind(this,sMarkId,_a.innerHTML,_opt,_oTextBorder);}
window.document.attachEvent("onclick",function(){_opt.style.display="none";_oTextBorder.className="textBorder";_oTextBorder.style.width=this._iTextSpanWidth+18+"px";}.bind(this));}else{_oTextBorder.addEventListener("click",function(oEvent){if(_opt.style.display=="none"){this.closeAllPopup();var _oChildren=document.body.childNodes;var _iChildLen=_oChildren.length;var m=null;for(var k=_iChildLen-1;k>=0;k--){if('$$_opt_'+sMarkId==_oChildren[k].id){m=_oChildren[k];break;}}
if(m!=null){document.body.removeChild(m);}
document.body.appendChild(_opt);_opt.style.display="block";_opt.scrollTop=(this.curPage-1)*14;var _oA=_optA[this.curPage-1];_oA.className="ttt";var _oPageOffset=Position.cumulativeOffset(_oTextBorder);var iPageTopOffset=_oPageOffset[1]-document.documentElement.scrollTop;var iPageBottomOffset=document.documentElement.clientHeight-iPageTopOffset;if(_opt.offsetHeight>iPageBottomOffset){_opt.style.left=_oPageOffset[0]+"px";_opt.style.top=_oPageOffset[1]-_opt.offsetHeight+"px";}else{_opt.style.left=_oPageOffset[0]+"px";_opt.style.top=_oPageOffset[1]+18+"px";}
oEvent.stopPropagation();}else{_opt.style.display="none";}
return false;}.bind(this),false);_oTextBorder.addEventListener("mouseover",this.textBorderMouseOvr.bind(this,_oTextBorder),false);_oTextBorder.addEventListener("mouseout",this.textBorderMouseOut.bind(this,_oTextBorder,sMarkId),false);for(var i=0,_a;_a=_optA[i];i++){_a.onclick=this.clickPageNumber.bind(this,sMarkId,_a.innerHTML,_opt,_oTextBorder);}
window.document.addEventListener("click",function(){_opt.style.display="none";_oTextBorder.className="textBorder";_oTextBorder.style.width=this._iTextSpanWidth+18+"px";}.bind(this),false);}
return false;},_clickPrev:function(sMarkId){window.location.hash='pn'+(this.curPage-1);if(sMarkId!=null&&this.beforeIDArray!=null){for(var i=0;i<this.beforeIDArray.length;i++){if(this.beforeIDArray[i]==sMarkId){this.options.beforePrev();}}}
this.closeAllPopup();this.prevPage();return false;},_clickNext:function(sMarkId){window.location.hash='pn'+(this.curPage+1);if(sMarkId!=null&&this.beforeIDArray!=null){for(var i=0;i<this.beforeIDArray.length;i++){if(this.beforeIDArray[i]==sMarkId){this.options.beforeNext();}}}
this.closeAllPopup();this.nextPage();return false;},closeAllPopup:function(){var _iMarkLen=this.markIDArray.length;for(var i=0;i<_iMarkLen;i++){var markId=this.markIDArray[i];var _opt=$('$$_opt_'+markId);_opt.style.display="none";}},clickPageNumber:function(sMarkId,iIndex,oOpt,oTextBorder){window.location.hash='pn'+iIndex;oOpt.style.display="none";oTextBorder.className="textBorder";if(iIndex==this.curPage){return false;}
if(sMarkId!=null&&this.beforeIDArray!=null){for(var i=0;i<this.beforeIDArray.length;i++){if(this.beforeIDArray[i]==sMarkId){this.options.beforeChange();}}}
this.goToPage(iIndex);return false;},textBorderMouseOvr:function(oElem){oElem.className="textBorderMouseOvr";oElem.style.width=this._iTextSpanWidth+16+"px";},textBorderMouseOut:function(oElem,sMarkId){var _opt=$('$$_opt_'+sMarkId);if(_opt.style.display=="none"){oElem.className="textBorder";oElem.style.width=this._iTextSpanWidth+18+"px";}},updownPageMouseOvr:function(oElem){oElem.className="updownPageMouseOvr";},updownPageMouseOut:function(oElem){oElem.className="updownPage";},pirntData:function(){var s=[];s+=this.options.totalSize+"-------------\n";for(var i=0;i<this.options.totalSize;i++){if((i+1)%9==0&&i!=0)
s+="\n";if(undefined==this.cacheData[i]||null==this.cacheData[i])
s+="["+i+"]- # ";else
s+="<"+i+">- "+this.cacheData[i].title+" ";}
alert(s);}}


var $_dwrInfo=null;function dwrInfo(msg,type){try{if(!$_dwrInfo)
$_dwrInfo=new NetEase.DwrLogger({relativeId:"page"});$_dwrInfo.appendMsg(msg,type);}catch(ex){alert(msg);}}
function autoSize(){try{if(top!=this){document.domain="163.com";top.document.getElementById("lpStarFace").style.height=document.documentElement.scrollHeight+100+'px';}}catch(e){var a=1;}}
function isValidInput(textValue,textLabel,minLen,maxLen){if(minLen>0&&textValue==""){dwrInfo(textLabel+"必填","error");return false;}
if(textValue.length>maxLen){dwrInfo(textLabel+"不能超过"+maxLen+"个字","error");return false;}	
if (textValue.length<minLen){dwrInfo(textLabel+"必须超过"+minLen+"个字","error");	return false;}
return true;}
function isValidUrl(textValue,textLabel,minLen,maxLen){if(isValidInput(textValue,textLabel,minLen,maxLen)){if(textValue.indexOf("http://")<0){dwrInfo("照片地址不正确！","error");return false;}
return true;}else
return false;}
function getTrimValue(id){if($(id))
return Trim($F(id));else
return"";}
var $_dwrProcessing;
var jsWindowManager;var g_quickLoginCon;function showLoginDlg(serverName,loginTarget){showLoginDlg_New(serverName,loginTarget);/**if(jsWindowManager==null)
jsWindowManager=new NetEase.JSWindowManager();if(g_quickLoginCon==null){g_quickLoginCon=new NetEase.QuickLoginOther("qLoginDiv",serverName,false,{err:false,jsWindowManager:jsWindowManager,loginTarget:loginTarget});}
g_quickLoginCon.loginTarget=loginTarget;g_quickLoginCon.showWindow(loginTarget);return false;*/}


function setCookie(name,value,expires,path,domain,secure)
{document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires.toGMTString():"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");}
function getCookie(name)
{var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1)
{begin=dc.indexOf(prefix);if(begin!=0)return null;}
else
{begin+=2;}
var end=document.cookie.indexOf(";",begin);if(end==-1)
{end=dc.length;}
return unescape(dc.substring(begin+prefix.length,end));}



function copyToClipboard (txt) {
	if(window.clipboardData) {
		window.clipboardData.clearData();
		window.clipboardData.setData('Text', txt);
	} else if(navigator.userAgent.indexOf('Opera') != -1) {
		window.location = txt;
	} else if (window.netscape) {
		try {
			netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
		} catch (e) {
			alert('您的firefox安全限制限制您进行剪贴板操作，请打开"about:config"将"signed.applets.codebase_principal_support"设置为"true"之后重试。');
			return false;
		}
		var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
		if (!clip) {
			return;
		}
		var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
		if (!trans) {
			return;
		}
		trans.addDataFlavor('text/unicode');
		var str = new Object();
		var len = new Object();
		var str = Components.classes['@mozilla.org/supports-string;1'].createInstance(Components.interfaces.nsISupportsString);
		var copytext = txt;
		str.data = copytext;
		trans.setTransferData('text/unicode',str,copytext.length*2);
		var clipid = Components.interfaces.nsIClipboard;
		if (!clip) {
			return false;
		}
		clip.setData(trans,null,clipid.kGlobalClipboard);
	}
	return true;
}
