function do_user_side_menu(menuid){
var isCK=false;var objb=document.getElementById("user_side_menu_b"+menuid);var objv=document.getElementById("user_side_menu_v"+menuid);
if(objb.className=="menub1")objb.className="menub2";else objb.className="menub1";
if(objv.style.display=="none")objv.style.display="";else {objv.style.display="none";isCK=true;}
var strMenuState;if(GetCookie("CK_MenuState")==null)strMenuState="";else strMenuState=GetCookie("CK_MenuState");
if(isCK){if(strMenuState.indexOf(menuid+",")==-1)strMenuState+=menuid+",";}
else strMenuState=strMenuState.replace(menuid+",","");
SetCookie("CK_MenuState",strMenuState,0);
}


function init_do_user_side_menu(){
if(GetCookie("CK_MenuState")!=null){
var strMenuState=GetCookie("CK_MenuState");
if(strMenuState.indexOf(",")!=-1){
var arr1=strMenuState.split(",");for(var i=0;i<arr1.length;i++){if(arr1[i]!=""){document.getElementById("user_side_menu_b"+arr1[i]).className="menub1";document.getElementById("user_side_menu_v"+arr1[i]).style.display="none";}}
}}}


function init_user_side_menu_ico(){    
var list=document.getElementById("user_side_menu").getElementsByTagName("li");   
for(var i=0;i<list.length;i++){
var item=list[i].innerHTML.toLowerCase();item=item.substring(item.indexOf("\"")+1);item=item.substring(0,item.indexOf("\""));if(item.indexOf(".aspx")!=-1){item=item.replace(".aspx",".gif");if(list[i].style.backgroundImage.indexOf("mysapce")==-1){list[i].style.backgroundImage="url(/skin/public/usermenuico/"+item+")";list[i].style.backgroundRepeat="no-repeat";list[i].style.backgroundPosition="10px 5px";}}
}
}

function init_user_side_menu_href(){
var list=document.getElementById("user_side_menu").getElementsByTagName("a");   
for(var i=0;i<list.length;i++){
if(location.href.indexOf(list[i])!=-1)list[i].parentNode.className="str";
}
}

function getLoginEverydayMoney(){
ajax("get",location.href.substring(0,location.href.indexOf(".aspx")+5)+"?act=ajax&type=logineverydaymoney&rd="+Math.random(),"",function OnHandler(){if(xmlHttp.readyState == 4){if(xmlHttp.responseText=='ok'){getLoginEverydayMoneyAlert1();}else if(xmlHttp.responseText=='repeat'){getLoginEverydayMoneyAlert2();}else if(xmlHttp.responseText=='admin'){getLoginEverydayMoneyAlert3();}}});
}
function getLoginEverydayMoneyAlert1(){
TINY.box.show("<div class=\"msgok\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">今日登录奖励领取成功，已获得了50点积分！</div>",0,300,23,0,6);                                                
}
function getLoginEverydayMoneyAlert2(){
TINY.box.show("<div class=\"msgon\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">您今天已经领取过登录奖励！</div>",0,200,23,0,3);                                                
}
function getLoginEverydayMoneyAlert3(){
TINY.box.show("<div class=\"msgerr\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">领取无效，您是否以网站管理员身份登录会员中心？</div>",0,300,23,0,3);                                                
}                                                


function saveFastNotepad(value)
{
ajax("post","fastnotepad.aspx?act=ajax&rd="+Math.random(),"value="+value,function OnHandler(){if(xmlHttp.readyState == 4){if(xmlHttp.responseText=='ok'){TINY.box.show("<div class=\"msgok\" style=\"background-position: 0px 4px;*background-position:0px 2px;\">记事板更新成功！</div>",0,200,23,0,3); }else if(xmlHttp.responseText=='no'){alert('您无法更新此记事板，您可能是网站管理员身份！');}}});
}


//<<

function setDropDownListSubClass(id,obj,ajaxexecfile,type,classid,obj2,ifHasCustom,infoID)
{
document.getElementById(obj).options.length=0;
if(id==""||isNaN(id))document.getElementById(obj).style.display="none";
else{
document.getElementById(obj).style.display="";document.getElementById(obj).options[0] = new Option("loading...","");
ajax("get",ajaxexecfile+"&id="+id+"&rd="+Math.random(),"",function OnHandler(){if(xmlHttp.readyState == 4){setDropDownListSubClass_(obj,ajaxexecfile,xmlHttp.responseText,type,classid,obj2,ifHasCustom,infoID);}});
}
}
function setDropDownListSubClass_(obj,ajaxexecfile,ids,type,classid,obj2,ifHasCustom,infoID)
{
var arr1=ids.split(",");for(var i=0;i<arr1.length;i++){if(arr1[i]!=""){document.getElementById(obj).options[i+1] = new Option(arr1[i].split("|")[1],arr1[i].split("|")[0]);}}
if(type==1){
if (navigator.userAgent.indexOf('Firefox')!=-1)document.getElementById(obj).remove(document.getElementById(obj).options[0].index);else document.getElementById(obj).options.remove(document.getElementById(obj).options[0].index);
for(var i=0;i<document.getElementById(obj2).length;i++)if(document.getElementById(obj2).options[i].value==classid){document.getElementById(obj2).selectedIndex=i;}
}else{document.getElementById(obj).options[0] = new Option("请选择","");document.getElementById(obj).selectedIndex=0;}
if(ifHasCustom==1)setCustomCode(classid,type,ajaxexecfile.replace("type=getsubclass","type=custom"),infoID);
}


function setCustomCode(classid,type,ajaxexecfile,infoID){
if(document.getElementById("CustomArea")){
ajax("post",ajaxexecfile+"&type1="+type+"&classid="+classid+"&id="+infoID+"&rd="+Math.random(),"",function OnHandler(){if(xmlHttp.readyState == 4){document.getElementById("CustomArea").innerHTML=xmlHttp.responseText;if(xmlHttp.responseText!="")document.getElementById("CustomAreaTr").style.display="";else document.getElementById("CustomAreaTr").style.display="none";}});
}
}

function selectDropDownListSubClass(ajaxexecfile,parentid,classid,obj1,obj2,ifHasCustom,infoID)
{
for(var i=0;i<document.getElementById(obj1).length;i++)if(document.getElementById(obj1).options[i].value==parentid){document.getElementById(obj1).selectedIndex=i;}
setDropDownListSubClass(parentid,obj2,ajaxexecfile+"?act=ajax&type=getsubclass",1,classid,obj2,ifHasCustom,infoID);
}


function customonblur(obj1,str1)
{
obj1.value= str1.replace(/\"/g,'').replace(/\'/g,'').replace(/\|/g,'').replace(/_/g,'').replace(/:/g,'').replace(/：/g,'');
}

//>>

function act(type,id,ReturlUrl,confirmtip){var do1=true;if(confirmtip!=""){if(!confirm(confirmtip)){do1=false;}}
if(do1){
var url=location.href;url=url.substring(0,url.indexOf("?"));
window.location=url+"?act="+type+"&id="+id+"&ReturnUrl="+base64en(ReturlUrl);
}
}


function user_list_title_tab(){
var url=location.href.toLowerCase();
if(url.indexOf("where=0")!=-1)document.getElementById("tab2").className="on";
else if(url.indexOf("where=1")!=-1)document.getElementById("tab3").className="on";
else if(url.indexOf("where=2")!=-1)document.getElementById("tab4").className="on";
else document.getElementById("tab1").className="on";
}

function mail_view(id){
 TINY.box.show("/user/mail_view.aspx?id="+id+"&url="+base64en(location.href)+"&rd="+Math.random(),1,400,250,1,0);
}