function imgOn(imgName) { document[imgName].src = eval(imgName + "_over.src"); }
function imgOff(imgName) { document[imgName].src = eval(imgName + "_off.src"); }

function cacheImage(name, image, activeImage){
	eval(name + "_off =  new Image");
	eval(name + "_off.src = \'" + image + "\'");
	eval(name + "_over =  new Image");
	eval(name + "_over.src = \'" + activeImage + "\'");
}

function popWindow(url, width, height, name, scrollbars){
	if (!scrollbars) scrollbars = false;
	if (!width) width = 450;
	if (!height) height = 500;
 	var realW = (width)/2;
	var realH = (height)/2;
 	if (document.all){		
        var xMax = screen.width, yMax = screen.height;
    }else if (document.layers){       
        var xMax = screen.width, yMax = screen.height;
    }else if (document.getElementById){
		var xMax = screen.width, yMax = screen.height;
	}else{
		var xMax = 800, yMax=600;
	}
	var xOffset = ((xMax)/2) - realW, yOffset = (((yMax)/2)) - realH; 
	if (yMax==600){
		yOffset = 0;
	}	
	
	if (scrollbars) {
		var options = "directories=no,status=no,location=no,scrollbars=yes,menubar=no,toolbar=no,resizable=no" + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",width=" + width + ",height=" + height;
	}else{
		var options = "directories=no,status=no,location=no,scrollbars=no,menubar=no,toolbar=no,resizable=no" + ",screenX=" + xOffset + ",screenY=" + yOffset + ",top=" + yOffset + ",left=" + xOffset + ",width=" + width + ",height=" + height;
	}
	
	if (!name) name = "default_window";
	
	popup = window.open(url,name,options);
	popup.focus();	
}


function popupMap(url, wid, hi) {
	newwin = window.open(url, "win" + wid + hi,"WIDTH=" + wid + ",HEIGHT=" + hi + ",scrollbars=no");
	newwin.focus();
}

function gotoURL(url){
	newwin = window.open(url, "winpopup4","WIDTH=800,HEIGHT=600,scrollbars,status,toolbar,resizable,menubar,location");
	newwin.focus();
	window.close()	
}

function openPharmacyLocator() {
	var uri  = "https://www.caremark.com/wps/portal/.cmd/el?id=cm4re8op_1&cmxtarget=LOCAL_PHARMACY&returnURL=http://www.caremark.com/framedLogoff.html";
	var newWindow = window.open(uri,"pharmacyLocator");
	if (window.focus) newWindow.focus()

}

function renderContentTopControl() {
	document.getElementById("contentTopControlContainer").innerHTML = document.getElementById("contentTopControl").innerHTML;
}


