function killerrors()
{
	return false;	
}
window.onerror = killerrors;

function _$(Objname)
{
	return document.getElementById(Objname);
}

function chkemail(name)
{
	var emailfilter = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
	var returnval=emailfilter.test(_$(name).value)
	if(returnval == false){
		if(name == 'leftemail')
		{
			sAlert('ERRORS','Please enter a valid email address, and try again.');
		}else{
			sAlert('ERRORS','Please enter a valid email address. This email will be used as your username to login to the Gold Members Area.');
		}
		_$(name).select();
		_$(name).style.backgroundColor='#FF6666';
		return false;
	}
	return true;
}

function chkBlogEmail(name,url)
{
	var emailfilter = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
	var returnval=emailfilter.test(_$(name).value)
	if(returnval == false){
		sAlert('ERRORS','Please enter a valid email address.');
		_$(name).style.backgroundColor='#FF6666';
		_$(name).select();
		return false;
	}
	window.onbeforeunload = function(){};
	window.location.href='"' + url + '"';
	return true;
}

function chkTwoEmail(name,url)
{
	var emailfilter = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
	var returnval=emailfilter.test(_$(name).value)
	if(returnval == false){
		_$(name).style.backgroundColor='#FF6666';
		_$(name).select();
		return false;
	}
	var Then = new Date();
	Then.setTime(Then.getTime() + 1*24*60*60*1000);
	document.cookie = "email="+escape(_$(name).value)+";expires="+ Then.toGMTString();
	window.onbeforeunload = function(){};
	window.location.href='"' + url + '"';
	return true;
}

function chklogin(prefix)
{
	var emailfilter = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i;
	if(prefix != '')
	{
		var returnval=emailfilter.test(_$('site_loginEmail').value);
	}else{
		var returnval=emailfilter.test(_$('loginEmail').value);
	}
	if(returnval==false){
		if(prefix != '')
		{
			_$('site_loginEmail').select();
			_$('site_loginEmail').style.backgroundColor='#FF6666';
		}else{
			_$('loginEmail').select();
			_$('loginEmail').style.backgroundColor='#FF6666';
		}
		return false;
	}else{
		if(prefix != '')
		{
			_$('site_loginEmail').style.backgroundColor='';
		}else{
			_$('loginEmail').style.backgroundColor='';
		}
	}

	if(prefix != '')
	{
		if(_$('site_loginPass').value == '')
		{
			_$('site_loginPass').select();
			_$('site_loginPass').style.backgroundColor='#FF6666';
			return false;
		}else{
			_$('site_loginPass').style.backgroundColor='';
		}
	}else{
		if(_$('loginPass').value == '')
		{
			_$('loginPass').select();
			_$('loginPass').style.backgroundColor='#FF6666';
			return false;
		}else{
			_$('loginPass').style.backgroundColor='';
		}
	}

	return true;
}

function chkform(url)
{
	if(_$('name').value == '')
	{
		_$('name').select();
		_$('name').style.backgroundColor='#FF6666';
		return false;
	}else{
		_$('name').style.backgroundColor='';
	}

	if(_$('content').value == '')
	{
		_$('content').select();
		_$('content').style.backgroundColor='#FF6666';
		return false;
	}else{
		_$('content').style.backgroundColor='';
	}

	window.onbeforeunload = function(){};
	window.location.href='"' + url + '"';
	return true;
}
