$(document).ready(function() { 						   
	$("ul#nav li").hover(
		function() { $(".holder", this).css("display", "block"); $(this).addClass("over"); },
		function() { $(".holder", this).css("display", "none"); $(this).removeClass("over");}
	);
	
	$("ul.map li").click(function() {
	$(this).addClass('selected');
	$(this).siblings().removeClass('selected');
	});

		
});

		   
function pageLinkClicked(linkId)
 {
	 //alert(" --send linkId : "+linkId);
	  
	  if (readCookie('language')!='eng')
	  {window.location.href = "/"+readCookie('language')+"/about-us/worldwide-facilities/index.html?hotspot.value="+linkId+"";}
	  else
	  {window.location.href = "/about-us/worldwide-facilities/index.html?hotspot.value="+linkId+"";}
	  
 } 
 

	function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
	}
    function changelang(lang) {
		
		var fullpath = window.location.pathname;
		var path = window.location.pathname.split( '/' );

		//would have been much easier if eng was in a folder too.
		if((path[1].length == 3) && (lang != 'eng'))
		{
			window.location = window.location.pathname.replace(path[1], lang);
		}
		else if((path[1].length != 3) && (lang !='eng'))
		{
			window.location = window.location.pathname.replace(path[0], path[0]+'/'+lang);
		}
		else if((path[1].length == 3) && (lang == 'eng'))
		{
			window.location = window.location.pathname.replace(path[1]+'/','');
		}
		createCookie('language',lang,300)
	}
	function readCookie(name) {
		var nameEQ = name + "=";
		var ca = document.cookie.split(';');
		for(var i=0;i < ca.length;i++) {
			var c = ca[i];
			while (c.charAt(0)==' ') c = c.substring(1,c.length);
			if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	function eraseCookie(name) {
		createCookie(name,"",-1);
	}
	


