<!-- For cookie -->
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 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);
}

<!-- Object visibility -->
function setVisible(id){
	document.getElementById(id).style.visibility = 'visible';
}
function setHidden(id){
	document.getElementById(id).style.visibility = 'hidden';
}

<!-- page redirect -->
function goToPage(page){
	document.location = page
}

function changeCountry(page){
	eraseCookie('country-code');
	goToPage(page);
}

<!-- XML parser -->
function loadXML(fname){
	
	var xmlDoc = null;
	
	if (window.ActiveXObject)
	  {
	  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
	  xmlDoc.async=false;
	  xmlDoc.load(fname);
	  }
	// code for Mozilla, Firefox, Opera, etc.
	else if (document.implementation &&
	document.implementation.createDocument)
	  {
	  xmlDoc=document.implementation.createDocument("","",null);
	  xmlDoc.load(fname);
	  }
	else
	  { 
	  	alert('Your browser cannot handle this script');
	  }
	return xmlDoc;
}

<!-- Open a popup window with the given link-->
function openPage(url){
	window.open(url, "_blank");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  newWin = window.open(theURL,winName,features);
  newWin.focus();
}