// JavaScript Document
<!--
/* Pop-up Window Script (centered on screen and is resizable)
	- variables passed to function are:
	url: address of document to load into pop-up window (relative path except for external urls)
	w: width of pop-up window (numeric in pixels)
	h: height of pop-up window (numeric in pixels)
	scroll: if window should have scroll bars (yes or no)
*/
function popUpWindow(url, w, h, scroll) {
	var winLeft = (screen.width - w)/2
	var winTop = (screen.height - h)/2
	winProperties = 'width=' +w+ ', height=' +h+ ', top=' +winTop+ ', left=' +winLeft+ ', scrollbars=' +scroll+ ', resizable'
	w = window.open(url, "myWindow", winProperties)
	w.focus()
}
//-->


function goImgWin(imgSrc,imgWidth,imgHeight,origLeft,origTop) {
	imgHeight += 24;
	imgWidth += 24;
	TheImgWin = window.open(imgSrc,'image','height=' + imgHeight + ',width=' + imgWidth + ',toolbar=no,directories=no,status=no,' + 'menubar=no,scrollbars=no,resizable=no');
	TheImgWin.resizeTo(imgWidth+2,imgHeight+30);
	TheImgWin.moveTo(origLeft,origTop);
	TheImgWin.focus();
}

function swapImg(imgName,imgSrc) {
	document[imgName].src=imgSrc;
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}
