/* General Open Window Function... 
Arguments: url, name, width (int), height (int), scrollbars (boolean 0 or 1)--
width, height, and scrollbars values are optional.*/
function openPopUp(url, w, h) {
	screenDim = screenXY();
	w = (w) ? w : 300 ;
	h = (h) ? h : 400 ;
	leftPos = ((screenDim[0] - w) / 2);
	topPos = ((screenDim[1] - h) / 2);
	popwin = window.open(url, 'pop', "width="+w+", height="+h+",scrollbars=1,menubar=no,top="+topPos+",left="+leftPos+",resizable=yes");
	popwin.focus();
}

/* Detect Monitor Screen Dimensions */
function screenXY() {
	scr = new Array();
	scr[0] = screen.width;
	scr[1] = screen.height;
	return scr;
}

/* Detect Browser Dimensions */
function winX() {
	var x;
	if (self.innerHeight) { 
		// all except Explorer
		x = self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
		// Explorer 6 Strict Mode
		x = document.documentElement.clientWidth;
	}
	else if (document.body) {
		// other Explorers
		x = document.body.clientWidth;
	}
	return x;
}

function winY() {
	var y;
	if (self.innerHeight) { 
		// all except Explorer
		y = self.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
		// Explorer 6 Strict Mode
		y = document.documentElement.clientHeight;
	}
	else if (document.body) {
		// other Explorers
		y = document.body.clientHeight;
	}
	return y;
}