<!--
function WesternUnion() 
{
	var ok=1;
	var name	= document.westernunion.fullname, 
		code	= document.westernunion.wu,
		date	= document.westernunion.dat, 
		email	= document.westernunion.email;

//TEST EMAIL
	if (email.value.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+/) == -1)
	{
		alert("L'email fornito non è stato correttamente scritto.");
		email.value = "(digita il tuo email qui)";
		email.select();
		ok=0;	
	}

//SIMPLE TEST DATE
	if(date.value.search(/(0[1-9]|[12][0-9]|3[01])[- \/.](0[1-9]|1[012])[- \/.](19|20)\d\d/) == -1)
	{
		alert("La data fornita è incorretta.");
		date.value = "gg/mm/aaaa";
		date.select();
		ok = 0;
	}

//TEST CODE
	if(code.value.search(/^\d{10}$/) == -1)
	{
		alert("Codice di WU invalido");
		code.value="codice qui";
		code.select();
		ok = 0;
	}
//NO NEED TO TEST THE COUNTRY
//TEST FULL NAME
	name.value = doBasicStuff(name.value);
	if(isEmpty(name.value))
	{
		alert("Bisogna indicare un nome e un cognome");
		name.focus();
		name.select();
		ok = 0;
	}

	if(name.value.search(/[^\w \-àèìòùâêîôûäëïöüáéíóúñçæœÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÁÉÍÓÚÇÑÆŒ\']/) != -1)
	{
		alert("Nome e cognome non possono contenere caratteri speciali");
		name.focus();
		name.select();
		ok = 0;
	}
//END TEST FULL NAME
	
	if(ok == 1) document.westernunion.submit();		
}

function doBasicStuff(string)
{
		string = string.replace(/\s{2,}/, " ");
		string = string.replace(/^\s+/, "");
		string = string.replace(/\s+$/, "");
		return string;
}

function isEmpty(string)
{
	if(string == "") 
		return true; 
	return false;
}

function getGenID()
{
	var gen = GetCookie();
	if(!gen) return;
	var pos = gen.indexOf("=");
	var value = gen.substr(pos+1);	//starting at the index after = to the end
	document.westernunion.gen.value = value;
	//alert(document.westernunion.gen.value);
}
//-->