if (window != top) top.location.href = location.href;

function checkEmailAddress(field) 
{
	if (field.value != '' && !field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,4}))$)\b/gi)) 
	{
		alert('Please enter a valid e-mail address.');
		field.focus();
		field.select();
	}
}

function newWindow(url, name, attribs) 
{
	if (typeof name == "undefined") { name = '';}
	if (typeof attribs == "undefined") { attribs = '';}
	window.open(url, name, attribs); 

	return false;
}

function loadFrame(url, frameName) 
{
	frameName.location.href = url;

	return false;
}

function searchVal()
{
	i = document.getElementById('searchKeyword');
	if (i.value != '')
	{
		return true;
	}

	return false;
}

function loginVal()
{
	usr = document.getElementById('usrField');
	pwd = document.getElementById('pwdField');
	if (usr.value != '' && pwd.value != '')
	{
		return true;
	}
	return false;
}

function moneyRound(amount) 
{
	var s = '' + Math.round(amount * 100) / 100;
	var i = s.indexOf('.');
	if (i < 0) 
	{
		return s + '.00';
	}
	var t = s.substring(0, i + 1) + s.substring(i + 1, i + 3);
	if (i + 2 == s.length)
	{
		t += '0';
	}

	return t;
}
