<!--

function goIndex() {
 // Expire the language cookie and return to the Index page
 expireDate = new Date
 expireDate.setMonth(expireDate.getMonth()-6)
 document.cookie = "AC=en;expires=" + expireDate.toGMTString() + ";path=/"
 document.location.href = "../index.htm"
}

function goLanguage(language) {
 // Set the language cookie 
 expireDate = new Date
 expireDate.setMonth(expireDate.getMonth()+6)
 document.cookie = "AC=" + language + ";expires=" + expireDate.toGMTString() + ";path=/"

 // Set a valid flag - true for the moment...
 valid = true   
 // First we'll get the current URL...
 thisURL = document.URL
 URLlength = thisURL.length

 // Now we'll check if we're in a CGI call 

 URLend = thisURL.substring(URLlength-6,URLlength-2)
 if (URLend == "ang=") {
   // it's a CGI call so change the language code at the end
   newURL= thisURL.substring(0,URLlength-2) + language
   // there may be a backLink to change too
   // so look for /fr/ if lang is en
   // and look for /en/ if lang is fr
   langPosition = 0
   if (language == "en") {
     langPosition = newURL.indexOf("/fr/")
   }
   if (language == "fr") {
     langPosition = newURL.indexOf("/en/")
   }
   // Did we find a language code?
   if (langPosition != 0) {
     newURL = newURL.substring(0, langPosition+1) + language + newURL.substring(langPosition+3,URLlength)
   }
 }
 else {
   // this is a htm situation so we need to change the directory
   // so find the position of the end of the domain
   langPosition = thisURL.indexOf(".com/") + 5
   // now replace the language code with the one required...
   newURL= thisURL.substring(0, langPosition) + language + thisURL.substring(langPosition+2,URLlength)
 }
 //alert(newURL)
 top.location.href = newURL
}


//-->
