var ganal = false;

var Ctrl = new function()
{
	var options;
	
	this.init = function(opt)
	{
		Ctrl.options = opt;
		
		// transformation des onglets en liste tabulaire
		$('#onglet ul').tabs({ event: 'mouseover', fxFade: true , fxSlide: true });
		
		// transformation des h1 class="replace_" en images statiques
		$("h1[@class*='replace_']").each(function(){
			var nom_image = $(this).attr("class").substring(8)+".jpg";
			var image = Ctrl.options.relative_url_root+'images/'+nom_image;
			$(this).html("<img src='"+image+"' />");
		});
		
		// transformation des h2 class="replace_" en images statiques
		$("h2[@class*='replace_']").each(function(){
			var data = $(this).metadata();
			var href = data.href;
			$(this).html("<img src='"+href+"' />");
		});

		$('#inscription_success').click( function (){ 
      	if ($('#confirmation').attr("checked")) 
			return true;
		else {
			alert("Les conditions ne sont pas cochées");
			return false;
		}
    	})
		
		if (Ctrl.options.seo_user)
			Seo.init(Ctrl.options);
			
		if (!ganal) {
			var pageTracker = _gat._getTracker("UA-3729905-1");
			pageTracker._initData();
			pageTracker._trackPageview();
			ganal = true;
		}
	}
	
}


$(function(){
  Config.init(page_options);
  Util.init(page_options);
	Ctrl.init(page_options);
});