function TipFriendcheckEmail(parEmail)
{
	var str = parEmail;
	var filter = /^[^\s@]+@[^\s@]+\.[a-z]{2,6}$/i;
	if(filter.test(str))
	{
		return true;
	}
	else
	{
		document.getElementById('tipEmail').style.backgroundColor = "#ffff9d"; // yellow 
		return false;
	}
}

function tipFriendSubmit(lang)
{
	if(document.getElementById('tipEmail').value == "") 
	{
		if(lang == 'dk')
		{
			document.getElementById('tipEmail').style.backgroundColor = "#ffff9d"; // yellow
			return false;
		}

		if(lang == 'uk')
		{
			document.getElementById('tipEmail').style.backgroundColor = "#ffff9d"; // yellow
			return false;
		}
	}
	else if(TipFriendcheckEmail(document.getElementById('tipEmail').value) == false)
	{
		return false;
	}
	else
	{
	}

	var siteLangUrl;
	if(lang == 'dk')
		siteLangUrl = 'http://www.louisiana.dk/dk';
	if(lang == 'uk')
		siteLangUrl = 'http://www.louisiana.dk/uk';

	var xmlHttp;
	try
	{  // Firefox, Opera 8.0+, Safari  
		xmlHttp = new XMLHttpRequest(); 
	}
	catch(e)
	{  // Internet Explorer  
		try
		{
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e)
		{
			try
			{
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	
	xmlHttp.onreadystatechange = function()
	{
		if(xmlHttp.readyState == 4)
		{
			document.getElementById('tipFriendContainer').innerHTML = xmlHttp.responseText;
			document.getElementById('tipFriendContainer').style.display = 'block';
			//document.getElementById('tipFriendHolder').innerHTML = xmlHttp.responseText;
			document.getElementById('tipFriendHolder').style.display = 'block';
		}
	}
	
	//document.getElementById('frm_tilmelding').style.display = 'none';

	var qString = "tipenven=ok&";
	qString += "name=" + document.getElementById('tipName').value + "&";
	qString += "email=" + document.getElementById('tipEmail').value + "&";
	qString += "snd_name=" + document.getElementById('tipSnd_name').value + "&";
	qString += "msg=" + document.getElementById('tipMsg').value + "&";
	qString += "pname=" + document.getElementById('tipPname').value + "&";
	qString += "purl=" + document.getElementById('tipPurl').value + "";
	//xmlHttp.open("GET", siteLangUrl +"/menu/ajax+return?"+ qString +"", true);
	
	xmlHttp.open("GET", siteLangUrl +"/menu/ajax tip en ven return?"+ qString +"", true);
  	xmlHttp.send(null);
} // End function
