/* SERVER CACHE */
function addLoadEvent(func)
{
	var oldonload = window.onload;
	if (typeof window.onload != 'function')
	{
		window.onload = func;
	}
	else
	{
		window.onload = function()
		{
			oldonload();
			func();
		}
	}
}
function addClass(element,value)
{
	if (!element.className)
	{
		element.className = value;
	}
	else
	{
		newClassName = element.className;
		newClassName+= " ";
		newClassName+= value;
		element.className = newClassName;
	}
}
function validateForm(whichform)
{
	for (var i=0; i<whichform.elements.length; i++)
	{
		var element = whichform.elements[i];
		if (element.name == 'search'){
			if (element.className.indexOf("text") != -1)
			{
				if (!isFilled(element) || element.value == "           --- SEARCH ---")
				{
					alert("Gelieve een zoekterm op te geven.");
					element.focus();
					return false;
				}
	   		}
	   	} else if (element.name == 'username'){
			if (element.className.indexOf("text") != -1)
			{
				if (!isFilled(element))
				{
					alert("Gelieve een gebruikersnaam in te geven.");
					element.focus();
					return false;
				}
	   		}
	   	} else if (element.name == 'password'){
			if (element.className.indexOf("text") != -1)
			{
				if (!isFilled(element))
				{
					alert("Gelieve een wachtwoord in te geven.");
					element.focus();
					return false;
				}
	   		}
	   	}
	}
	return true;
}
function isFilled(field)
{
	if (field.value.length < 1)
	{
		return false;
	}
	else
	{
		return true;
	}
}
function prepareForms()
{
	for (var i=0; i<document.forms.length; i++)
	{
		var thisform = document.forms[i];
		thisform.onsubmit = function()
		{
		  return validateForm(this);
		}
	}
}
//addLoadEvent(prepareForms);
function CheckSS()
{
	//theFrm = document.frmSS;
	theFrm = document.registerform;
	hasDot = theFrm.Email.value.indexOf(".");
	hasAt = theFrm.Email.value.indexOf("@");
	if (hasDot == -1 || hasAt == -1)
	{
		alert("Please enter a valid email address.");
		theFrm.Email.focus();
		theFrm.Email.select();
		return false;
	}
	return true;
}
function Europemap()
{
	  var elem, vis;
	  if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById('Europe');
	  else if( document.all ) // this is the way old msie versions work
		  elem = document.all['Europe'];
	  else if( document.layers ) // this is the way nn4 works
		elem = document.layers['Europe'];
	  vis = elem.style;
	  //alert(whichLayer);
	  // if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';	  
}
function AsiaMap()
{
	  var elem, vis;
	  if( document.getElementById ) // this is the way the standards work
		elem = document.getElementById('Asia');
	  else if( document.all ) // this is the way old msie versions work
		  elem = document.all['Asia'];
	  else if( document.layers ) // this is the way nn4 works
		elem = document.layers['Asia'];
	  vis = elem.style;
	  //alert(whichLayer);
	  // if the style.display value is blank we try to figure it out here
	  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
		vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	  vis.display = (vis.display==''||vis.display=='block')?'none':'block';	  
}