﻿function overlink(aid)
{
    document.getElementById(aid).style.textDecoration='underline';
}

function outlink(aid)
{
    document.getElementById(aid).style.textDecoration='none';
}

function overlink1(aid)
{
    document.getElementById(aid).style.textDecoration='underline';
    document.getElementById(aid).style.fontWeight="bold";
}

function outlink1(aid)
{
    document.getElementById(aid).style.textDecoration='none';
    document.getElementById(aid).style.fontWeight="";
}

function overlink2(aid)
{
    document.getElementById(aid).style.color='#FFD508';
}

function outlink2(aid)
{
    document.getElementById(aid).style.color='#FFE9D8';
}

function overlink3(aid)
{
    document.getElementById(aid).style.textDecoration='underline';
    document.getElementById(aid).style.color='#FF0000';
}

function outlink3(aid)
{
    document.getElementById(aid).style.textDecoration='none';
    document.getElementById(aid).style.color='#5D3E03';
}

function overtextbox(txtid)
{
    document.getElementById(txtid).style.borderColor='#B1945C';
}

function outtextbox(txtid)
{
    document.getElementById(txtid).style.borderColor='#666666';
}

//function checkForms(htmlname)
//{
//    var iu, iuu, regArray = new Array("","`","\\","◎","■","●","№","↑","→","↓"+
//    "^","_","-","+","=","|","[","]","？","~","`"+
//    "!","<",">","‰","→","←","↑","↓","¤","§","＃","＆","＆","＼","≡","≠"+
//    "≈","∈","∪","∏","∑","∧","∨","⊥","‖","‖","∠","⊙","≌","≌","√","∝","∞","∮"+
//    "∫","≯","≮","＞","≥","≤","≠","±","＋","÷","×","/","Ⅱ","Ⅰ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅹ","Ⅻ"+
//    "╄","╅","╇","┻","┻","┇","┭","┷","┦","┣","┝","┤","┷","┷","┹","╉","╇","【","】"+
//    "①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","┌","├","┬","┼","┍","┕","┗","┏","┅","—"+
//    "〖","〗","←","〓","☆","§","□","‰","◇","＾","＠","△","▲","＃","℃","※",".","≈","￠","'"); 
//    iuu=regArray.length;
//    for(iu=1;iu<=iuu;iu++)
//    {
//        if (document.getElementById(htmlname).value.indexOf(regArray[iu])!=-1)
//        {
//            alert("含有禁用字符：" + regArray[iu]);
//            document.getElementById(htmlname).value="";
//            return false;
//        }
//    }
//    return true;              
//}

function checknum(conid)
{
    if(/\D/.test(document.getElementById(conid).value))
    {
        alert('只能输入数字');
        document.getElementById(conid).value='';
    }
}

function GetQueryString(name)  
{ 
    var regex = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); 
    var r = window.location.search.substr(1).match(regex); 
    if(r != null)
    {
        return unescape(r[2]);
    }
    return null;
}

function ChangePic(fluPic,img)
{
    if (!/\.((jpg))$/ig.test(fluPic.value))
    {
        alert('只能上传jpg格式图片!');
        fluPic.outerHTML = fluPic.outerHTML;
    }
    else
    {
        document.getElementById(img).filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src=fluPic.value;
    }
}

function overmenupic(cid)
{
    var imgname='menu'+cid.split('_')[1]+"_1.gif";
    document.getElementById(cid).src="../images/"+imgname;
}

function outmenupic(cid)
{
    var imgname='menu'+cid.split('_')[1]+"_0.gif";
    document.getElementById(cid).src="../images/"+imgname;
}

function getfoucs(cid)
{
    document.getElementById(cid).focus();
}

function setcontent(cid)
{
    if(cid=="ctl00_ContentPlaceHolder1_txt_name")
    {
        if(document.getElementById(cid).value=="用户名")
        {
            document.getElementById(cid).value='';
            document.getElementById(cid).style.color='#000000';
        }
        else
        {
            var rtextRange=document.getElementById(cid).createTextRange();
            rtextRange.moveStart('character',document.getElementById(cid).value.length);
            rtextRange.collapse(true);
            rtextRange.select();
        }
    }
    else
    {
        if(document.getElementById(cid).value=="密码")
        {
            document.getElementById(cid).value='';
            document.getElementById(cid).style.color='#000000';
        }
        else
        {
            var rtextRange=document.getElementById(cid).createTextRange();
            rtextRange.moveStart('character',document.getElementById(cid).value.length);
            rtextRange.collapse(true);
            rtextRange.select();
        }
    }

}

function outfoucs(cid)
{
    if (document.getElementById(cid).value.replace(/[ ]/g,"").length==0)
    {
        if (cid=="ctl00_ContentPlaceHolder1_txt_name")
        {
            document.getElementById(cid).value='用户名';
        }
        else
        {
            document.getElementById(cid).value='密码';
        }
        document.getElementById(cid).style.color='#b4b4c1';
    }
}


function checkLogin(cids)
{
    var cid = cids.split('|');
    if (checkForms(cid[0]) && checkForms(cid[1]))
    {
        return true;
    }
    else
    {
        return false;
    }
}

function checkCom(cid)
{
    if (cid.value=="个人用户")
    {
        document.getElementById("_ctl0:_ctl0:ContentPlaceHolder1:ContentPlaceHolder2:TextBox12").readOnly="true";
        document.getElementById("_ctl0:_ctl0:ContentPlaceHolder1:ContentPlaceHolder2:TextBox13").readOnly="true";
        document.getElementById("_ctl0:_ctl0:ContentPlaceHolder1:ContentPlaceHolder2:TextBox14").readOnly="true";
    }
    else
    {
        document.getElementById("_ctl0:_ctl0:ContentPlaceHolder1:ContentPlaceHolder2:TextBox12").readOnly="";
        document.getElementById("_ctl0:_ctl0:ContentPlaceHolder1:ContentPlaceHolder2:TextBox13").readOnly="";
        document.getElementById("_ctl0:_ctl0:ContentPlaceHolder1:ContentPlaceHolder2:TextBox14").readOnly="";
    }
}

