
/* language switch to French */
function changeLanguageFr(headerPage) 
{
	//length of URL passed  from header
	var len = headerPage.length
	//position of period in the URL
	var posPeriod = headerPage.lastIndexOf("."); 
	//position of underscore in the URL
	var posUnderScore = headerPage.lastIndexOf("_");
	//divides the URL into parts - beginning until the "_"
	var textToUnderscore = headerPage.substring(0, posUnderScore ) 
	//divides the URL into parts - end back to the until the "."
	var textEndToPeriod = headerPage.substring(len, posPeriod) 
	//new URL - open french equivalent 
	var newPage = textToUnderscore + "_fra" + textEndToPeriod
//	alert(" Passed page: "  + headerPage  + " length: " +  len + " position: " + posPeriod + " underscore: " + posUnderScore + " part1 " + textToUnderscore + " part2 " + textEndToPeriod + " newpage " + newPage);  
	//open URL in same location
	window.location=newPage
}


/* language switch to English */
function changeLanguageEn(headerPage) 
{
	//length of URL passed  from header
	var len = headerPage.length
	//position of period in the URL
	var posPeriod = headerPage.lastIndexOf("."); 
	//position of underscore in the URL
	var posUnderScore = headerPage.lastIndexOf("_");
	//divides the URL into parts - beginning until the "_"
	var textToUnderscore = headerPage.substring(0, posUnderScore ) 
	//divides the URL into parts - end back to the until the "."
	var textEndToPeriod = headerPage.substring(len, posPeriod) 
	//new URL - open french equivalent 
	var newPage = textToUnderscore + "_eng" + textEndToPeriod
//	alert(" Passed page: "  + headerPage  + " length: " +  len + " position: " + posPeriod + " underscore: " + posUnderScore + " part1 " + textToUnderscore + " part2 " + textEndToPeriod + " newpage " + newPage);  
	//open URL in same location
	window.location=newPage
}


