//This function allows windows to be opened in a to a size defined within the arguments of the script.
function openWindow(strUrl, intWidth, intHeight) { 
    // strUrl is the name of the URL to open.
    // intWidth is the width of the window to open
    // intHeight is the heigth of the window to open
    if (intWidth == '') {
        intWidth = 580; // Set a default width if none spacified
    }
    if (intHeight == '') {
        intHeight = 400; // Set a default Height if none spacified
    }
    var newWin = window.open(strUrl, 'PopUpWindow', 'width=' + intWidth + ',height=' + intHeight + ',toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
    newWin.focus(); // Makes the new window the topmost window if it is already open.
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	var imgSources = new Array();
	if (document.images) {
		imgSources[0] = newImage("images/navigation/contents_return_over.gif");
		imgSources[1] = newImage("images/navigation/contents_return.gif");
		imgSources[2] = newImage("images/navigation/read_more_articles_over.gif");
		imgSources[3] = newImage("images/navigation/read_more_articles.gif");
		preloadFlag = true;
	}
}
var preloadFlag = true;


