var lang="GB"
var target="index.htm"
var varinaddress=window.location.search

//Ensures language is passed to next page
function changepage(target)
{
pagechange = target + '?' + lang
window.location = pagechange
}

//Picks up language on page load
function load()
{
if(varinaddress.substring(0,1) == '?') {
	varinaddress = varinaddress.substring(1)
}
if(varinaddress == 'GB') {
	setGB()
	lang="GB"
	langrestore()
}
if(varinaddress == 'FR') {
	setFR()
	lang="FR"
	langrestore()
}}
//
//functions to change language icon appearance on hover etc.
function hoverFR()
{
document.getElementById('FRicon').src="images/LangFR_ON.gif"
document.getElementById('GBicon').src="images/LangGB_OFF.gif"
}
//
function hoverGB()
{
document.getElementById('GBicon').src="images/LangGB_ON.gif"
document.getElementById('FRicon').src="images/LangFR_OFF.gif"
}
//
//Restores spotlight to previsouly sleected language icon post hover
function langrestore()
{
if(lang==''){
	lang='GB'
}
switch(lang)
{
case 'GB':
	document.getElementById('GBicon').src="images/LangGB_ON.gif"
	document.getElementById('FRicon').src="images/LangFR_OFF.gif"
	break
case 'FR':
	document.getElementById('GBicon').src="images/LangGB_OFF.gif"
	document.getElementById('FRicon').src="images/LangFR_ON.gif"
	break
}}
//
//Functions to change text and other elements in core header and footer components on lang icon click
function setcoreFR()
{
lang="FR"
//header navigation buttons text
document.getElementById('Navbtn1').innerHTML='Acceuil'
document.getElementById('Navbtn2').innerHTML='Contacts'
document.getElementById('Navbtn3').innerHTML='Pourquoi le nom Spark?'
document.getElementById('Navbtn4').innerHTML='Que fait Spark?'
document.getElementById('Navbtn5').innerHTML='Pourquoi est-on unique?'
document.getElementById('Navbtn6').innerHTML='Nous joindre?'
//footer text navigation links
document.getElementById('Navtxt1').innerHTML='Acceuil'
document.getElementById('Navtxt2').innerHTML='Contacts'
document.getElementById('Navtxt3').innerHTML='Pourquoi le nom Spark?'
document.getElementById('Navtxt4').innerHTML='Que fait Spark?'
document.getElementById('Navtxt5').innerHTML='Pourquoi est-on unique?'
document.getElementById('Navtxt6').innerHTML='Nous joindre?'
document.getElementById('copyright').innerHTML='Tous droits réservés MMVI Spark Business Solutions Ltd'
}
//
function setcoreGB()
{
lang="GB"
//header navigation buttons text
document.getElementById('Navbtn1').innerHTML='Home'
document.getElementById('Navbtn2').innerHTML='Contact Us'
document.getElementById('Navbtn3').innerHTML='Why the name Spark?'
document.getElementById('Navbtn4').innerHTML='What is Spark'
document.getElementById('Navbtn5').innerHTML='What makes Us unique?'
document.getElementById('Navbtn6').innerHTML='Working with Us'
//
//footer text navigation links
document.getElementById('Navtxt1').innerHTML='Home'
document.getElementById('Navtxt2').innerHTML='Contact Us'
document.getElementById('Navtxt3').innerHTML='Why the name Spark?'
document.getElementById('Navtxt4').innerHTML='What is Spark'
document.getElementById('Navtxt5').innerHTML='What makes Us unique?'
document.getElementById('Navtxt6').innerHTML='Working with Us'
document.getElementById('copyright').innerHTML='© Copyright MMVI Spark Business Solutions Ltd'
}