function vote(newcomer)
{
    ad();
    $.post("/newcomer/vote",
        {id: newcomer},
        function(response)
        {
           if(response > 0) $("#votes").html("<font color='green'><b>("+response+")</b></font>");
           else $("#voteLink").html("<font color='red'><b>"+response+"</b></font>");
        },
        "id");
}

function partnerClick(partner)
{
    $.post("/partner/click", {id: partner},
        function(response)
        {
            $("#clicks").html(response);
        }, "id");
}

function ad()
{
    links = new Array;
    links[1] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6853638%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FTuget";
    links[2] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6846080%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FFooga";
    links[3] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D7082828%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FSoundCell";
    links[4] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6368596%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FStrandheizung";
    links[5] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6863636%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FGedankenspiel";
    links[6] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6853634%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FArny";
    links[7] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6853665%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FLohokla";
    links[8] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D6271751%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FCallmeyours";
    links[9] = "http://partners.webmasterplan.com/click.asp?ref=418907&site=4303&subid=&type=text&tnb=2&diurl=http%3A%2F%2Fwww.qualigo.de%2Fdoks%2Fsearch%2Fsource%2Fstd%2Fcharge_query.php%3Fds%3Daffilide%26pid%3D7082839%26af_ref%3D418907%26af_site%3D4303%26deep_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%26prnt_ref%3Dhttp%253A%252F%252Fwww.neue-bands.de%253A8888%252Fnewcomer%252FRadination";

    random_num = (Math.round((Math.random()*8)+1));
    window.open(links[random_num], 'Advertisement', 'width=200,height=160,status=no,scrollbars=yes,resizable=yes');
    self.focus();
}

function newsletterRequest(task)
{
    $.post("/newsletter/request", {task: task, email: $('#newsletter_email').val()},
    function(response)
    {
        $('#newsletter_email').val('');
        $("#newsletter_message_"+response).dialog({
        autoOpen: false,
        bgiframe: true,
        modal: true,
        buttons: {
                OK: function() {
                        $(this).dialog('close');
                }
            }
        });
        $("#newsletter_message_"+response).dialog('open');
    }, "task");
}

function voteBTB(id)
{
    $.post("/index/votebtb", {id: id},
    function(response)
    {
        if(response > 0)
        {
            $('#btb_band_votes_' + id).html('<font color="green"><b>' + response + '</b></font>');
            $('#btb_band_button_' + id).html('<font color="green">Danke</font>');
        }
        else
        {
            $('#btb_band_button_' + id).html('<font color="red">Bereits abgestimmt!</font>')
        }
    }, "id");
}