﻿// JScript 文件

function VisTable(img,table){
    
    if(img.src.indexOf("xl_t.gif")!=-1){        
        img.src="bbs_images//xl_t2.gif";
        noneT(table);
        return;
    }
    else{
        img.src="bbs_images//xl_t.gif";        
        inlineT(table);
        return;
    }
}

function noneT(table){
    var t=document.getElementById(table);
    
    t.style.display="none";
}

function inlineT(table){
    var t=document.getElementById(table);
    t.style.display="inline";
}

function UOnline()
{
    var a=BBs_UserOnline.UserOnline(uname,ip).value;
    
    setTimeout("UOnline()",8000);
}
function GOnline(){
    var a=BBs_UserOnline.GuestOnline(guest,ip).value;
    
    setTimeout("GOnline()",8000);
}

function timeGoUrl(url){
    
    setTimeout("goUrl('"+url+"')",3000);
}

function goUrl(url){
    location.href=url;
}

function SubMainTitle(v,title){
  var t=document.getElementById(title);
  var tv=t.value;
  t.value=v+tv;
  return;
}

function openMain(link,chk){
    var c=document.getElementById(chk);
    if(c.checked){
        window.open(link.href);        
    }
    else{
        location.href=link.href;
    }
    return;
}

	function popShow(pageurl,w,h) {
        popwin=window.open(pageurl,"popWin","scrollbars=no,toolbar=no,location=auto,directories=no,status=no,menubar=no,resizable=no,width="+w+",height="+h);
        return false;
    }
    var TopName="ctl00_ContentPlaceHolder1_";
    function getvalue(control){
        var c=document.getElementById(TopName+control);
        if(c!=null)
        {
            return c.value;
        }
        else{
            return '';
        }
    }
    
    function IsEmail(mail){
        return mail.search(/^[^\s@:"'<>,&]{2,}@[^\[\.]+\.[^\[]{2,}$/gi) < 0;
    }
    
function Button2_onclick() {
    var p=popShow("Bbs_face.aspx",'750','500')
}

function chkForm(){
    if(pass.value.length==0){
    alert("请填写你的原密码！");
    pass.focus();
    return false;
    }
    if(newpass.value.length>0){
        if(newpass.value!=repass.value){
            alert("两次密码不相同！");
            newpass.focus();
            return false;
        }        
    }
    if(newpass.value.length>0&&newpass.value.length<6){
        alert("密码长度不得小于6位！");
        newpass.focus();
        return false;
    }
    if(IsEmail(email.value)){
        alert("您输入的邮箱格式不正确！");
        email.focus();
        return false;
    }
    
    return true;
}
