﻿
function $(obj) { return document.getElementById(obj); }

function check() {
    var pat = /^s+$/ig; 
    if ($('txtUName').value == '' || pat.test($('txtUName').value)) {
        alert('请输入用户名！');
        $('txtUName').select();
        return false;
    }
    if ($('txtPwd').value == '' || pat.test($('txtPwd').value)) {
        alert('请输入密码！');
        $('txtPwd').select();
        return false;
    }
    return true;
}
 
function change(e) {
    e.className = 'common';
    if (e.id == 'liad') {
        $('litm').className = 'webbossaaa';
        $('liad').className = 'adbossaaa';
        $('hidType').value = 'ad';
        $('imgreg').src = '/images/icon1/adregbtn.gif';
    }
    else {
        $('litm').className = 'webbossbbb';
        $('liad').className = 'adbossbbb';
        $('hidType').value = 'tm';
        $('imgreg').src = '/images/icon1/webregbtn.gif';
    }
}

function init() {
    if ($('hidType').value == 'ad') {
        $('litm').className = 'webbossaaa';
        $('liad').className = 'adbossaaa';
        $('imgreg').src = '/images/icon1/adregbtn.gif';
    }
    else {
        $('litm').className = 'webbossbbb';
        $('liad').className = 'adbossbbb';
        $('imgreg').src = '/images/icon1/webregbtn.gif';
    }
}

function goReg() {
    if ($('hidType').value == 'ad') {
        window.location = '/register.html';
    }
    else {
        window.location = 'http://tm.1234567.com/reg.aspx';
    }
}
