function createCookie(name,value,days){	var expires = "";	if (days)	{		var date = new Date();		date.setTime(date.getTime()+(days*24*60*60*1000));		expires = "; expires="+date.toGMTString();	}else {			expires = "";	document.cookie = name+"="+value+expires+"; path=/";	}}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);}function myLanguage(){	var language = readCookie('Lng'); 	var rxpath =getLangPath(language);	var flag = "uk";		if (language) {	flag = retFlag(language);	}else{		flag = "uk";		$('nolanguage').innerHTML = "You have not set a default language";		}		//	return [language,rxpath];	// return as an object with 3 properties	return {name : language, path : rxpath, flag : flag};}function retFlag(z){		switch (z){  case "jp" :      f= "<img src=\"img/flag/jp.gif\" border=0>";     break;  case "en" :         f= "<img src=\"img/flag/gb.gif\" border=0>";     break;   case "it" :         f= "<img src=\"img/flag/it.gif\" border=0>";     break;  case "de" :         f= "<img src=\"img/flag/de.gif\" border=0>";     break;  case "fr" :         f= "<img src=\"img/flag/fr.gif\" border=0>";     break;  case "nl" :         f= "<img src=\"img/flag/gb.gif\" border=0>";     break;       default :        f= "<img src=\"img/flag/gb.gif\" border=0>";     break;}/*  return the flag */ /* alert (f); */return f;}function setLang(name,x,page){		// Called by the clicking on one of the flags.		// removes and sets a new cookie		eraseCookie(name);			createCookie(name,x,365);		window.location= location.protocol + "//" + location.hostname + "/db/gohomepage?readform&Lng=" + x + "&p=" + page;				}function setLangX(name,x){		// Called by the clicking on one of the flags.		// removes and sets a new cookie		eraseCookie(name);			createCookie(name,x,365);				// Use prototype to write to the selectedlanguage div					// Read the language variables.	var mylang = myLanguage();	if(mylang){		//alert (mylang.name + " " + mylang.path  + " " + mylang.flag)		document.languageform.LanguageSelected.value = mylang.name; 				var t = "<a href=\"" + document.languageform.URLPath.value +  mylang.path + "#languageoptions\">";		 var rethtml = t + mylang.flag+ "</a>";		$('flaglanguage').innerHTML = rethtml;				var rpath = document.languageform.URLPath.value;		if (rpath) {		window.location= rpath + mylang.path	;   		}else{		window.location= window.location + "/en";		}						}else{		window.location = window.location + "/en";		$('nolanguage').innerHTML = "You have not set a default language";			} 								}function getLangPath(){		// set a cookie		x = readCookie('Lng');							switch (x){  case "jp" :      f= "/jp";     break;  case "en" :         f= "/en";     break;   case "it" :         f= "/It";     break;  case "de" :         f= "/de";     break;  case "fr" :         f= "/fr";     break;  case "nl" :         f= "/nl";     break;       default :        f= "/en";     break;}/* return the flagalert (f); */return f;				}