function ChangeImage(strName, strSource) {
	document.images[strName].src = strSource;
}

function ChangeBG(strKey, strType) {
	document.getElementById(strKey).style.backgroundImage = 'url(/images/menu_bg01' + strType + '.png)';
}

function ChangeMenu(strKey, strType) {
	ChangeBG('menu_' + strKey, strType);
	var strSource = '/images/menu_' + strKey + ((strType == 'on') ? '' : strType) + '.png'
	ChangeImage('menu_' + strKey, strSource);
}

function Popup(strURL, strName, intWidth, intHeight, strStatus, strScroll, strResize, strToolbar, intTop, intLeft) {
	if (!strURL) {
		alert('A link must be specified when using the Popup function.');
	}
	else {
		var strTop, strLeft;
		if (!strName) strName = 'popup';
		if (!intWidth) intWidth = 600;
		if (!intHeight) intHeight = 400;
		if (!strStatus) strStatus = 'yes';
		if (!strScroll) strScroll = 'yes';
		if (!strResize) strResize = 'yes';
		if (!strToolbar) strToolbar = 'no';
		if (intTop && !isNaN(intTop)) strTop = ',top=' + intTop;
		if (intLeft && !isNaN(intLeft)) strLeft = ',left=' + intLeft;
		var objWindow = window.open(strURL, strName, 'width=' + intWidth + ',height=' + intHeight + ',status=' + strStatus + ',scrollbars=' + strScroll + ',resizable=' + strResize + ',toolbar=' + strToolbar + strTop + strLeft);
		objWindow.focus();
	}
}

function Popdown(strURL, blnLeaveOpen) {
	if (!strURL) {
		alert('A link must be specified when using the Popdown function.');
	}
	else {
		if (top.opener) {
			var objParent = top.opener;
			objParent.location.href = strURL;
			if (!blnLeaveOpen) {
				objParent.focus();
				top.close();
			}
		}
		else {
			alert('Unfortunately the link could not be followed.\nThe window that opened this page may have\nbeen closed, or your browser may not\nsupport this function.');
		}
	}
}
