function newWin(url, w, h, other) {
	win = window.open(url, 'popup', 'width=' + w + ',height=' + h + ',' + other);
	win.focus();
	return false;
}

var popup = null;
function openFrame(url) {
	if (popup && !popup.closed && popup.location) {
		popup.location.href = url;
	} else {
		popup = positionWin(url);
	}
	if (window.focus) {
		popup.focus();
	}
	return false;
}

function positionWin(url) {
var left = 1;
var top = 1;

	var pos = findPos(window.document.getElementById('spacer'));
	var fleft = pos[0];
	var ftop = pos[1];
	var width = 780;
	var height = 500;
	var header_height = 370;
	var inner_w = 980;
	

// positioning
	if (document.all) {		// browser is IE
		if (left != 0) {
			left = parent.mainFrame.window.screenLeft;
			top = parent.mainFrame.window.screenTop;
		}
	} else {		//browser is not IE
		left_margin = (parent.window.document.body.clientWidth - inner_w)/2;
		left = parent.window.screenX + left_margin + 240;
		top = parent.window.screenY + header_height;
	}

	if (document.all) {		// browser is IE
		height = parent.window.document.body.clientHeight - 280;
	} else {
		height = parent.window.document.body.clientHeight - 300;
	}
	
	parent.window.location.href='/mail/#top';
	return window.open(url, 'mail', 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top + ',scrollbars=yes,status=no,resizable=yes');
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function eventListMouseOver(id) {
	document.getElementById(id).style.backgroundColor='#4C4C4C';
	document.getElementById(id).style.color='#FFFFFF';
	document.getElementById(id + 'a').style.backgroundColor='#EFEFEF';
}

function eventListMouseOut(id) {
	document.getElementById(id).style.backgroundColor='';
	document.getElementById(id).style.color='';
	document.getElementById(id + 'a').style.backgroundColor='';
}