function NewWindow(mypage, myname, w, h, scroll, resize) {
    var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    winprops = 'height=' + h + ',width=' + w + ',top=' + wint + ',left=' + winl + ',scrollbars=' + scroll + ',resizable=' + resize + ',toolbar=no,location=no,status=no,menubar=no,dependent=no';
    win = window.open(mypage, myname, winprops);
    if (parseInt(navigator.appVersion) >= 4) {
        win.window.focus();
    }
}

function movepic(img_name, img_src) {
    document[img_name].src = img_src;
}

/*
	Event loading: functions to fire on window load
*/
function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		};
	}
}

/*
	ZoomCheck: determine viewport size and zoom content size to fit viewport height
	  Note: ZoomCheck depends on Prototype.js (won't work without it)
	Date: 12/03/09
	Author: Lance B. Willett, simpledream web studio
*/
var resizeTimeout = false;

var ZoomCheck = {
	init: function() {
		ZoomCheck.checkViewportHeight();
		Event.observe(window, 'resize', function(event) {
			Util.waitTilDone(event, 200, true, ZoomCheck.checkViewportHeight);
		});
	},

	checkViewportHeight: function() {
	    var viewportHeight = document.viewport.getHeight();
	
		if (viewportHeight <= 840) { // set zoom if height is 840px or less
	        ZoomCheck.setStyles(viewportHeight, true);
		} else {
			ZoomCheck.setStyles(viewportHeight, false);
		}
	},

	setStyles: function(viewportHeight, zoom) {
		var body = $(document.body), content = $("contentGroup"), availHeight = 630;

		if (zoom !== false) {
			availHeight = Math.round(viewportHeight - 240); // allow for header, footer, etc
			body.addClassName("zoom-down");
		} else {
			body.removeClassName("zoom-down");
		}

		// adjust minimum height and try to fill available height
		content.setStyle({
			minHeight: availHeight + "px"
		});
	}
};

var Util = {
	waitTilDone: function(event, time, stop, func) {
		if (resizeTimeout !== false) {
			clearTimeout(resizeTimeout);
		}
		resizeTimeout = setTimeout(func, time);
		if (stop !== false) {
			Event.stop(event);
		}
	}
};

addLoadEvent(ZoomCheck.init);
// END ZoomCheck