$(document).ready(function() {
	
	// Recupération de l'#Anchor dans l'url
	var urlAnchor = jQuery.url.attr("anchor");
	
	// Est-ce qu'un cookie répond au nom de cookieProjexCarteDeVoeux2012
	var nomcookie = 'cookieProjexCarteDeVoeux2012';
	var cookvalue = jQuery.extendedjsoncookie( 'getCookieValueDecoded',nomcookie);

	// Pas de cookie, alors création avec affection des valeurs par default
	if ( cookvalue  == null)
	{
		jQuery.extendedjsoncookie( 'setCookieVariable', nomcookie, "state", "true" );
		jQuery.extendedjsoncookie( 'setExtendedAttributes', nomcookie, { expires: 7 } );
		ProjexCarteDeVoeux2012();
	}
	
	
	// Si l'Anchor est #projex on affiche la Carte de Voeux
	if ( urlAnchor == 'projex' ) {ProjexCarteDeVoeux2012();}


	// Affiche la carte de voeux
	function ProjexCarteDeVoeux2012 () {
		
		$(window).load(function () {
			
			Shadowbox.init({
				skipSetup: true,
				flashParams : {bgcolor:"#ffffff"},
				overlayColor : "#333",
				overlayOpacity : 0
			});
			
			Shadowbox.open({
				content: 'flash/Projex_CarteDeVoeux_2012.swf',
				player : 'swf',
				height:     450,
				width:      600	
			});
			
		});
	}

});
