///////////////////////////////////////////////////////////
function gotoUrl(url, blank) {
	if (!blank) {
		location.href = url;
	} else {
		window.open(url, '_blank');
	}
}

function checkEmail(strEmail){
	return /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})$/.test(strEmail);
}

function trim(s) {
	return s.replace(/^\s*(.+?)\s*$/, "$1");
}

// Backward compatibility
function gotoURL(url, blank) { gotoUrl(url, blank); }


function rollover(e, newcolor, url, blank) {
	var obj = null;
	if (!e) { var e = window.event; }
	if (e.target) { obj = e.target; }
	else if (e.srcElement) { obj = e.srcElement; }
	if (obj.nodeType == 3) {// defeat Safari bug
		obj = obj.parentNode;
	}

	if (!obj) { return; }
	if (!newcolor) { newcolor = '#A9A9A9'; }
	var oldcolor = obj.style.color;
	obj.style.cursor = "pointer";
	obj.style.color = newcolor;
	obj.onmouseout = function(){
		obj.style.color = oldcolor;
		window.status = "";
	}

	if (url) {
		var statline = "";
		if (blank) { statline += "New Window: "; }
		statline += url;
		window.status = statline;
		
		obj.onclick = function(){
			gotoUrl(url, blank);
			return false;
		}
	}
}

function getEl(id) {
	var obj = document.getElementById(id);
	if (obj) {
		return obj;
	}
	return false;

}
