function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}

function swapImage() {
if (document.images && (preloadFlag == true)) {
for (var i=0; i<swapImage.arguments.length; i+=2) {
document[swapImage.arguments[i]].src = swapImage.arguments[i+1];
}
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
preloadFlag = true;
}
}

function fnShowHideEvent(elementID){
var nextEvent1 = document.getElementById('event1-' + elementID)
var nextEvent2 = document.getElementById('link_' + elementID)
if (nextEvent1.style.display == 'none'){
	nextEvent1.style.display = "block";
	nextEvent2.innerText = 'Click to close this article';
}else{
	nextEvent1.style.display = "none";
	nextEvent1.display = "none";
	nextEvent2.innerText = 'Click to read this article';
	}
}

//open pop up window function
function openPopWindow(URL,windowName,features) { 
  window.open(URL,windowName,features);
}
