// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function tn(item_id,type)
{
    var trimg = new Image();
    var now = new Date();
    trimg.src = "/t/"+type+"/"+item_id+"?"+now.getTime();
}

function highalert(game_id,value)
{
    new Ajax.Request("/games/highalert/"+game_id+"?r=no&v="+value, { onSuccess: function(transport) {
	    $('notice').innerHTML = 'High Alert: setting saved.'
	    new Effect.Highlight($('notice'),{ duration : 1 });
	    }});
}

function releasealert(game_id,value)
{
    new Ajax.Request("/games/releasealert/"+game_id+"?r=no&v="+value, { onSuccess: function(transport) {
	    $('notice').innerHTML = 'Release Alert: setting saved.'
	    new Effect.Highlight($('notice'),{ duration : 1 });
	    }});
}

function weeklyalert(value)
{
    new Ajax.Request("/user/weeklyalert?r=no&v="+value, { onSuccess: function(transport) {
	    $('notice').innerHTML = 'Weekly Report: setting saved.'
	    new Effect.Highlight($('notice'),{ duration : 1 });
	    }});
}

function settings(item)
{
    $('s_'+item).innerHTML = $('sx_'+item).innerHTML;
    $('s_'+item).style.border = 'solid 1px #000';
    return false;
}