var winQuicktour = null;
var winProfile = null;
var winCaseStudy = null;
var winContact = null;

function openWindow(url, name, w, h) {

	winDest = eval(name);

	if (winDest && winDest.open && !winDest.closed) {
		winDest.focus();
		return window.open(url, name);
	} else {
		strOptions = "toolbars=0,directories=0,scrollbars=1,location=0,resizable=0,";
		strOptions += "width="+w+",";
		strOptions += "innerWidth="+w+",";
		strOptions += "height="+h+",";
		strOptions += "innerHeight="+h;

		if (window.screen) {
			var scrHeight = screen.availHeight;
			var scrWidth = screen.availWidth;

			offsetX = (scrWidth - w) / 2;
			offsetY = (scrHeight - h) / 2;

			strOptions +=",left="+offsetX+",screenX="+offsetX;
			strOptions +=",top="+offsetY+",screenY="+offsetY;
		}
		return window.open(url,name,strOptions);
	}
}

function openQuicktour() {
	winQuicktour = openWindow('/quicktour/', 'winQuicktour', 600, 460);
}

function openProfile() {
	winProfile = openWindow('/profile/', 'winProfile', 680, 460);
}

function openCaseStudy(url) {
	winCaseStudy = openWindow(url, 'winCaseStudy', 620, 460);
}

function openContact() {
	winContact = openWindow('/contact/', 'winContact', 640, 460);
}

function printPage() {

	if (window.print) {
		window.print();
	} else {
		alert("Your browser doesn't support this function.\n\nWe suggest you try your browser's regular Print command, usually located under the File menu.");
	}
}

