var browserName = navigator.appName;
var IE = (document.all?true:false) && (browserName == "Microsoft Internet Explorer");
var OPERA = browserName == "Opera";

if (!IE){
	document.captureEvents(Event.RESIZE)
}
window.onresize = alignContent;

function mailTo(u, r, l){
	document.location = "mailto:" + 
											u + 
											unescape("%" + "40") + 
											r + 
											unescape("%" + "2E") + 
											l;
}

function getWindowWidth(win){
	if (win == undefined)
		win = window;

	if (win.window.innerWidth)
		return win.window.innerWidth;
	else{
		if (win.document.documentElement && win.document.documentElement.clientWidth)
			return win.document.documentElement.clientWidth;
		return win.document.body.offsetWidth;
	}
}

function getWindowHeight(win){
	if (win == undefined)
		win = window;
	
	if (win.window.innerHeight)
		return win.window.innerHeight;
	else{
		if (win.document.documentElement && win.document.documentElement.clientHeight) 
			return win.document.documentElement.clientHeight;
		return win.document.body.offsetHeight;
	}
}

function alignContent(){
	if (IE){
		var c = document.getElementById('div_center');
		if (c != null)c.style.height = (getWindowHeight() - c.offsetTop) + "px";
	}

	var c = document.getElementById('div_img_left');
	if (c != null)c.style.height = (getWindowHeight() - c.offsetTop) + "px";
	var c = document.getElementById('div_img_right');
	if (c != null)c.style.height = (getWindowHeight() - c.offsetTop) + "px";
}

function openTab(url, params, title){
	if (title == '')
		title = '_blank';
	window.open(url, title, params);
}

function openWindow(url, params){
	openTab(url, 'menubar, toolbar, location, directories, status, scrollbars, resizable, dependent, left=0, top=0' + params, 'TheNewWindow');
}
