  function $(obj){return document.getElementById(obj);}
function VoteValidate(kname) 
    {
        var count=0,count1=0,u=0,vle=kname.value,ReturnValue,err="",leng=30;  
        while(vle.indexOf("\r\n\r\n")>0) { vle= vle.replace("\r\n\r\n","\r\n");}
        while(vle.indexOf("\r\n")>0) { vle= vle.replace("\r\n","\n");}
        while(vle.indexOf("\r")>0) { vle= vle.replace("\r","");}
for(var i=0;i<vle.length;i++) { if (vle.charAt(i)=='\n'){ count=count+1; if(count>=10) { ReturnValue=vle.substring(0,i); i = vle.length;}else{ReturnValue=vle  }} else{ReturnValue=vle  } } 

for(var i=0;i<ReturnValue.length;i++){ if (ReturnValue.charAt(i)=='\n'){ count1=count1+1; if(ReturnValue.substring(i,u).length>leng) {err = err + count1+"行：“"+ ReturnValue.substring(i,u) + "”      \n"; u = i+1;}else {  u = i+1;} } }      

if(count1==count){if(ReturnValue.substring(ReturnValue.length,u).length>leng){ err = err + (count1==0?"1":count1+1) +"行：“"+ ReturnValue.substring(ReturnValue.length,u) + "”      \n";}}
 if(err!=""){alert(err+"\n字符过多，允许长度为"+leng+"个字符。");kname.focus();}kname.value=ReturnValue==null?vle:ReturnValue;
}

function Submit_onDoubleclick(valus)
{
	try{
	    
		if(parent.main.cols=="400,*"){parent.main.cols=valus+",*";} 
		
		if(valus==0)parent.main.cols="400,*"
		
	}catch (e){}
}

function  onDoubleclick(){  
    try{ 
    if(parseInt(parent.main.cols.split(",")[0])==400)
        sx();
    else
        fd();}catch(e){}
 }
 
 function sx(){ 
  var _cols=parseInt(parent.main.cols.split(",")[0]);
        if((_cols-100)>0)
            {
                parent.main.cols=(_cols-100)+",*";
                 window.setTimeout(sx,1);
             }
             else{ parent.main.cols="0,*";}
  }
  function fd(){ 
   var _cols=parseInt(parent.main.cols.split(",")[0]);
         if((_cols+100)<400)
            {
                parent.main.cols=(_cols+100)+",*";
                   window.setTimeout(fd,1);
            }
             else{ parent.main.cols="400,*";}
  }
  
  var objcontr='';
 function manage(obj,parameter)
  {
    if(objcontr!=''){$("showform").style.display='none';$(objcontr).innerHTML=""}
    objcontr=obj.id;
    showwindow="<div  style=\"position:absolute;display:none;overflow:hidden;z-index:2;border:1px #c0c0c0 solid;\" id=\"showform\"><iframe  src=\"/cmd.aspx?"+parameter+"\" frameBorder=\"0\" scrolling=\"no\" width=\"100%\" height=\"100%\" ></iframe></div>";
    
    obj.innerHTML=showwindow;
    sv=$("showform").style;
    sv.height=10+"px";
    sv.width=10+"px";
    sv.display="inline"; 
    movingLayer(160,250);
  }
  
 function movingLayer(h,w)
 {
	sv =$("showform").style;
	tmpy = parseInt(sv.width);
    tmpx = parseInt(sv.height);
    
	if (((h>w?h:w) - (h>w?tmpx:tmpy)) > 1 ){ 
	    _h=tmpx + 20;_w=tmpy  + 20
	    sv.height =(_h>h?h:_h)+"px";
	    sv.width = (_w>w?w:_w) +"px";
	    sv.right="22px";
	    sv.bottom="20px";
	    //sv.margin="-"+(_h>h?h:_h)+"px 0 0 -"+((_w>w?w:_w)+35)+"px;";
	    window.setTimeout("movingLayer("+h+","+w+")", 10);
	}
}

function mouseout(){window.setTimeout("colesmovingLayer()", 3000);}

function colesmovingLayer()
{
    if(objcontr!=''){
    svs =$("showform").style;
	tmpy = parseInt(svs.width);
    tmpx = parseInt(svs.height);
	    if (tmpx >= 15){  
	        svs.height = tmpx - 15 + "px";
	        svs.width = tmpy - 15 + "px"; 
	        //svs.right="0px"
	        //svs.margin="-"+(tmpx - 15)+"px 0 0 -"+((tmpy - 15)+35)+"px;";
	        window.setTimeout("colesmovingLayer()", 10);
	    }else
	    {
	    window.setTimeout(function (){
	        svs.display='none';
	        $(objcontr).innerHTML=""
	        objcontr='';},10);
	    }
	}
}

function GetXmlHttp(url)
{
var Rurl=url+(url.indexOf("?")>-1?"&":"?")+Math.random();
var isFF=window.navigator.userAgent.indexOf("Firefox")>=1;
var xhttp;
try{xhttp=new XMLHttpRequest();}catch(e){};
var progids=['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];
if(!xhttp){for(var i=0;i<progids.length;++i){try{xhttp=new ActiveXObject(progids[i]);}catch(e){}}}
if(isFF){  xhttp.open("GET",Rurl, false);} else{  xhttp.open("POST",Rurl,false);}  
xhttp.send(null);
return xhttp.responseText;
}

function tipstep(ts,d){
var info=GetXmlHttp("fead6adf3bacc.aspx?dc="+ts+"&aid="+d);
if(info=="true"){
    var v= parseInt($("s"+ts+d).innerHTML);
    $("s"+ts+d).innerHTML=v+1;
}    
else 
    alert(info);
}

function copyToClipBoard(v){ 
        try{ 
        window.clipboardData.setData("Text",document.title+"\r\n"+v); 
        alert("内容已复制到您的黏贴板，请注意保存。");
        }catch(e){alert("该浏览器不支持此项功能，请选中链接用Ctrl+C复制。");}
      
    } 
islog=false;
function checkform(){
    if(islog){
        if($("username").value==''){alert("请输入用户名。");return false;}
        if($("pass").value==''){alert("请输入密码。");return false;}
    }
    var vle=$("textbody").value;
    var leng=vle.replace(/(\s*)/g, "").length;
    if(leng<5 || leng>300){ alert("至少输入5个以上或小于300个以下的字符");  return false; }
}

function AddFavorite(sURL, sTitle){try{window.external.addFavorite(sURL, sTitle);}catch (e){try{window.sidebar.addPanel(sTitle, sURL, "");}catch (e){alert("加入收藏失败，请使用Ctrl+D进行添加");}}}


function show_Div(){setTimeout('document.getElementById("ShowDiv").style.display=""',500);}
function close_Div(){setTimeout('document.getElementById("ShowDiv").style.display="none"',500);}