	jQuery(document).ready(function(){
		/* script pour afficher selon la langue */
			var maLangue = jQuery("#dnn_dnnFORTSUM_LANGUE_DisplayLangue").text();
			var maChaine = "English";
			var valPresent = maLangue.indexOf(maChaine);
			var maClasse = ".francaisSeulement";

			if (maLangue == maChaine){
				jQuery(maClasse).show(0);
			} else {
				jQuery(maClasse).hide(0);
			}

			/* script pour event tracker pour Google Analytics */
			jQuery('a').click(function(){
				var eventCategory = document.title;
				var trackURL 	= jQuery(this).attr('href');
				var text 		= jQuery(this).text();
				var tagNameLinkChildren = jQuery(this).children().attr("tagName")
				
				if(tagNameLinkChildren != undefined){
					switch(tagNameLinkChildren)
					{
					case "IMG":
						if (jQuery(this).children().attr("alt")){
							text = "("+tagNameLinkChildren+") - alt: " + jQuery(this).children().attr("alt");
						} else if (jQuery(this).children().attr("title")){
							text = "("+tagNameLinkChildren+") - title: " + jQuery(this).children().attr("title");
						} else {
							text = "("+tagNameLinkChildren+") - src: " + jQuery(this).children().attr("src");
						}
						break;
					case "div":
						text = "("+tagNameLinkChildren+") - id: " + jQuery(this).children().attr("id");
						break;
					case "SPAN":
						text = jQuery(this).text();
						break;
					default:
						//Ne fait rien
					}
				}
				
				trackClick(text,trackURL,eventCategory);
			});
		
		
		/* Saisie du nom d'entreprise */
		if ( jQuery("#dnn_dnnFORTSUM_BIENVENUE_LblNomCompagnie").length > 0 ) {
			trackCustomVariables(2, "Entreprise", jQuery("#dnn_dnnFORTSUM_BIENVENUE_LblNomCompagnie").text());
		} else {
			trackCustomVariables(2, "Entreprise", "inconnu");
		}
		
		/* Saisie du plan de service */
		if ( jQuery(".Bienvenue_lblRecommande").length > 0 ) {
			trackCustomVariables(3, "Partenaire", jQuery(".Bienvenue_lblRecommande li:first").text());
		} else if ( jQuery(".Bienvenue_lblElite").length > 0 ) {
			trackCustomVariables(3, "Partenaire", jQuery(".Bienvenue_lblElite li:first").text());
		} else if ( jQuery(".Bienvenue_lblCertifie").length > 0 ) {
			trackCustomVariables(3, "Partenaire", jQuery(".Bienvenue_lblCertifie li:first").text());
		} else if ( jQuery(".Bienvenue_lblAutorise").length > 0 ) {
			trackCustomVariables(3, "Partenaire", jQuery(".Bienvenue_lblAutorise li:first").text());
		} else if ( jQuery(".Bienvenue_LitPlan").length > 0 ) {
			trackCustomVariables(3, "Client", jQuery(".Bienvenue_LitPlan li:first").text());
			} else {
			trackCustomVariables(3, "Client", "inconnu");
		}
		
		
		/* Layer a href pour les bannières Flash */
		if ( jQuery("#flashAnnonce").length > 0 ) {
			var divFlash = document.getElementById("flashAnnonce");
			 
			var curr_width = divFlash.offsetWidth;
			var curr_height = divFlash.offsetHeight;
			
			jQuery("#lienAnnonce").css({'width' : curr_width, 'height' : curr_height});
		}
		
	//*************Simple Accordion w/ CSS and jQuery*******************/

	jQuery('.acc_container').hide(); //Hide/close all containers
	//jQuery('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
	
	//On Click
	jQuery('.acc_trigger').click(function(){
		if( jQuery(this).next().is(':hidden') ) { //If immediate next container is closed...
			jQuery('.acc_trigger').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
			jQuery(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
		}
		else {
			jQuery(this).removeClass('active').next().slideUp()
		}
		return false; //Prevent the browser jump to the link anchor
	});


	//*************Simple Tabs w/ CSS & jQuery*******************/

	//When page loads...
	jQuery(".tab_content").hide(); //Hide all content
	jQuery("ul.tabs li:first").addClass("active").show(); //Activate first tab
	jQuery(".tab_content:first").show(); //Show first tab content

	//On Click Event
	jQuery("ul.tabs li").click(function() {

		jQuery("ul.tabs li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tab_content").hide(); //Hide all tab content

		var activeTab = jQuery(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		jQuery(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});
		
	});
	
	jQuery(window).load(function () {
		var currentTime = new Date();
		var month = currentTime.getMonth() + 1;
		var day = currentTime.getDate();
		var year = currentTime.getFullYear();
		var hour = currentTime.getHours();
		var minutes = currentTime.getMinutes();
		var seconds = currentTime.getSeconds();
		var affichage = "" + year + "-" + month + "-" + day + "_" + hour + "-" + minutes + "-" + seconds + "";
		trackCustomVariables(4, "Date-Heure", "" + affichage + "");
		trackCustomVariables(1, "Titre page", "" + document.title + "");
	});

	var _gaq = _gaq || [];
	_gaq.push(['_setAccount', 'UA-19911591-1']);
	_gaq.push(['_trackPageview']);
	(function() {
		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		})();
		
	function trackClick(text,link,title) {
		_gaq.push(['_trackEvent',text,link,title]);
	};
	
	function trackCustomVariables(dataSlot, dataName, dataValue){
		_gaq.push(['_setCustomVar',dataSlot,dataName,dataValue,3]);
	}
	
	String.prototype.trim = function() {
	return this.replace(/^\s+|\s+$/g,"");
	}
