function changeHome(){
    if (getCookie("AC-Signon-Cookie")){
		document.location.href = "/site_selector.html";
	}else{
		document.cookie = "new_lang_pref" + "=" + "" + "; path=" + "/"  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
    	document.cookie = "country_pref" + "=" + "" + "; path=" + "/"  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
		location.replace('http://www.aircanada.com');      		
	}	
}

function gotolink(link){
	document.location=link;
}

function changeFHome(){
	var cookieName='new_lang_pref';
	var cookieValue='french';
	if (getCookie("AC-Signon-Cookie")){
	   var countrySiteCookie = getCookie('AC_country_site');
	   if (countrySiteCookie != null && countrySiteCookie != "" ){
			countrySiteValue = countrySiteCookie.split ('^');
			countryCookieValue = countrySiteValue[0];
			var sitecookieValue = countryCookieValue+"^"+cookieValue;
			document.cookie = "AC_country_site" + "=" + cookieValue + "; path=" + cookiePath  + "; domain=" + domain; 
			if (countryCookieValue == "FR")
	    	   document.location.href='http://www.aircanada.com/france/home.html'; 
			else if (countryCookieValue == "CH")
	    	   document.location.href='http://www.aircanada.com/ch/fr/home.html'; 
			else
				document.location.href='http://www.aircanada.com/fr/home.html'; 
	   }else{
	   		 document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
			switch (getCookie("country_pref")) {
				case "FR":
				case "CH":
				case "DE":
				case "IT":
					cc=getCookie("country_pref");
					location.replace('http://www.aircanada.com/setcookie_'+cc+'_fr.html');
					break;
			    default:
					location.replace('http://www.aircanada.com/setcookie_fr.html');
					break;
			}
	   }	  
	}else{
	   document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
			switch (getCookie("country_pref")) {
				case "FR":
				case "CH":
				case "DE":
				case "IT":
					cc=getCookie("country_pref");
					location.replace('http://www.aircanada.com/setcookie_'+cc+'_fr.html');
					break;
			    default:
					location.replace('http://www.aircanada.com/setcookie_fr.html');
					break;
			}
	}	
}

function changeEHome(){
	var cookieName='new_lang_pref';
	var cookieValue='english';
	if (getCookie("AC-Signon-Cookie")){
	   var countrySiteCookie = getCookie('AC_country_site');
	   if (countrySiteCookie != null && countrySiteCookie != "" ){
			countrySiteValue = countrySiteCookie.split ('^');
			countryCookieValue = countrySiteValue[0];
			var sitecookieValue = countryCookieValue+"^"+cookieValue;
			document.cookie = "AC_country_site" + "=" + cookieValue + "; path=" + cookiePath  + "; domain=" + domain; 
			if (countryCookieValue == "FR")
	    	   document.location.href='http://www.aircanada.com/france/en/home.html'; 
			else if (countryCookieValue == "CH")
	    	   document.location.href='http://www.aircanada.com/ch/en/home.html';
			else
				document.location.href='http://www.aircanada.com/en/home.html'; 
	   }else{
	   		 document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
			switch (getCookie("country_pref")) {
				case "FR":
				case "CH":
				case "DE":
				case "IT":
					cc=getCookie("country_pref");
					location.replace('http://www.aircanada.com/setcookie_'+cc+'_eng.html');
					break;
			    default:
					location.replace('http://www.aircanada.com/setcookie_eng.html');
					break;
			}
	   }	  
	}else{
	   document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
		switch (getCookie("country_pref")) {
			case "FR":
			case "CH":
			case "DE":
			case "IT":
				cc=getCookie("country_pref");
				location.replace('http://www.aircanada.com/setcookie_'+cc+'_eng.html');
				break;
		    default:
				location.replace('http://www.aircanada.com/setcookie_eng.html');
				break;
		}
	}	  
}

function changeEFRHome(){
	var cookieName='new_lang_pref';
	var cookieValue='english';
	if (getCookie("AC-Signon-Cookie")){
	   var countrySiteCookie = getCookie('AC_country_site');
	   if (countrySiteCookie != null && countrySiteCookie != "" ){
			countrySiteValue = countrySiteCookie.split ('^');
			countryCookieValue = countrySiteValue[0];
			var sitecookieValue = countryCookieValue+"^"+cookieValue;
			document.cookie = "AC_country_site" + "=" + cookieValue + "; path=" + cookiePath  + "; domain=" + domain; 
			if (countryCookieValue == "FR")
	    	   document.location.href='http://www.aircanada.com/france/en/home.html'; 
			else if (countryCookieValue == "CH")
	    	   document.location.href='http://www.aircanada.com/ch/en/home.html';
			else
				document.location.href='http://www.aircanada.com/en/home.html'; 
	   }else{
	   		 document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
			 if (getCookie("country_pref") == "FR")
	   		   	 location.replace('http://www.aircanada.com/setcookie_FR_eng.html');
			else if (getCookie("country_pref") == "CH")
	   		   	 location.replace('http://www.aircanada.com/setcookie_CH_eng.html');
			 else
	   	  	 	 location.replace('http://www.aircanada.com/setcookie_eng.html');
	   }	  
	}else{
	   document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
	   if (getCookie("country_pref") == "FR")
	   	  location.replace('http://www.aircanada.com/setcookie_FR_eng.html');
	   else if (getCookie("country_pref") == "CH")
	   	  location.replace('http://www.aircanada.com/setcookie_CH_eng.html');
	   else
	   	  location.replace('http://www.aircanada.com/setcookie_eng.html');
	}	  
}

function changeNewHome(cookieValue){
	var cookieName='new_lang_pref';
	countryValue = getCookie('country_pref');
	if (getCookie("AC-Signon-Cookie")){
	   var countrySiteCookie = getCookie('AC_country_site');
	   if (countrySiteCookie != null && countrySiteCookie != "" ){
			countrySiteValue = countrySiteCookie.split ('^');
			countryCookieValue = countrySiteValue[0];
			var sitecookieValue = countryCookieValue+"^"+cookieValue;
			document.cookie = "AC_country_site" + "=" + sitecookieValue + "; path=" + cookiePath  + "; domain=" + domain; 
			if (countryValue == "CH" &&  cookieValue == "de")
				document.location.href='http://www.aircanada.com/ch/de/home.html';
			else
				document.location.href='http://www.aircanada.com/'+cookieValue+'/home.html'; 
	   }else{
	   		 document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
			if (countryValue == "CH" &&  cookieValue == "de")
				location.replace('http://www.aircanada.com/setcookie_CH_de.html');
			else	 location.replace('http://www.aircanada.com/setcookie_'+countryValue+'_'+countryValue.toLowerCase()+'.html');
	   }	  
	}else{
	   document.cookie = cookieName + "=" + escape (cookieValue) + "; path=" + cookiePath  + "; expires=" + expDate.toGMTString() + "; domain=" + domain; 
	if (countryValue == "CH" &&  cookieValue == "de")
		location.replace('http://www.aircanada.com/setcookie_CH_de.html');
	else	
		location.replace('http://www.aircanada.com/setcookie_'+countryValue+'_'+countryValue.toLowerCase()+'.html');
	}	
}

var PreviousClass;

function mouseOver(target,name_of_class) {
    PreviousClass = target.className;
    target.className = name_of_class;
}

function mouseOut(target) {
    target.className = PreviousClass;
}