var load,lded=false,dobj,offz=1,popx=0,popy=0,pops=[],pobj,psrc,pdow,none="-----",pane,isie=navigator.userAgent.indexOf("MSIE")>-1,shitchar="您输入了非法字符";
function isin(d,c)
{
  for(var i in c)if(d==c[i])return i;return-1;
}
function newo(a)
{
  return document.createElement(a);
}
function addo(m,o,n)
{
  return(n==null)?m.appendChild(o):m.insertBefore(o,n);
}
function unit(i)
{
  return i+"px";
}
function doub(i)
{
  return(i<10)?"0"+i:i;
}
function trim(n)
{
  return n.replace(/([ \f\t\v]+$)|(^[ \f\t\v]+)/g,"");
}
function aobj(n)
{
  return(typeof(n)=="string")?document.getElementById(n):n;
}
function objs(n,o)
{
  return(o==null)?document.getElementsByName(n):o.getElementsByTagName(n);
}
function evnt(e)
{
  return isie?event:e;
}
function onit(e)
{
  e=evnt(e);
  return isie?e.srcElement:e.target;
}
function toit(e)
{
  e=evnt(e);
  return isie?e.toElement:e.relatedTarget;
}
function attr(o,a)
{
  var v=o[a];
  if(v==null)v=o.getAttribute(a);
  if(v==="")v=null;
  return v;
}
function init(o,a)
{
  return isie?a.contains(o):objo(o,a)!=null;
}
function dark(o)
{
  return aobj(o.id+"dark");
}
function fuck(o,b,d)
{
  o.style.display=(b)?"none":((d!=null)?"block":"inline");
}
function offs(o,p)
{
  var x=0,y=0;
  while((o!=null)&&(o!=p))
  {
    x+=o.offsetLeft;
    y+=o.offsetTop;
    o=o.offsetParent;
  }
  return {x:x,y:y};
}
function rise(o)
{
  o.style.zIndex=++offz;
}
function clip(s)
{
  s=(trim(s)).replace(/[\s,.;，。；、　]+/ig," ");
  return s.split(" ");
}
function tree(o)
{
  var n="plus",v="className",a=o[v],b=a==n;
  o[v]=(b)?n+"_selected":n;
  hide(o.parentNode.lastChild,!b);
}
function ahit(o,b)
{
  var v=attr(o,"target");
  if(v!=null)objo(o,"tagName",v.toUpperCase(),function(o)
  {
    o.className=b?"li":"li_selected";
  }
  );
}
function hint(o,v)
{
  o.title=v;
  var c=[];
  obji(o.parentNode,"tagName","I",c);
  if(c.length>0)
  {
    var m=c[0];
    m.innerHTML=v;
    hide(m,v=="");
  }
}
function cani()
{
  return confirm("您是否确定要删除选定的项目？");
}
function acol(c,n,b)
{
  var a;
  if(typeof(c)=="number")
  {
    a=[];
    for(var i=c;i<=n;i++)a.push(i);
  }
  else a=c.concat([]);
  return(b)?a.reverse():a;
}
function move(o,x,y)
{
  with(o.style)
  {
    left=unit(x);
    top=unit(y);
  };
  var k=dark(o);
  if(k!=null)with(k.style)
  {
    left=unit(x+2);
    top=unit(y+2);
  }
}
function hits(o,b)
{
  var c=objs(attr(o,"for"));
  for(var i=0;i<c.length;i++)
  {
    var o=c[i];
    var a=(b==null)?o.checked:b;
    ahit(o,a);
    o.checked=!a;
  };
  return false;
}
function rand(m,n)
{
  if(n==null)n=0;
  return Math.min(Math.round((Math.random()*10*m)/9),m)+n;
}
function rana(c)
{
  return c[rand(c.length-1)];
}
function hide(o,b,d)
{
  if(o!=null)
  {
    fuck(o,b);
    if(d!=null)obji(o,"disabled",!b,function(o)
    {
      o.disabled=b;
    }
    );
    var k=dark(o);
    if(k!=null)fuck(k,b);
    if(o==pobj)
    {
      pobj.onmouseout=psrc.onmouseout=pdow.onmouseout=pobj=psrc=pdow=null;
    }
  }
}
function objo(o,a,v,c)
{
  var m;
  while((m==null)&&(o!=document.body))
  {
    if(((v==null)&&(o==a))||((v!=null)&&(attr(o,a)==v)))
    {
      m=o;
      if(c!=null)
      {
        if(typeof(c)=="function")c(o);
        else c.push(o);
      }
      break;
    }
    o=o.parentNode;
  }
  return m;
}
function obji(o,a,v,c)
{
  if(o.nodeType==1)
  {
    if(attr(o,a)==v)
    {
      if(typeof(c)=="function")c(o);
      else c.push(o);
    }
    var u=o.childNodes;
    for(var i=0;i<u.length;i++)obji(u[i],a,v,c);
  }
}
function list(l,v,c,n,b,w)
{
  var a=acol(c,n,b),s="",r=-1;
  for(var i=0;i<a.length;i++)
  {
    var t=a[i],d=t==v;
    if(d)r=i;
    s+="<option value='"+t+"'"+((d)?" selected>":">")+doub(t)+"</option>";
  }
  if(l)s="<option value='"+none+"'>"+none+"</option>"+s;
  if(w)return{h:s,n:r};
  else document.write(s);
}
function turn(c,o)
{
  var t=o.options,a=c.concat([]);
  if(t[0].value==none)a.unshift(none);
  for(var i=t.length-1;i>-1;i--)o.remove(i);
  for(var i=0;i<a.length;i++)
  {
    var x=newo("option");
    o.options.add(x);
    with(x)
    {
      value=innerHTML=a[i];
    }
  }
}
function deck(o)
{
  if(o.tagName!="TR")return;
  var a="className",v=o[a],h='if(this["',t='_selected")this["',f='"]!="',n='"]="',r=h+a+f+v+t+a+n+v;
  o.onmouseout=new Function(r+'"');
  o.onmouseover=new Function(r+'_hover"');
}
function ajax(o)
{
  var v=o.value,d=o.id;
  eval("i_check_"+d+"=function(v){hint(aobj('"+d+"'),decodeURI(v));var a=attr(aobj('"+d+"'),'onajax');if(a!=null)eval(a);}");
  eval("x_check_"+d+"('"+encodeURI(v)+"',i_check_"+d+")");
}
function post(o)
{
  var a="behavior",m=o.form,h=m[a],t=attr(o,"target");
  if(form(m))
  {
    if(h==null)
    {
      h=newo("input");
      h.type="hidden";
      h.name="act";
      addo(m,h);
    }
    h.value=attr(o,a);
    if(t!=null)m.target=t;
    m.submit();
  }
}
function form(o)
{
  var s="",n=0,c=o.elements;
  for(var i=0;i<c.length;i++)
  {
    var m=c[i],t=m.tagName,p=attr(m,"type"),b=((t=="SELECT")&&m.options.length>0),j=t=="TEXTAREA",l=p=="text";
    if((!m.disabled)&&(j||b||l||(p=="password")||(p=="file")))
    {
      if(l)m.value=trim(m.value);
      var h="",a=attr(m,"alt"),v=(b)?m.options[m.selectedIndex].value.replace(/\-+/,""):m.value;
      v=v.length;
      var x=parseInt(attr(m,"minlength")),z=parseInt(attr(m,"maxLength"));
      if(isNaN(x))x=0;
      if(isNaN(z)||z<1)z=5000;
      if(v<x)h=(v==0)?"请"+((b)?"选择":"输入")+a:a+"的长度不得小于"+x+"个字符";
      else if(v>z)h=a+"的最大允许长度为"+z+"个字符，而您输入了"+v+"个字符";
      else if(m.onblur!=null)
      {
        m.focus();
        m.blur();
        h=m.title;
      }
      if(h!="")
      {
        if(h.indexOf(a)<0)h=a+": "+h;
        s+="\r\n"+(++n)+". "+h;
      }
    }
  }
  var a="check",h="";
  if(attr(o,a)!=null)eval('h='+a+'_'+o.id+'(o)');
  if(h!="")s+="\r\n"+(++n)+". "+h;
  b=n==0;
  if(!b)alert("检查到下列错误，请纠正后再提交：\r\n"+s);
  else
  {
    var h=newo("input");
    h.type="hidden";
    h.name="tim";
    h.value=(new Date()).getTime();
    addo(o,h);
  }
  return b;
}
function menu(o,a,b)
{
  var m=aobj(a),t="move",x="exit",r="dark",k=dark(m),j,g,z=attr(o,"alt"),s=attr(o,"pane"),f=attr(m,"onmenu"),q=m.firstChild;
  if(s!=null)pane=aobj(s);
  if(f!=null)eval(f);
  if((z!=null)&&(q.className!=t))
  {
    j=newo("a");
    with(j)
    {
      href="#";
      className=t;
      hideFocus=true;
      innerHTML=z;
    }
    g=newo("a");
    with(g)
    {
      href="#";
      className=x;
      hideFocus=true;
      title="关闭";
    }
    g.setAttribute("exit","1");
    addo(j,g,j.firstChild);
    addo(m,j,q);
  }
  hide(m,false);
  var p=offs(o,m.offsetParent),v=attr(o,"pos"),d=attr(o,"flip")!=null;
  var w2=o.offsetWidth,h2=o.offsetHeight;
  var w1=parseInt(attr(m,"width"));
  if(isNaN(w1))w1=180;
  m.style.width=unit(w1);
  w1=m.offsetWidth;
  var h1=m.offsetHeight;
  if(v=="0")
  {
    p.y-=(b)?h1-1:h1+4;
    if(d)p.x+=w2-w1;
  }
  if(v=="1")
  {
    p.x+=(b)?w2-1:w2+2;
    if(d)p.y+=h2-h1;
  }
  if(v=="2")
  {
    p.y+=(b)?h2-2:h2+2;
    if(d)p.x+=w2-w1;
  }
  if(v=="3")
  {
    p.x-=(b)?w1-1:w1+4;
    if(d)p.y+=h2-h1;
  }
  if(lded)
  {
    if(k==null)
    {
      k=newo("div");
      k.id=m.id+r;
      k.className=r;
      addo(m.parentNode,k);
    }
    hide(k,false);
    rise(k);
    with(k.style)
    {
      width=unit(w1);
      height=unit(h1);
    }
  }
  if(attr(m,t)==null)move(m,p.x,p.y);
  rise(m);
  if(b)
  {
    pobj=m;
    psrc=o;
    pdow=pobj;
    if(lded)
    {
      pdow=k;
      o.onmouseout=m.onmouseout=k.onmouseout=function(e)
      {
        e=evnt(e);
        e.cancelBubble=true;
        dpop(toit(e));
      }
    }
  }
  else pops.push(m);
}
function dpop(o)
{
  var b=true;
  if(o!=null)b=init(o,pobj)||init(o,psrc)||init(o,pdow);
  if(!b)hide(pobj,true);
}
function apop(e)
{
  e.cancelBubble=true;
  var o=(e.type=="keydown")?document.body:onit(e),a=attr(o,"pop"),n=pops.length;
  if(n>0)for(var i=n-1; i>-1;i--)
  {
    var m=pops[i];
    if(!init(o,m))
    {
      hide(m,true);
      pops.splice(i,1);
    };
  }
  if(a!=null)menu(o,a,false);
  return o;
}
document.onmousedown=function(e)
{
  e=evnt(e);
  var o=apop(e),f=o.onclick,c=o.className,t=o.tagName;
  var a,r=attr(o,"for"),b=attr(o,"behavior"),y=attr(o,"type"),v;
  if(f==null)f="";
  else
  {
    f=f.valueOf().toString();
    f=f.replace(/^[^{]+\{/,"");
    f=f.replace(/} $/,"");
  }
  if(c=="move")
  {
	o.ondragstart=o.onselectstart=function()
	{
		return false;
	};
	popx=e.clientX;
	popy=e.clientY;
	dobj=objo(o,"className","menu");
	rise(dobj);
	dobj.setAttribute("move",1);
	with(dobj){
		tx=offsetLeft;
		ty=offsetTop;
	}
	document.onmousemove=function(e)
	{
		e=evnt(e);
		move(dobj,tx+e.clientX-popx,ty+e.clientY-popy);
	}
  }
  else if(c.indexOf("plus")>-1)f="tree(this);"+f;
  if(r!=null)
  {
      if((t=="SELECT")&&(o.onchange==null))
		  o.onchange=function()
		  {
			var f=attr(this,"for"),c=this.options;
			for(var i=0;i<c.length;i++)hide(aobj(f+i),!c[i].selected,1);
		  };
      else if(t=="A")f="hits(this,"+b+");"+f;
  }
  if(attr(o,"exit")!=null)f="hide(objo(this,'className','menu'),true);"+f;
  if(attr(o,"omit")!=null)f="if(!cani())return false;"+f;
  if(t=="INPUT")
  {
       a="prove";
       if(attr(o,a)!=null)
       {
         v=a+"_"+o.id;
         o.removeAttribute(a);
		 if(!isie)o.addEventListener("input",new Function("e",v+"(onit(e))"),false);
		 else o.onpropertychange=new Function("if(event.propertyName=='value')"+v+"(this)");
	    }
	    a="check";
	    if(attr(o,a)!=null)
		{
			v="ajax";
			o.onblur=new Function("if(this.value!='') "+((attr(o,v))?v:a+"_"+o.id)+"(this);else hint(this,'')");
		}
		if(y=="checkbox")
		{
			a=o.checked;
			if(r!=null)hits(o,a);
			else if(attr(o,"target")!=null)ahit(o,a);
		}
	}
	else if(t=="BUTTON")
	{
	if(b!=null)f+=";post(this);";
	}
	else if(t=="A")
	{
		a=String(attr(o,"href"));
		if(a.charAt(a.length-1)=="#")
			f+=";return false;";
	}
	a="handle";
	if((attr(o,a)==null)&&(f!=""))
	{
		o.onclick=new Function(f);
		o.setAttribute(a,"1");
	}
	if((t=="A")||(t=="BUTTON")||(y=="radio")||(y=="checkbox")||(y=="button")||(y=="submit"))o.onmouseup=function()
	{
		this.blur();
	}
};
document.onmouseover=function(e)
{
	e=evnt(e);
	e.cancelBubble=true;
	var o=onit(e),a=attr(o,"drop");
	if(pobj!=null)dpop(o);
	if(a!=null)menu(o,a,true);
};
document.onmouseup=function()
{
	dobj=document.onmousemove=null;
};
document.onkeydown=function(e)
{
	e=evnt(e);
	if(e.keyCode==9)apop(e);
};
window.onload=function()
{
	lded=true;
	var v="hint";
	if(aobj(v)!=null)location="#"+v;
	if(aobj("compliments")!=null)check_compliments();
	var c=[];
	var h=document.getElementsByName("ubbimage");
	for(var i=0;i<h.length;i++)c.push(h[i]);
	var o=aobj("photo");
	if(o!=null)c.push(o);
	for(var i=0;i<c.length;i++)
	{
		o=c[i];
		var m=o.parentNode;
		with(m.style)
		{
		  display="block";
		  overflow="hidden";
		  width="95%";
		}
		o.width=Math.min(m.offsetWidth,o.width);
		m.style.height=unit(o.height);
	}
	if(load!=null)load();
};
function dm(y,m)
{
  return(m==1)?((((!(y%4))&&(y%100))||!(y%400))?29:28):[31,29,31,30,31,30,31,31,30,31,30,31][m];
}
function dc(d)
{
  with(d)
  {
    var m=getMonth(),y=getFullYear();
    return {y:y,m:m,d:getDate(),h:getHours(),n:getMinutes(),s:getSeconds(),w:getDay(),c:dm(y,m)};
  }
}
function write_date_select(o,b,d)
{
  var n=o.length,y=(new Date()).getFullYear();
  var t1='<select'+((d)?' minlength="1"':''),t3='>',t2='</select>';
  var h=t1+' id="date_y" name="date_y" alt="年"'+t3+list(b,o[0],y-60,y,1,1).h+t2+'年 '+t1+' id="date_m" name="date_m" alt="月"'+t3+list(b,o[1],1,12,1,1).h+t2+'月 '+t1+' id="date_d" name="date_d" alt="日"'+t3+list(b,o[2],1,31,1,1).h+t2+'日 ';
  if(n>3)h+=t1+' id="date_h" name="date_h" alt="时"'+t3+list(b,o[3],0,23,1,1).h+t2+'时 '+t1+' id="date_i" name="date_i" alt="分"'+t3+list(b,o[4],0,59,1,1).h+t2+'分 '+t1+' id="date_s" name="date_s" alt="秒"'+t3+list(b,o[5],0,59,1,1).h+t2+'秒 ';
  document.write(h);
}
function get_tags()
{
	x_get_tags(function(s)
		{
		  var o=aobj("pane_tags");
		  var c=clip(s);
		  o.innerHTML="";
		  for(var i=0;i<c.length;i++)
		  {
		    var a=newo("a");
		    addo(o,a);
		    a.innerHTML=c[i];
		    a.href="#";
		    a.onclick=function()
		    {
		      var u=aobj("tags");
		      if(u!=null)
		      {
		        u.value+=this.innerHTML+" ";
		        return false;
		      }
		    };
		    addo(o,document.createTextNode(" "));
		  }
		}
	);
}
function rnd_tags(c,u,c2)
{
  var c1=[],h="";
  for(var i=12;i<17;i++)c1.push(i);
  for(var i=0;i<c.length;i++)h+='<a style="color:'+rana(c2)+';font-size:'+rana(c1)+'px;" href="'+u+encodeURI(c[i])+'.html">'+c[i]+'</a>&nbsp;';
  document.write(h);
}
function chk_id(o)
{
  return(/[\W_-]/.test(o.value))?shitchar:"";
}
function check_num(o)
{
  var c=o.value.replace(/\D/g,"");
}
function check_tags(o)
{
  var c=clip(o.value),i=c.length;
  hint(o,(i>6)?"标签最多只允许6 个，您却输入了"+i+" 个":"");
  o.value=c.join(" ")+" ";
}
function check_password2(o)
{
  hint(o,(o.value!=aobj("password1").value)?"两次输入的不一致":"");
}
function check_password1(o)
{
  hint(o,chk_id(o));
  var m=aobj("password2");
  if(m!=null)check_password2(m);
}
check_owner1=check_username=check_password=check_username_t=check_password_t=check_password0=function(o)
{
  hint(o,chk_id(o));
};
function check_email(o)
{
  var r=new RegExp("^([\\w\\d\\-\\.]+)@{1}(([\\w\\d\\-]{1,67})|([\\w\\d\\-]+\\.[\\w\\d\\-]{1,67}))\\.(([a-zA-Z\\d]{2,4})(\\.[a-zA-Z\\d]{2})?)$");
  hint(o,(r.test(o.value))?"":"输入的不是正确的邮件地址");
}
function check_imgfile(o)
{
  var c=trim(o.value),b=c=="";
  if(!b)
  {
    c=c.split(".");
    b=c.length>0;
    if(b)b=/(jp\S+)|(gif)|(bmp)|(png)/i.test(c[c.length-1]);
  }
  hint(o,(b)?"":"不正确的图像文件后缀名");
}
function prove_password1(o)
{
  var v=o.value,h=t="",x=parseInt(attr(o,"minlength"));
  if(isNaN(x))x=1;
  if(v.length<x)h="未知";
  else
  {
    t="no";
    var a=chk_id(o);
    hint(o,a);
    if(a!="")h=shitchar;
    else
    {
      var n=0;
      if(v.length>12)n++;
      if(/_/.test(v))n++;
      if(/\d/.test(v))n++;
      if(/[a-z]/.test(v))n++;
      if(/[A-Z]/.test(v))n++;
      if(n>1)t="ok";
      if(n>4)h="高";
      else if(n>3)h="较高";
      else if(n>2)h="中";
      else if(n>1)h="较低";
      else h="低";
    }
  }
  with(aobj("security"))
  {
    innerHTML=h;
    className=t;
  }
}
