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() {
	if (document.images) {
		langselect_english_over = newImage("images/langselect_english_over.gif");
		langselect_spanish_over = newImage("images/langselect_spanish_over.gif");
		preloadFlag = true;
	}
}



// openPopup - tests for existance of window; if exists, brought to front. if doesn't, window is created and brought to front.
function openPopup(theURL,mywidth,myheight) {
	var newWindow = null;
	if (mywidth == 0 && myheight == 0) {
		features = 'toolbar=yes,status=yes,width=800,height=600,directories=no,scrollbars=yes,location=yes,resizable=yes,menubar=yes';
		newWindow = window.open(theURL,winName,features);
		newWindow.focus();
	} else {
		if (mywidth == "" || mywidth == 0) {
			mywidth = 350;
		}
		if (myheight == "" || myheight == 0) {
			myheight = 250;
		}
		features = 'toolbar=no,status=no,width='+mywidth+',height='+myheight+',directories=no,scrollbars=yes,location=no,resizable=yes,menubar=no';

		if (mywidth == "" || mywidth == 0) {
			mywidth = 350;
		}
		if (myheight == "" || myheight == 0) {
			myheight = 250;
		}
		features = 	'toolbar=no,status=no,width='+mywidth+',height='+myheight+',directories=no,scrollbars=yes,location=no,resizable=yes,menubar=no';
		if (!newWindow || newWindow.closed) {
			newWindow = window.open(theURL,"popup",features);
			newWindow.focus();
		} else {
			newWindow.focus();
		}
	}
}
