function openPop (querystring, name, height, width, scroll) {
  if (querystring == '' || height == '' || height == 0 || width == '' || width == 0) {
    return false;
  } 

  var url = 'http://www.arnoldworldwide.com/popup_content.cfm?' + querystring;
  
  if (name == '') {
    name = 'generic_popup';
  }
  
  if (scroll == '') {
		scroll = '0';
	}

	var options = 'toolbar=0,resize=0,scrollbars=' + scroll;
	
  // options = 'toolbar=1,resize=1,scrollbars=1,status=1';
	  
  if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) {
		options = options + ',innerWidth=' + width + ',innerHeight=' + height;
	} else {
		options = options + ',width=' + width + ',height=' + height;
	}
  
  var popWin = window.open(url, name, options);
  popWin.focus();
  
	return false;
}

function openNavToPage(pageID, queryString) {
  top.navigation.location = "/navigation.cfm?openToPageID=" + pageID + queryString;
	return true;
}

// a function to generically pre-load images for rollovers.
// using the onLoad event, I poll through the images Array of the page name contains "btn_"
// (indicating that it has an associated behaivior)
// I try to pre-load the image. 
// If an image is called and doesn't exist it will be ignored.
function loadImages(){
	overImage = new Array;
	for(i in document.images){
		outImage = document.images[i];		
		if( (outImage.src)&&(outImage.src.indexOf("btn_") > -1)){		
			thisSrc = outImage.src;
			if((thisSrc.indexOf("_on.") < 0) && (thisSrc.indexOf("_over.") < 0)){
				overImage[i] = new Image;
				overImage[i].src = parseName(thisSrc,"_over");	
			} 
		}
	}
}

// set a rollover image to the over state
function imageOver(m){
	if(document.images){
		oImage = document.getElementById(m);
		thisSrc = oImage.src;
		if((thisSrc.indexOf("_on.") < 0) && (thisSrc.indexOf("_over.") < 0)){
			oImage.src =  parseName(thisSrc,"_over");	
		}
	}
}


// set a rollover image to the out state
function imageOut(m){
	if(document.images){
		oImage = document.getElementById(m);
		thisSrc = oImage.src;
		if((thisSrc.indexOf("_on.") < 0) && (thisSrc.indexOf("_over.") > -1)){
			lastP = thisSrc.lastIndexOf(".");
			nameArray = new Array;
			nameArray[0] = thisSrc.substr(0,lastP);
			nameArray[1] = thisSrc.substr(lastP,thisSrc.length-1);
			lastO = nameArray[0].lastIndexOf("_");
			nameArray[0] = nameArray[0].substr(0,lastO);
			oImage.src =  nameArray[0] + nameArray[1];
		}
	}	
}

// All images in this site that are used in rollovers have two (or three) states - filename.type, and filename_over.type (or _on)
// to set the src of rollovers, I use this function to get the root name of the file and then the imageOver() or imageOut() functions
// to set the state of the image, or loadImages() to preload the over state of an image.
function parseName(iName,iState){
	lastP = iName.lastIndexOf(".");
	nameArray = new Array;
	nameArray[0] = iName.substr(0,lastP);
	nameArray[1] = iName.substr(lastP,iName.length-1);
	return  nameArray[0] + iState + nameArray[1];
}

function turnOn(aName){
	if (aName!="Home"){
		//alert(aName);
		thisE = document.getElementById("btn"+aName);
		if (thisE){
			thisE.src = "images/btn_" + aName + "_over.gif";
		}	
	}
}


function goNext(lName,n) {
	layerName = lName + n;
	oldLayerName = lName + currNum;
	document.getElementById(layerName).style.visibility="visible";
	document.getElementById(oldLayerName).style.visibility="hidden";
	currNum = n;
}

function goInline(lName,n) {
	layerName = lName + n;
	oldLayerName = lName + currNum;
	if (n!=currNum){
		document.getElementById(layerName).className="openItem";
		document.getElementById(oldLayerName).className="closedItem";
		currNum = n;
	}
}

//alert("this is a test message for debugging. Please ignore.");