function toggle(obj)
{
	if (document.getElementById(obj).style.display != 'none')
	{
		document.getElementById(obj).style.display = 'none';
	}
	else
	{
		document.getElementById(obj).style.display = '';
	}
}

function setLinks()
{
	var email = document.getElementById('email').value;
	var email_test = new RegExp("^[0-9a-z\\._]+@[0-9a-z]+\\..+$","i");
	
	if (email_test.test(email) || email == '')
	{		
		document.getElementById('links').innerHTML = 
		'<a href="http://www.mb01.com/lnk.asp?o=1405&c=19983&a=12115&s1=xbox_' + email + '" onclick="setHasTried();"><img src="http://www.mb01.com/getimage.asp?m=336&o=1405&i=19983.dat" width="468" height="60" border="0" style="margin: 5px;" /></a>' +
		'<a href="http://www.mb01.com/lnk.asp?o=1665&c=24585&a=12115&s1=xbox_' + email + '" onclick="setHasTried();"><img src="http://www.mb01.com/getimage.asp?m=1720&o=1665&i=24585.dat" width="468" height="60" border="0" style="margin: 5px;" /></a>' +
		'<a href="http://www.mb01.com/lnk.asp?o=1656&c=24485&a=12115&s1=xbox_' + email + '" onclick="setHasTried();"><img src="http://www.mb01.com/getimage.asp?m=1720&o=1656&i=24485.dat" width="468" height="60" border="0" style="margin: 5px;" /></a>' +
		'<a href="http://www.mb01.com/lnk.asp?o=2078&c=30779&a=12115&s1=xbox_' + email + '" onclick="setHasTried();"><img src="http://www.mb01.com/getimage.asp?m=523&o=2078&i=30779.dat" width="468" height="60" border="0" style="margin: 5px;" /></a>';
	}
	else
	{
		alert('Invalid Email Entered');
	}
}

var hasTried = false;

/*window.onbeforeunload = function() {
	if (!hasTried)
	{
		return 'You\'d miss the chance to get a FREE DragonFable Amulet!' + "\n"
			 + 'Why don\'t you press "cancel" and try to complete the first' + "\n"
			 + 'offer to see just how easy it is. You\'ll be done in no time!';
	}
}*/

function setHasTried()
{
	hasTried = true;
}

function getHasTried()
{
	return hasTried;
}
