function toggle(id)
{
	if($('#'+id).css('display') == 'none') {
		$('#'+id).show('fast');
	} else {
		$('#'+id).hide('fast');
	}
}

function trade_out(id, game, url) 
{
	$.post("/pages/xsrv_trade_out", { domain: url, partner_id: id, game_id: game }, function(data){
		if(data != 'error') {
			window.location = data;
		}
	});
}

$(document).ready(function(){
	$(".tradelinks a").click(function () { 
		$.post("/pages/xsrv_count_out", { domain: $(this).attr('href'), rel: $(this).attr('rel') }, function(data){
   		window.location = data;
 		});
		return false;
	});
	
	if($('#stars-wrapper1').length > 0) {
		$('#stars-wrapper1').stars({
			oneVoteOnly: true,
			callback: function(ui, type, value)
			{
				$.getJSON("/main/xsrv_insert_rating", {rate: value, game_id: current_game_id}, function(json)
				{
					
				});
			}		
		});
	}
	
});
