


// pour détecter si IE6

var ie = navigator.appName == 'Microsoft Internet Explorer';
var ie6 = ie && (navigator.appVersion.indexOf('MSIE 6.0') > -1);

if (ie6) {
	document.write('<link href="css/IE6.css" rel="stylesheet" type="text/css" />');
}


// pour changer la langue

function changeLangue() {

	var path = document.location.href;
    var pathTraduction = path;

	if ((path.indexOf('index.html') > 0) || (path.indexOf('index.asp') > 0)) pathTraduction = 'index_en.html';
	else if ((path.indexOf('index_en.html') > 0) || (path.indexOf('index_en.asp') > 0)) pathTraduction = 'index.html';
	else { 
	    var pos = path.indexOf('_fr.');
	
    	if (pos > 0) pathTraduction = path.replace('_fr.', '_en.');
   		 else {
    	    pos = path.indexOf('_en.');
        	if (pos > 0) pathTraduction = path.replace('_en.', '_fr.');
   		 }
	}
    document.location=pathTraduction;
}


// pour le menu des services

function nettoieUrl(url) {

	pos = url.lastIndexOf('/');
	if (pos == -1) {
		urlFinal = url;
	}
	else {
		pos = pos + 1;
		taille = url.length - pos;
		urlFinal = url.substr(pos, taille);
	}
	return urlFinal;
}
	
function afficheOuCache(a, ul, url) {
	//alert(url);
	aUl = document.getElementById(a);

	urlCourant = nettoieUrl(window.location.pathname);
	urlDest = nettoieUrl(url);

	// si on est dans la page courante, montrer ou cacher le menu
	// sinon, aller à la page de destination
	
	if (urlCourant == urlDest) {
	
		eUl = document.getElementById(ul);
		if (eUl.style.display == 'none') {
			eUl.style.display = 'block';
			aUl.style.backgroundPosition = '0 -64px';
		} else {
			eUl.style.display = 'none';
			aUl.style.backgroundPosition = '0 -32px';
		}
	}
	else {
		if(url.charAt(0)!='/'){url='/'+url;}		
		window.location = window.location.protocol + "//" + window.location.host+ url;
		//alert(window.location.protocol + "//" + window.location.host+ url+"\n"+window.location);
		
		//window.location=window.location.protocol + "//" + window.location.host + url;		
		//window.location = "http://www.marquedor.com/" + url;
		//window.location.pathname = url;
	}
}


function haut() {
 document.location.hash='#haut';
}
