/** 
* @alias functions.js
* @projectDescription France 2 & France 3, versions 2.0
* @author	[FTVI] Guyllaume Doyer
*/


// ---------------------------------------------------------------------------------------------- \\
// Jquery init event
// ---------------------------------------------------------------------------------------------- \\
$(document).ready(function()
{
	launchVideo();
});

function launchVideo(id)
{
	
	$("#relatedVideosBlk01 a, #articleBlk01 a").click(function()
	{
		if ($(this).attr("onclick") != null)
		{
			var onclickValue = $(this).attr("onclick").toString();
			
			if(onclickValue.indexOf("launchVideo") > -1)
			{

				$(this).attr("href","#");
	
				var videoID = $(this).attr("oid");
				var jqobj = $("form[name=myform]");
				jqobj.find("input[name=courant]").attr("value",videoID);
				window.open('http://medias.francetv.fr/common/playerVideo.php','myPopUp','width=634,height=469,status=no,location=no,toolbar=no,scrollbars=auto,menubar=no,resizable=yes');
				jqobj.trigger("submit");
				
				return false;
			}
		}
	});
}

