
function initMaps() {
	if (document.getElementById) {
		var mapIds = initMaps.arguments;			// pass string IDs of containing map elements
		var i, j, area, areas;
		for (i = 0; i < mapIds.length; i++) {
			areas = document.getElementById(mapIds[i]).getElementsByTagName("area");
	
			for (j = 0; j < areas.length; j++) {	// loop thru img elements
				area = areas[j];
							// set event handlers
				area.onmouseout = imgSwap;
				area.onmouseover = imgSwap;
				
			}
		}
	}
}


// image swapping event handling
function imgSwap(evt) {
	evt = (evt) ? evt : event;
	var elem = (evt.target) ? evt.target : evt.srcElement;
	var imgClass = elem.parentNode.name;
	var coords = elem.coords.split(",");
	var clipVal = "rect(" + coords[1] + "px " +
							coords[2] + "px " +
							coords[3] + "px " +
							coords[0] + "px)";
	var imgStyle;
	
	switch (evt.type) {
		case "mousedown" :
			imgStyle = document.getElementById(imgClass + "Down").style;
			imgStyle.clip = clipVal;
			imgStyle.visibility = "visible";
			break;
		case "mouseout" :
			document.getElementById(imgClass + "Over").style.visibility = "hidden";
			break;
		case "mouseover" :
			imgStyle = document.getElementById(imgClass + "Over").style;
			imgStyle.clip = clipVal;
			imgStyle.visibility = "visible";
			break
		case "mouseup" :
			// guarantee click in IE
			if (elem.click) {
				elem.click();
			}
			break;
	}
	evt.cancelBubble = true;
	return false;
}


function popup()
{
	window.open('/how_it_works/','how','status=no,location=no,width=760,height=645,left=20,top=70');
}


function openWindow(url, name, width, height, scroll) {
		  popupWin = window.open(url, name, ',width=' + width + ',height=' + height +  ',scrollbars=' + scroll + ',status=no,location=no,resizable=no,left=25,right=25');
		  popupWin.focus();
		  }
		  
		  
		  
		  
popupWins = new Array();

function windowOpener(url, name, args) {
/******************************* 
the popupWins array stores an object reference for
each separate window that is called, based upon
the name attribute that is supplied as an argument
*******************************/
if ( typeof( popupWins[name] ) != "object" ){
popupWins[name] = window.open(url,name,args);
} else {
if (!popupWins[name].closed){
popupWins[name].location.href = url;
} else {
popupWins[name] = window.open(url, name,args);
}
}

popupWins[name].focus();
}		  
