


// ***************************************************************************
// keep these here to support call being setup for Flash to call out.
// note however that this approach causes the popup to be blocked in XP
	//**added as sample that can be used for calling popup windows via javascript from flash
// ***************************************************************************	
function openWhatever()
	{
		window.open('../resource_downloads/whatever.html','PRJresources','width=750,height=500,menubar=yes,scrollbars=yes,statusbar=yes,toolbar=yes,resizable=yes,Left=50,Top=50,ScreenX=50,ScreenY=50');
	}
	
function openAcrobat()
	{
		window.open('http://www.adobe.com/products/acrobat/readstep2.html','Resources','width=700,height=500,menubar=yes,scrollbars=yes,statusbar=yes,toolbar=yes,resizable=yes,Left=50,Top=50,ScreenX=50,ScreenY=50');
	}
	
function openAlert(NameOfAlert)
	{
		alert("Name of Alert: "+NameOfAlert);
	}
	
function openHistoryPhotos()
	{
		window.open('photos/history/historyPhotos.htm','HistoryPhotos','width=750,height=550,menubar=no,scrollbars=yes,statusbar=no,toolbar=no,resizable=yes,Left=0,Top=0,ScreenX=0,ScreenY=0');
	}
	
	
	
	
// ***************************************************************************
//CODE for demo (captivate etc) popups if needed
//the following tests are to ensure that the popup window is not accidently left minimized
//openDemo is called from flash when needed and parameters passed with filename (necessary)
//Optional to pass width, height, and window title
// ***************************************************************************
function checkDemoWindow(htmlname)
	{
		winStatus 	= "width=775,height=575,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,Left=50,Top=50,ScreenX=50,ScreenY=50;"
		if (typeof popwindow== "undefined") {
		//window has never been opened - OK
		}
			else {
			if (popwindow.closed) {
			//window has been properly closed - OK
			}
			else {
			//window has been opened and left behind
			popwindow.close();
		}
		}
		popwindow=window.open(htmlname,"demoPopup",winStatus)
		// this handles the case where the named window already is open
		popwindow.focus();
	}

	function openDemo(fileName,width,height,title){
	//alert("fileName: "+fileName);
		var defaultWidth = 750;
		var defaultHeight = 545;
		var defaultTitle = "";
		var width = (width !=undefined)?width : defaultWidth;
		var height = (height !=undefined)?height : defaultHeight;
		var title = (title !=undefined)?title : defaultTitle;
		var parameters="";
		parameters += "file="+fileName+"&";
		parameters += "width="+width+"&";
		parameters += "height="+height+"&";
		parameters += "title="+title+"&";
	//alert("parameters:  "+parameters);
		var path = "resources/demos/demo.html?"+parameters;
		checkDemoWindow(path);
	}
	
	
// ***************************************************************************
//CODE for scaling flash shell up or down via settings in GUI
//resizeFlash() called from settings in GUI
//pass defaultSize or enlargedSize to toggle
//this option is here to address users who might need to enlarge course for viewing
// ***************************************************************************	
function resizeFlash(newSize){
	//alert("resizeFlash");
	var width=1000;
	var height=680;
	
	switch (newSize){
		case "defaultSize":
			width=1000;
			height=680;
			break;
		case "enlargedSize":
			width=1250;
			height=850;
			break;
		case "reducedSize":
			width=750;
			height=510;
			break;
		default:
			break;
	}	
	
	var daSWF = document.getElementById("controller");
	//alert("daSWF: "+daSWF);
		
	daSWF.width = width;
	daSWF.height = height;

}	
	