var $subsc =
{
	submit: function()
	{
		$.ajax({url:'/application/request/subscribe',data:$(document.subscribe).serialize(),success:this.onsuccess});
	},
	onsuccess: function(data)
	{
		data = utils.eval(data);
		if(data.err == 1)
		{
			document.subscribe.reset();
			$("input").trigger('blur');
		}
		alert(data.msg);
	}
	
	
};

function opengame(url)
{
	$game.open(url);	
}

var $game =
{
	open: function(url)
	{
			var winl = (screen.width-780)/2;
			var wint = (screen.height-522)/2;
			if($game.wind && !$game.wind.closed)
				$game.wind.focus();
			else
			$game.wind = window.open(url,'l3a','top='+wint+',left='+winl+',width='+screen.width+',height='+screen.height+',menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=no');
			return;
		
	},
	buy_album: function()
	{
		if(window.opener)
		{
			window.opener.focus();
			window.opener.open('http://indicastore.com/fr/home.php');
		}
	}
	
};

/*
var $tov =
{
	open: function()
	{
			var winl = (screen.width-780)/2;
			var wint = (screen.height-522)/2;
			window.open('/_jouer-avec-l3a','webcasts','top='+wint+',left='+winl+',width='+screen.width+',height='+screen.height+',menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=no');
			return;
		
	},
	sizes: function()
	{
		return {x:$(window).width(),y:$("body").height()};	
	},
	close: function()
	{
		 $("#temp-content").fadeTo(500,0.1,
			function()
			{
				$(this).remove();
				$("#temp-overlay").animate({height:'20px'},250,'linear'
					,function()
					{
						$(this).animate({width:'0'},250,'linear',function(){$(this).remove();});
					});
				
			});
		return false;
	},
	addfield: function()
	{
		$tov.fieldcontainer
			.append('<div class="temp-field"><input type=text name="email[]" />'
					 +'<a href="" class="add-field"></a></div>')
					.find("a").bind('click',$tov.addfield);
		
		return false;
	},
	submit: function()
	{
		$.ajax({url:'/application/request/register_emails',data:$(document.temp_game).serialize()
			,success:function(data)
			{
				$(".temp-field-wrapper").find(".temp-field").remove();
				for(var i=0;i<3;i++) $tov.addfield();
				
				$('<div class="temp-success" />').append(lang('success-temp')).insertBefore(".temp-field-wrapper");
				
			}});
		
	}
	
};
*/