var OSName="Unknown OS";
			if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows";
			if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS";
			if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX";
			if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux";
			if (OSName == "Windows")
			{
				 var le_os = "<link type='text/css' rel='stylesheet' href='/Resources/Styles/main.css'>"
				 document.write(le_os);
			}
			else
			{
				 var le_os = "<link type='text/css' rel='stylesheet' href='/Resources/Styles/main-mac.css'>"
				 document.write(le_os);
			}
			
// General Test Function
function test(){
	alert('test');
}


function PopupLegal(url){
	window.open(url);
	alert(url);
}

/*  Javascript pour gérer l'affichage des contacts selon les ancres passée dans l'url 
    ie : url_de_la_page.htm#ancre_meme_nom_que_le_id
    
    Par defaut, s'il n'y a pas d'ancre : affiche tous les contacts
    url_de_la_page.htm#all : affiche tous les contacts
    url_de_la_page.htm#admin : affiche les contacts administratif
    url_de_la_page.htm#ir : affiche les contacts Investor Relations
    etc.
    
    pour les locations////////////////////
    url_de_la_page.htm#loc_all : affiche toutes les locations
    url_de_la_page.htm#loc_quebec : affiche la location quebec

*/

	function affich(affichall,ref){
        if(affichall && ref == "interne"){       
            // Lorsque l'on clique sur "Show All Contacts"
            window.location = "contact-us.aspx";
        }else{
            leurl = location.hash;
            var sec = leurl.indexOf("#");
            if(sec == -1){
                // On arrive sur la page, sans avoir de anchor "setter"
                // On affiche alors tous les contacts
                var pars = document.getElementById("contact").getElementsByTagName('div');
                    for (var i=0;i<pars.length;i++) {
                        pars[i].style.display = "block";
                    }
                     document.getElementById("showloc").innerHTML = "Hide All Locations";
                     document.getElementById("showall").style.display = "none";
                     document.getElementById("locations").style.visibility = "visible";
            }else{
                // Si il y a un anchor dans le URL
                var ext = leurl.substr(sec+1);
                //workaround pour bug qui remonte la page selon l'ancre
						if(ext == "admin"){ext = "administration"}
						if(ext == "media"){ext = "medias"}
						if(ext == "ir"){ext = "invesrelat"}
						if(ext == "environment"){ext = "enviro"}
						if(ext == "products"){ext = "product"}
                if(ext == "all" || ext == "top"){
                // Si le anchor = all
                // On affiche alors tous les contacts
                    var pars = document.getElementById("contact").getElementsByTagName('div');
                    for (var i=0;i<pars.length;i++){
                        pars[i].style.display = "block";
                    }
                    document.getElementById("locations").style.visibility = "visible";
                    document.getElementById("showall").style.display = "none";
                    document.getElementById("showloc").innerHTML = "Hide All Locations";
                }
                else if(ext.match("loc")){
                    document.getElementById("locations").style.visibility = "visible";
                    //document.getElementById("titre").innerHTML = "";
                    var ext2 = ext.substr(4)
                    if(ext2 == "all"){
                    // Si le anchor = loc_all
                    // On affiche toutes les locations seulement
                      var pars = document.getElementById("locations").getElementsByTagName('div');
                      for (var i=0;i<pars.length;i++) {
                            pars[i].style.display = "block";
                         }
                         document.getElementById("showloc").innerHTML = "";
                    }
                    else{
                        // Si le anchor = loc_xx ou xx = nom d'une location
                        // On affiche la location xx seulement
                        ext2 = ext2.toLowerCase();
                        var pars = document.getElementById("contact").getElementsByTagName('div');
						for (var i=0;i<pars.length;i++){
							pars[i].style.display = "none";
						}
                        if(document.getElementById(ext2))
                        { 
                        document.getElementById("locations").style.display = "block"; 
                        document.getElementById(ext2).style.display = "block"; 
                        document.getElementById("showloc").innerHTML = "Show All Locations"
                        }
                    }
                }else{
                     // Si anchor = xx ou xx = section (comme média/IR/admin...)
                     // On affiche la section seulement
					 
					 var pars = document.getElementById("contact").getElementsByTagName('div');
						
						var pars = document.getElementById("contact").getElementsByTagName('div');
						for (var i=0;i<pars.length;i++){
							pars[i].style.display = "none";
						}
                        if(document.getElementById(ext))
                        { 
                        document.getElementById(ext).style.display = "block"; 
                        }
				}
            } 
        }
    }

    function showallloc(){
        if(document.getElementById("showloc").innerHTML == "Back to one location"){
            window.location.reload();
            document.getElementById("showloc").innerHTML = "Show All Locations";
            document.getElementById("locations").style.visibility = "visible";
        }else if(document.getElementById("showloc").innerHTML == "Hide All Locations"){
           var pars = document.getElementById("locations").getElementsByTagName('div');
            for (var i=0;i<pars.length;i++) {
            // display tous les div dans l'éléments id=locations
               pars[i].style.display = "none";
            }
            //document.getElementById("h2locations").style.visibility = "hidden";
            document.getElementById("showloc").innerHTML = "Show All Locations";
        }else{
            //document.getElementById("h2locations").style.visibility = "visible";
            var pars = document.getElementById("locations").getElementsByTagName('div');
            for (var i=0;i<pars.length;i++) {
            // display tous les div dans l'éléments id=locations
               pars[i].style.display = "block";
            }
            var a = location.hash;
            if(a == "" || a == "#all" || a == "#loc_all" || !a.match("loc_")){
                document.getElementById("showloc").innerHTML = "Hide All Locations";
                document.getElementById("locations").style.visibility = "visible";
            }else{
                document.getElementById("locations").style.visibility = "visible";
                document.getElementById("showloc").innerHTML = "Back to one location";
            }
        }
    }
	function over(lequel){
		//var strg = location.pathname;
		/*
		var strg = location.pathname;
		
		var lastrg = strg.substring((strg.lastIndexOf("/") +1),strg.lastIndexOf("."));
		var finalStrg =  lastrg.replace(/-/g, "");
		var finalStrgImg = finalStrg +"img";
		
		if(finalStrg == "Accueil"){finalStrg = "accueil";}
		if(finalStrg == "pournousjoindre"){finalStrg = "contactus";}
		if(finalStrg == "cartedesoperations"){finalStrg = "mapofoperations";}
		if(finalStrg == "cartedusite"){finalStrg = "sitemap";}
		
		if(lequel == "en")
		{
		document.getElementById(finalStrgImg).src = "/Resources/Images/en-CA/btn_hdr_tbx_"+finalStrg+"_o.gif";
		}
		else
		{
		document.getElementById(finalStrgImg).src = "/Resources/Images/fr-CA/btn_hdr_tbx_"+finalStrg+"_o.gif";
		}
		*/

	}

	function browser(){
		if(navigator.appName.indexOf("Microsoft") == -1){
			return false;
		}else{
			return true;	
		}
	}
	
	function hidelegend(up){
		if(navigator.appName.indexOf("Microsoft") == -1){
			if(!up){
				document.getElementById("div6").style.top = "-180px";
				document.getElementById("div6").style.height = "180px";	
			}else{
				document.getElementById("div6").style.top = "-30px";
				document.getElementById("div6").style.height = "30px";
			}
		}
	}
	
	