//---------------------------------------------------------------+
//   This function allows the rollover effect for the top menu   |
//---------------------------------------------------------------+
function MenuButton(Mode,Button){
	(Mode == 'on') ? document.getElementById(Button).className = "ActiveButton" : document.getElementById(Button).className = "MenuButton"
}


//---------------------------------------------------------------------+
//   This function allows to change the language of the current page   |
//---------------------------------------------------------------------+
function SelectLanguage(Idiom){

	//-- Get 'raw' file name from existing page
	// There are only 2 solutions: the file is in 1) xxx.html format; or 2) xxx-x.html
	URLString = window.location.href
	FileName = URLString.lastIndexOf('.')
	LastSlash = URLString.lastIndexOf('/')
	
	// Get file name
	if(URLString.substring(FileName-2,FileName-1) != '-'){
		FileName = URLString.substring(LastSlash+1,FileName)
	}
	else{
		FileName = URLString.substring(LastSlash+1,FileName-2)
	}
	
	//-- Depending on chosen language serve proper file
	switch(Idiom){
		case "french":
			window.location.href = FileName + '.html'
			break
		case "english":
			window.location.href = FileName + '-e.html'
			break
	}
}


//--------------------------------------------------------------------------------------------+
//   This function allows the rollover effect on the side menu in the "les granges" section   |
//--------------------------------------------------------------------------------------------+
function SideRollover(Mode,Button){
	IdLink = Button + 'Link'
	
	if (Mode == 'on'){
		document.getElementById(Button).className = "SideButtonHighlight"
		document.getElementById(IdLink).className = "SideLinkHighlight"
	}
	else{
		document.getElementById(Button).className = "SideButton"
		document.getElementById(IdLink).className = "SideLink"
	}
}