// JavaScript Document

// Active une sÃ©rie d'Ã©lÃ©ments
// activerElements(idItem1:String {, idItem2:String, ...})

function activerElements() {
	if ( document.getElementById ) {
		var aElements = activerElements.arguments;
		
		for ( var cElements = 0; cElements < aElements.length; cElements++ ) {
			var eSection;
			if ( eSection = document.getElementById(aElements[cElements]) )
				eSection.className = "actif " + eSection.className;
		}
	}
}


// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// Historique de mise Ã  jour
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
// 2007-10-20 : Vincent
//				CrÃ©ation du script
//
// 2008-01-28 : Vincent
//              Ajout d'un addEventListener pour automatiser le script au lieu de le lancer Ã  partir d'une fonction window.onload
function GenererLiensExternes() {
	var aAncres = document.getElementsByTagName("a");
	var eAncre, uri;
	
	for ( var cAncres = 0; cAncres < aAncres.length; cAncres++ ) {
		eAncre = aAncres[cAncres];
		uri = eAncre.href;
		
		if ( !eAncre.onclick ) {
			if ( ( uri.indexOf(document.domain) == -1 && uri.indexOf("mailto:") == -1 && uri.indexOf("javascript:") == -1 ) || uri.substring( uri.length - 3 ).toLowerCase() == "pdf" )
				eAncre.onclick = function () { window.open(this.href); return false; };
		}
	}
}





/*
Welcome LightBox
------------------------------------------------------------------------------------------------------------

$("document").ready(
	function() {
		var oCookies = new CookieObject();
		if (oCookies.get("visited") != "true") {
			var welcomeLightbox = new LightBox("welcome-lightbox", { backgroundOpacity: .75, closeButtonLabel: $("body").hasClass("lang-fr") ? "DÃ©buter votre visite >" : "Start the tour >" });
			welcomeLightbox.openWindow();
		} else {
			$("#welcome-lightbox").remove();
		}
		oCookies.set("visited", "true", "year;1", "/");
	}
);
*/



/* Plan du site Toggle */
//<![CDATA[
/*$(document).ready(function(){	
	
	$('.sitemap a').click(function() {
		$('#sitemap').slideToggle(400);
		$(this).toggleClass("actif");
		return false;			
	});

	$(".scroll").click(function(event){
		//prevent the default action for the click event
		event.preventDefault();
		
		//get the full url
		var full_url = this.href;
		
		//split the url by # and get the anchor target name
		var parts = full_url.split("#");
		var trgt = parts[1];
		
		//get the top offset of the target anchor
		var target_offset = $("#"+trgt).offset();
		var target_top = target_offset.top;
		
		//goto that anchor by setting the body scroll top to anchor top
		$('html, body').animate({scrollTop:target_top}, 500);
	});

});*/

//]]>

// ADDTHIS

var addthis_config =
{
	ui_cobrand: "Voxco",
	services_compact: "email, linkedin, facebook, twitter, viadeo",
	services_exclude: "print",
	ui_header_color: "#ffffff",
	ui_header_background: "#5fb3ff",	
	ui_offset_left: -170,
	ui_offset_top: -10
}


// Attache l'Ã©vÃ©nement au chargement de la page
if ( window.addEventListener )
	window.addEventListener("load", GenererLiensExternes, false);
else if ( window.attachEvent )
	window.attachEvent("onload", GenererLiensExternes);
