<!--
function SetIsShowElement(sID,isTrue){try{document.getElementById(sID).style.display= (isTrue?"":"none") ;}catch (e){document.write("ERROR:" + e + " IN:SetIsShowElement()");}}
var WaitHiddenObj = new Array();
function ShowWaitTip(strinnet){var obj = top.document;var WaitTip=obj.getElementById("WaitTip");if (WaitTip==null){var _TempDiv = obj.createElement("<div id=\"WaitTip\" style=\"filter:alpha(opacity=90);position:absolute;top:-100px;left:-100px;z-index:10;width:300px;height:50px;cursor:progress; border: #666666 1px solid;margin-top:10px;margin-bottom:10px;margin-left:10px;margin-right:10px;background-color:#FFFFFF;\" oncontextmenu=\"return false\" onselectstart=\"return false\" onkeydown=\"return false\" ondragstart=\"return false\"></div>");obj.body.appendChild(_TempDiv);WaitTip=obj.getElementById("WaitTip");WaitTip.innerHTML = "<TABLE WIDTH=100% HEIGHT=100% BORDER=0 CELLSPACING=0 CELLPADDING=0><td align=right width=20%><img src=\"/images/loading.gif\"></td><td align=center id=WaitTipText style=\"padding-right:10px;color:#FF0000\">Please Wait ...</td></tr></table>";}if(strinnet==""||strinnet==null)strinnet = "Please Wait ...";obj.getElementById("WaitTipText").innerHTML=strinnet;WaitTip.style.top = obj.body.scrollTop + ((obj.body.clientHeight - WaitTip.style.height.replace("px","")) /2) - 50;WaitTip.style.left = obj.body.scrollLeft + ((obj.body.clientWidth - WaitTip.style.width.replace("px","")) /2);WaitTip.style.visibility='visible';var tags = new Array("applet", "iframe", "select","embed","object");var el = this.element;var p = getAbsolutePos(WaitTip);var EX1 = p.x;var EX2 = WaitTip.offsetWidth + EX1;var EY1 = p.y;var EY2 = WaitTip.offsetHeight + EY1;for (var k=0;k<tags.length;k++) {var ar = obj.getElementsByTagName(tags[k]);for (var i=0;i<ar.length;i++) {cc = ar[i];p = getAbsolutePos(cc);var CX1 = p.x;var CX2 = cc.offsetWidth + CX1;var CY1 = p.y;var CY2 = cc.offsetHeight + CY1;if( (CX1>=EX1 && CX1<=EX2) || (CY1>=EY1 && CY1<=EY2) && (cc.style.visibility !="hidden" && cc.style.display!="none") ){WaitHiddenObj[WaitHiddenObj.length] = cc;cc.style.visibility = "hidden"; }}}}function CloseWaitTip(){var obj = top.document;obj.getElementById("WaitTip").style.visibility="hidden";if(WaitHiddenObj==null){return;};for(var i=0;i<WaitHiddenObj.length;i++){WaitHiddenObj[i].style.visibility = "visible"; WaitHiddenObj[i].style.display = ""; }}

function getAbsolutePos(el) {var SL = 0, ST = 0;var is_div = /^div$/i.test(el.tagName);if (is_div && el.scrollLeft){SL = el.scrollLeft;}if (is_div && el.scrollTop){ST = el.scrollTop;};var left = 0;var top = 0;if(el.offsetLeft){left = el.offsetLeft;};if(el.offsetTop){top = el.offsetTop;};var r = { x: left - SL, y: top - ST};if (el.offsetParent) {var tmp = this.getAbsolutePos(el.offsetParent);r.x += tmp.x;r.y += tmp.y;};return r;}

function GetAccountID(){var _MyAccountID = GetCookie("ACCOUNTINFO","UserID");return (((_MyAccountID)==null)||(_MyAccountID=="0")||(!isNumber(_MyAccountID)))?null:_MyAccountID;}

function isNumber(name){if(name==null||name=="") return false;if(name.length == 0)return false;for(i = 0; i < name.length; i++) {if(name.charAt(i) < "0" || name.charAt(i) > "9")return false;}return true;}

function isLetterNum(name){if(name.length == 0){return false;}for(i = 0; i < name.length; i++) {if(! ( ( (name.charCodeAt(i) >= 48)&&(name.charCodeAt(i) <= 57) )||( (name.charCodeAt(i) >= 65)&&(name.charCodeAt(i) <= 90) )||( (name.charCodeAt(i) >= 97)&&(name.charCodeAt(i) <= 122) ) ) )return false;}return true;}

function chkIsUserName(name){return isLetterNum(name.replace(/-/g, "&amp;").replace(/_/g, "&amp;"));}

function strLength(str){var byteLen=0;for(var i=0;i<str.length;i++)str.charCodeAt(i)>255 ? byteLen += 2 : byteLen ++;return byteLen;}

function cutStr(str,intlen){var strLen=0,byteLen=0;str = str.replace(/\n/gi,'').replace(/\r/gi,'');strLen = str.length;for(var i=0;i<strLen;i++){str.charCodeAt(i)>255?byteLen+=2:byteLen++;if(byteLen>intlen)break;}return str.substr(0,i);}

function confirmdelete(){if (confirm("是否删除? \n\n删除后将不能恢复!")){return true;}return false;}
function GetSpaceUrl(username){return "http://" + username + ".hi.tingbook.com/";}
function GetUserID(){var SCookie = readCookie("TingBookUser");if(SCookie!="" && SCookie.indexOf("ID=")!=-1 && SCookie.indexOf("ID=&")==-1){return (SCookie.substring(SCookie.indexOf("ID=")+3,SCookie.indexOf("&"))) * 1;}return 0;}
function GetUserName(){var SCookie = readCookie("TingBookUser");if( GetUserID()>0 && SCookie.indexOf("Name=")!=-1){if(SCookie.indexOf("&",SCookie.indexOf("Name="))!=-1){return SCookie.substring(SCookie.indexOf("Name=")+5,SCookie.indexOf("&",SCookie.indexOf("Name=")+1));}else{return SCookie.substring(SCookie.indexOf("Name=")+5);}}return "";}
//itype:1,number.2,letter.3,num or letter.4,specialchar
function checkObjValue(obj,itype){var strOut = obj.value;if(strOut=="")return ;switch(itype){case 1:strOut = strOut.replace(/\D/g,'');break;case 2:strOut = strOut.replace(/[^A-Za-z_]/g,'');break;case 3:strOut = strOut.replace(/\W/g,'');break;case 4:strOut = strOut.replace(/[\'\"\`\~\r\n\t\b\$\|\&]/g,'');break;}if(strOut!=obj.value)obj.value = strOut;}

function Trim(strValue){return strValue.replace(/^\s*|\s*$/g,"");}

function GetCookie(name){var obj = document.cookie,cookielen = obj.length;if(cookielen==0)return null;var namestring = name + "=";var namelen = namestring.length;var i = 0,middlevalue = "",endstr=-1;while (i < cookielen) {var j = i + namelen;if (obj.substring(i, j) == namestring){endstr = obj.indexOf (";", j);if (endstr == -1)endstr = obj.length;middlevalue = unescape(obj.substring(j, endstr));break;}i = obj.indexOf(" ", i) + 1;if (i == 0) break; }if(middlevalue=="")return null;if(GetCookie.arguments.length=2){var aryvalue=middlevalue.split("&");for(i=0;i<aryvalue.length;i++){var tmpary=aryvalue[i].split("=");if(tmpary[0]==GetCookie.arguments[1]) return tmpary[1];}}else{return temp1;}}

function SetCookie (name, value) {var expire_days = 30;var expire_date = new Date();var ms_from_now = expire_days*24*60*60*1000;expire_date.setTime(expire_date.getTime() + ms_from_now);var expire_string = expire_date.toGMTString();document.cookie = name + "=" + escape (value)+ ";expires=" +expire_string;}

function getParameter(name){return getUrlParameter(location.search,name);}

function getUrlParameter(url,name){var paramStr=url;if(paramStr==null||paramStr.length==0)return null;if(paramStr.charAt(0)!='?')return null;paramStr=unescape(paramStr);paramStr=paramStr.substring(1);if(paramStr.length==0)return null;var params=paramStr.split('&');for(var i=0;i<params.length;i++){var parts=params[i].split('=',2);if(parts[0]==name){if(parts.length<2||typeof(parts[1])=="undefined"||parts[1]=="undefined"||parts[1]=="null")return "";return params[i].substr(params[i].indexOf('=')+1);}}return "";}

function getExt(str){var intStart;if(str=="")return "";intStart=str.lastIndexOf(".");if(intStart==-1)return "";return str.substr(intStart+1).toLowerCase();}

function CheckFileExt(strExt,AllowExt){AllowExt = "," + AllowExt + ",".toLowerCase();strExt = "," + strExt + ",".toLowerCase();return (AllowExt.indexOf(strExt)==-1)?false:true;}

function HTMLEncode(text){text = text.replace(/&/g, "&amp;");text = text.replace(/"/g, "&quot;");text = text.replace(/</g, "&lt;");text = text.replace(/>/g, "&gt;");text = text.replace(/'/g, "&#146;") ;return text ;}

function HTML2TEXT(s){return s.replace(/<script.+?\/script>/gi, "").replace(/<.+?>/g, "");}

function capsDetect( e,iv ) {if( !e ) { e = window.event; } if( !e ) {return; }var a = e.which ? e.which : ( e.keyCode ? e.keyCode : ( e.charCode ? e.charCode : 0 ) );var b = e.shiftKey || ( e.modifiers && ( e.modifiers & 4 ) );if(( a > 64 && a < 91 && !b ) || ( a > 96 && a < 123 && b )){eval(iv+"(true);");}else{eval(iv+"(false);");}}

function $(obj){return document.getElementById(obj);}

var MyMenu_oTimerHide=MyMenu_oTimerShow="";
function ShowHideMyMenu(pID,pDisplay,pTimeout){var PopMenu = eval(pID);var PMSty = PopMenu.style;if(pDisplay=="hidden"){if(pTimeout!="true"){MyMenu_oTimerHide = setTimeout("ShowHideMyMenu('"+pID+"','"+pDisplay+"','true')",200);return;}if(MyMenu_oTimerShow!=""){clearTimeout(MyMenu_oTimerShow);MyMenu_oTimerShow = "";}PMSty.display="none";PopMenu.filters.alpha.opacity=0;}else{if(MyMenu_oTimerHide!=""){clearTimeout(MyMenu_oTimerHide);MyMenu_oTimerHide = "";}if(PMSty.display=="block"){ if(PopMenu.filters.alpha.opacity<100){PopMenu.filters.alpha.opacity+=10;MyMenu_oTimerShow=setTimeout("ShowHideMyMenu('"+pID+"','"+pDisplay+"','"+pTimeout+"')",25);}else{clearTimeout(MyMenu_oTimerShow);MyMenu_oTimerShow = "";}return;}PMSty.display="block";PMSty.posLeft=document.body.scrollLeft+window.event.clientX-20;PMSty.posTop=document.body.scrollTop+window.event.clientY - 20;if(PMSty.posLeft+PopMenu.offsetWidth > document.body.scrollLeft+document.body.clientWidth)PMSty.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth;if(PMSty.posLeft < 0) PMSty.posLeft=0;if(PMSty.posTop+PopMenu.offsetHeight > document.body.scrollTop+document.body.clientHeight)PMSty.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight;if(PMSty.posTop < 0) PMSty.posTop=0;}}

// 显示对话框
function ShowDialog(url, width, height, scroll) {var _md = showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:"+ scroll +";status:no");}

function Selected(objname,objvalue){var obj = document.getElementById(objname);if(obj==null)return ;for(var i=0;i<obj.length;i++){if(obj[i].value==objvalue){try{obj[i].selected = true;}catch(e){}break;}}}

function Checked(objname,objvalue){var obj = document.getElementsByName(objname);if(obj==null)return;for(var i=0;i<obj.length;i++){if(obj[i].value==objvalue){try{obj[i].checked = true;}catch(e){}break;}}}

function ie_y(e){var t=e.offsetTop;while(e=e.offsetParent){t+=e.offsetTop;}return t;}  
function ie_x(e){var l=e.offsetLeft;while(e=e.offsetParent){l+=e.offsetLeft;}return l;} 

function copy(objname,text){var obj=document.getElementById(objname);if (obj) {js=obj.createTextRange();js.execCommand("Copy");alert(text);}}
function readCookie(name)
{
  var cookieValue = "";var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    {
      offset += search.length; end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

Date.prototype.format = function(formatter){if(!formatter || formatter == ""){formatter = "yyyy-MM-dd";}var year = this.getYear().toString();var month = (this.getMonth() + 1).toString();var day = this.getDate().toString();var yearMarker = formatter.replace(/[^y|Y]/g,'');    if(yearMarker.length == 2){year = year.substring(2,4);};var monthMarker = formatter.replace(/[^m|M]/g,'');if(monthMarker.length > 1){if(month.length == 1){month = "0" + month;}};var dayMarker = formatter.replace(/[^d]/g,'');if(dayMarker.length > 1){if(day.length == 1){day = "0" + day;}};return formatter.replace(yearMarker,year).replace(monthMarker,month).replace(dayMarker,day);}
Date.parseString = function(dateString,formatter){var today = new Date();if(!dateString || dateString == ""){return today;}if(!formatter || formatter == ""){formatter = "yyyy-MM-dd";};var yearMarker = formatter.replace(/[^y|Y]/g,'');var monthMarker = formatter.replace(/[^m|M]/g,'');   var dayMarker = formatter.replace(/[^d]/g,'');var yearPosition = formatter.indexOf(yearMarker);var yearLength = yearMarker.length;var year = dateString.substring(yearPosition ,yearPosition + yearLength) * 1;if( yearLength == 2){if(year < 50 ){year += 2000;}else{year += 1900;}};var monthPosition = formatter.indexOf(monthMarker);var month = dateString.substring(monthPosition,monthPosition + monthMarker.length) * 1 - 1;var dayPosition = formatter.indexOf(dayMarker);var day = dateString.substring( dayPosition,dayPosition + dayMarker.length )* 1;return new Date(year,month,day);}

//-->