$(document).ready(function() { 
    $('form.login select').selectbox();
    if($.browser.mozilla) {
        $('div.selectbox-wrapper').css("margin-top", "0px");
        $('#submit').css("font-size", "9px");
        $('form.login a').css("font-size", "12px").css("top","0px");
    }
    $('form.login').submit(function() {
        if($(this).find("#uid").val() == "") {
            alert("Please enter a username");
            return false;
        }
        if($(this).find("#pwd").val() == "") {
            alert("Please enter a password");
            return false;
        }
        
        switch($('form.login select#panel').val()) {
            case 'game':
                $(this).attr("action","http://game.dgservers.com/templates/default/login.aspx");
                $(this).find("#uid").attr("name","USERID");
                $(this).find("#pwd").attr("name","Password");
                $(this).find("#submit").attr("name","ButtonLogin");
                $(this).submit();
                break;
            case 'hosting':
                $(this).attr("action","https://dgservers.com:2083/login/");
                $(this).attr("name","CPanel");
                $(this).find("#uid").attr("name","user");
                $(this).find("#pwd").attr("name","pass");
                $(this).find("#submit").attr("name","submit");
                $(this).submit();
                break;
            case 'billing':
                $(this).attr("action","http://dgservers.net/billing/index.php");
                $(this).attr("name","billing");
                $(this).find("#uid").attr("name","username");
                $(this).find("#pwd").attr("name","password");
                $(this).find("#submit").attr("name","submit");
                $(this).submit();
                break;
            case 'ventrilo':
                $(this).attr("action","http://ventrilo.mycp.net/index.php?VCPLP=");
                $(this).attr("name","billing");
                $(this).find("#uid").attr("name","VCPusername");
                $(this).find("#pwd").attr("name","VCPpassword");
                $(this).find("#submit").attr("name","submit");
                $(this).submit();
                break;
            default:
                alert("Please Select a Panel");
                break;
        }
        return false;
    });
});