var language;
var currentPage;

	this.language = location.href.substr(location.href.lastIndexOf('/')-2,2)
	document.write("<style type='text/css' media='screen, print'>	@import url('../css/menu_"+this.language+".css');</style>");
	this.currentPage = location.href.substr(location.href.lastIndexOf('/')+1);
	this.currentPage = this.currentPage.replace(".htm","");

if (this.currentPage == "demoAlbum")
	this.currentPage="accueil";
	
function setTextLang(){
     if(document.getElementsByTagName){ 
          MatchHeight(); 
     } 
	
	if (this.language == "en"){
		document.title = "Old Montréal Ghosts";
		document.getElementById("accueil").title = "Home";
		document.getElementById("legendes").title = "Traditional Ghost Walk";
		document.getElementById("chasse").title = "Ghost Hunts";
		document.getElementById("groupel").title = "Traditional Ghost Walk Group Info";
		document.getElementById("groupec").title = "Ghost Hunts Group Info";
		document.getElementById("groupel").innerHTML = "&nbsp;Traditional Ghost Walk";
		document.getElementById("groupec").innerHTML = "&nbsp;Ghost Hunts"
		document.getElementById("autres").title = "Other cities";
		document.getElementById("contact").title = "To Contact Us";

	}
	else{
		document.title = "Les Fantômes du Vieux-Montréal";
		document.getElementById("accueil").title = "Accueil";
		document.getElementById("legendes").title = "Légendes et Histoires";
		document.getElementById("chasse").title = "Chasses aux Fantômes";
		document.getElementById("groupel").title = "L&eacute;gendes et Histoires Info Groupe";
		document.getElementById("groupec").title = "Chasse aux Fantômes Info Groupe";
		document.getElementById("groupel").innerHTML = "&nbsp;Légendes et Histoires";
		document.getElementById("groupec").innerHTML = "&nbsp;Chasses aux Fantômes";
		document.getElementById("autres").title = "Autres villes";		
		document.getElementById("contact").title = "Pour nous contacter";
	} 
}

function SwitchLanguage(){
	(this.language == "en")?this.language = "fr":this.language = "en";
	urlStr = "../" + this.language +"/"+ location.href.substring(location.href.lastIndexOf('/')+1);
	window.location = urlStr;
}

function MatchHeight(){ 
     var divs,contDivs,maxHeight,divHeight,d; 

     divs=document.getElementsByTagName('div'); 
     contDivs=[]; 
     maxHeight=0; 

     for(var i=0;i<divs.length;i++){ 
          if(/\bcontrolHeight\b/.test(divs[i].className)){ 
                d=divs[i]; 
                contDivs[contDivs.length]=d; 
                if(d.offsetHeight){divHeight=d.offsetHeight;} 
                else if(d.style.pixelHeight){divHeight=d.style.pixelHeight;} 
                maxHeight=Math.max(maxHeight,divHeight); 
          } 
     } 
     for(var i=0;i<contDivs.length;i++){ contDivs[i].style.height=maxHeight+"px"; } 
}

function popUp(page) {
var win = window.open (page,"mywindow","menubar=0,resizable=1,location=0,scrollbars=0,width=820,height=710");
win.focus()
}


