window.onError = error_report;

function error_report() {
    window.status = "JavaScript error!";
    return true;
}

function noSpam(user,domain) {
	locationString = "mailto:" + user + "@" + domain;
	window.location = locationString;
}

function getFocus() {
	window.focus();
}

function openWin(width, height, url, attribute, windowName) {
	var position_y = (screen.width - width)/2;
	var position_x = (screen.height - height)/2;
	property = "width=" + width + ", height=" + height + ", top=" + position_x + ", left=" + position_y + "," + attribute;
	window.open(url, windowName, property);
}

function openPopup(file, path) {
	properties = "resizable=yes, scrollbars=yes, statusbar=yes";
	openWin(640, 480, "viewportfolio.html?id="+file+"&path="+path, properties, "ip_"+file);
}

function returnObjById(id) {
	if (document.getElementById)
		var returnVar = document.getElementById(id);
	else if (document.all)
		var returnVar = document.all[id];
	else if (document.layers)
		var returnVar = document.layers[id];
	return returnVar;
}
