function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
var flag = 1;
var currentImage = 0;
var imgFileNames=new Array("a1", "b2", "a3", "c1", "d2", "c3"); 
function stop()
{
	flag = 0;
	document[imgFileNames[currentImage]].src = "/i/home_img_" + imgFileNames[currentImage] + ".jpg";
}
function sequencer(imageOff)
{
	if (imageOff == 99) { imageOn = currentImage; imageOff = 0; flag = 1; }
	else if (imageOff >= imgFileNames.length - 1) { imageOn = 0; }
	else { imageOn = imageOff + 1; }
	currentImage = imageOn;
	var imageName = imgFileNames[imageOn];
	if (flag == 1) //if no mouseover is in effect, you may continue recursion
	{
		document[imgFileNames[imageOff]].src = "/i/home_img_" + imgFileNames[imageOff] + ".jpg";
		document[imgFileNames[imageOn]].src = "/i/other_img_" + imgFileNames[imageOn] + "_on.jpg";
		recall = "sequencer(" + imageOn + ");";
		setTimeout(recall, 2000);
	}
}
/*
function randomizer(imageOff)
{
	var imgFileNames=new Array("a1", "a3", "b2", "c1", "c3", "d2"); 
	var rNumber=Math.floor(Math.random()*imgFileNames.length); 
	var imageName = imgFileNames[rNumber];
	document[imageOff].src = "/i/home_img_" + imageOff + ".jpg";
	document[imageName].src = "/i/other_img_" + imgFileNames[rNumber] + "_on.jpg";
	recall = "randomizer('" + imageName + "');";
	setTimeout(recall, 2000);
}
*/
function launchDaily(ID) { window.open("daily_view.php?ID=" + ID,"dailyNote","scrollbars=yes,resizable=yes,width=400,height=375"); }
function dailyNoteWindow(rID) { window.open('/research/dailynotes/'+rID+'/','dailyNote','scrollbars=yes,resizable=yes,width=550,height=500'); }
function corpgovWindow(ID) { window.open('/research/corpgov/6/?definition='+ID,'definition','scrollbars=yes,resizable=yes,width=550,height=500'); } 
function mall_printWindow(ID, params) { window.open('/research/mall/'+ID+'/'+params,'','height=700,resizable=yes,scrollbars=yes,width=900'); } 
function mall_mapWindow(params) { window.open('/research/mall/4/'+params,'4','height=740,resizable=yes,scrollbars=no,width=700'); } 
function mall_articleWindow(articleID) { window.open('/research/mall/6/?articleID='+articleID,'articleID','height=500,resizable=yes,scrollbars=yes,width=550'); } 
function mall_trialWindow() { window.open('/research/mall/7/','','height=350,resizable=yes,scrollbars=no,width=550'); } 
function soundbite(num, status) {
	if(status == true) { document.getElementById('sb_'+num).style.display = 'block';
	} else { document.getElementById('sb_'+num).style.display = 'none'; }}
function execcompWindow(rID) { window.open('/research/Execcomp_Print/'+rID+'/','execcompWindow','scrollbars=yes,resizable=yes,width=640,height=500'); } 
function datatoolWindow(rID) { window.open('/research/Data_graph_Print/'+rID+'/','datatoolWindow','scrollbars=yes,resizable=yes,width=800,height=600'); } 
