﻿$().ready(function () {

    $('#tabMenu >li >a').click(function () {

        $('#tabMenu >li >a').attr('class', 'tab1');

        $(this).attr('class', 'tabactive');

        var tabindex = Number($('#tabMenu >li >a').index(this));

        $("div.TeamWork div.team_content").each(function (i) {

            if (tabindex == i) {

                $('#tabcontent' + (i + 1)).show('1500');
            }
            else {

                $('#tabcontent' + (i + 1)).hide('1500');
            }
        })

    });

    if ($("#selgame option").length) {
        $("#frm_game").attr("src", "goldstock/" + $("#selgame option:selected").val() + ".html");
    }
});

//
var quick = function() {

    if ($("#sel_server").val() == "") {

        alert("Please Choose your server!");
        return;
    }

    var config = new Object();
    config["p_currency"] = $("#hdn_currency").val();
    config["p_alpha"] = $("#sel_alpha>option:selected").text();
    config["p_server"] = $("#sel_server>option:selected").val();
    config["p_quantity"] = $("#sel_quantity>option:selected").val();
    
    if ($("#sel_game>option:selected").val() == "euwow") {

        createForm(config, "wow-eu-gold.aspx");
    }

    if ($("#sel_game>option:selected").val() == "wow") {

        createForm(config, "wow-us-gold.aspx");
    }
};
var quickstock = function(game, server, id) {
var config = new Object();
    config["p_server"] = id;
    config["p_alpha"] = server.substring(0, 1);
    config["p_quantity"] = 1000;
    if (game.toLowerCase().indexOf("eu") > 0) {
        config["p_currency"] = "EUR";
        createForm(config, "../wow-eu-gold.aspx", "_top");
    }

    if (game.toLowerCase().indexOf("us") > 0) {
        config["p_currency"] = "USD";
        createForm(config, "../wow-us-gold.aspx", "_top");
    }
};