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 voteYear(newcomer)
{
    /*ad();*/
    $.post("/newcomer/voteyear/id/"+newcomer,
        {newcomer: newcomer},
        function(response)
        {
           $("#voteLink-"+newcomer).html(response);
        },
        "id");
}

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

function ad()
{
    links = new Array;
    links[1] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[2] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[3] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[4] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[5] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[6] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[7] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[8] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";
    links[9] = "http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.de%2F&site-redirect=de&tag=yanted-21&linkCode=ur2&camp=1638&creative=6742";

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

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");
}

