 ////////////////////////////////////////////////////////
	function openWin(URL,type,w,h) {
	
	var status = 'no';
	var reSize = 'no';
	var scroll = 'no';
	var toolbar = 'no';
	var location = 'no';
	var menubar = 'no';
	var directories = 'no';
	var ewindow;
	
	if (type == "pop") {
		if (!w) {
			w = 600;
		}
		if (!h) {
			h= 580;
		}
		reSize = 'yes';	
		scroll = 'yes';
			
	} 	
		
	var windowFeatures = 'width='+w+',height='+h+
									',toolbar='+toolbar+',status='+status+
									',scrollbars='+scroll+',resizable='+reSize+
									',menubar='+menubar+
									',location='+location+
									',directories='+directories+''
									
	ewindow = window.open(URL,type,windowFeatures);   
	ewindow.focus();
}

 ////////////////////////////////////////////////////////
/**
  author: daniel bulli
  wgbh interactive
  **/
  
/** note this puts roll over on image, not href **/
function initRollovers() 
{
    //if we don't support getElementById then exit
	if (!document.getElementById || ! document.getElementById("nav")) return;
	
	//yes it even does preload
	var aPreLoad = new Array();
	var sTempSrc;
	
	//grab all nav images 
	var aImages = document.getElementById("nav").getElementsByTagName("img");

    //nb if you want all images on page  you do this instead (i only wanted nav)
    //var aImages = document.getElementsByTagName("img");

    
    //loop over images
	for (var i = 0; i < aImages.length; i++) 
	{	
	    //we use class name to find image	
		if (aImages[i].className.match('imgover')) 
		{
		    //grab src
			var src = aImages[i].getAttribute('src');
			
			//grab extension (neato works for gif and jpg nd png if you so feel)
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			
			//create a new attribute for rollover (for fyi = '_ovr')			
			var hsrc = src.replace(ftype, '_ovr'+ftype);
			aImages[i].setAttribute('hsrc', hsrc);
			
			//PRELOAD !!
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			//on mouseover grab hsrc
			aImages[i].onmouseover = function() 
			{
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			//on mouse out strip out "on"
			aImages[i].onmouseout = function() 
			{
			    //alert(sTempSrc);
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_ovr'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;
