function getViewportSize() {
	var viewportwidth;
	var viewportheight;
 
	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerWidth;
		viewportheight = window.innerHeight;
	}
	
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !=
		'undefined' && document.documentElement.clientWidth != 0) {
		viewportwidth = document.documentElement.clientWidth;
		viewportheight = document.documentElement.clientHeight;
	}
	
	// older versions of IE
	else {
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth;
		viewportheight = document.getElementsByTagName('body')[0].clientHeight;
	}
	return [viewportwidth, viewportheight];
}


// JavaScript Document/* High Slide Stuff */
hs.graphicsDir = '/images/highslide/';
//hs.wrapperClassName = 'highslide-map';
hs.outlineType = null;
hs.showCredits = false; 
function openMap($target, $id) {
	
	var viewportSize = getViewportSize();
	var maxWidth;
	var maxHeight;
	
	if (800 / 600 > viewportSize[0] / viewportSize[1]) {
		var maxWidth = viewportSize[0];
		var maxHeight = viewportSize[0] / 800 * 600;
	} else {
		var maxHeight = viewportSize[1];
		var maxWidth = viewportSize[1] / 600 * 800;
		
	}
	
	hs.htmlExpand(
		$target, { 
			align: 'center',
			dimmingOpacity: 1,
			objectType: 'swf', 
			swfOptions: {
				version: '8',
				flashvars: { locationId: $id },
				params: {quality: 'high', wmode:'window'}
			}, 
			width: maxWidth * .9, 
			objectWidth: maxWidth * .9, 
			objectHeight: maxHeight *.9, 
			wrapperClassName: 'highslide-map',
			maincontentText: 'You need to upgrade your Flash player'  
		}
	);
	return false;
	//return true;
}