<!--


var	CK_LANGUAGE	= 'visitor_lang';
var	CV_ENGLISH	= 'English';
var	CV_FRENCH	= 'French';






var lang = getCookie(CK_LANGUAGE);

				

function getCookie(c_key){

	// Is there a cookie?	
	if(document.cookie != ''){
		// Split the cookie into individual components	
	  	var cookies = document.cookie.split(/;/);
		var c_val	= "";
		var found	= false;
		var i 		= 0;
	  	// Loop to scan the (Array)
			 	
		while((i < cookies.length) && (found == false)){
		
	 		// Split cookies' name and value
	  		cookies[i] = cookies[i].split(/=/);
			if ( c_key == cookies[i][0]){
				c_val	= cookies[i][1];	
				found	= true;							
			};
			i++;
		  			} // End while
		} // End while
			return c_val;	
	} // End getCookie	



function setCookie(c_key, c_value){
	var expires = new Date(2010,12,24);
	document.cookie = c_key + "=" + c_value + "; expires=" + expires.toGMTString();

//	lang = getCookie(CK_LANGUAGE);
	lang = c_value; 
	return;
} // End setCookie




function setLanguage(){

// This function is to switch the language cookie from French to English and vice versa.

	var alternate = location.href;
//	alert ( 'Before Location : ' + alternate + ' language: ' + lang + '<br>');
	if (lang == CV_ENGLISH) {

		setCookie (CK_LANGUAGE, CV_FRENCH);
		alternate = alternate.replace(/en\//i, 'fr\/');
	}
	else{
		if (lang == CV_FRENCH){
			setCookie (CK_LANGUAGE, CV_ENGLISH);
			alternate = alternate.replace(/fr\//i, 'en\/');
		}
		else alert( ' Screwy language' + lang );
	}
//	alert ( 'After Location : ' + alternate + ' language: ' + lang + '<br>');
	location.href = alternate;

	return;
} // End SetLanguage

	
//-->
		
	