  
  //Handle all the the FSCommand messages in a Flash movie
  var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
  //start total time at 0
  var vTotalModTime=0;
  //determine whether this module is in review or not.
  if(parent.location.href.toUpperCase().indexOf('FREVIEW') > 0){
    //alert('fReview');
    inReview="Y";
  }
  else {
    //alert('fModules');
    inReview="N";
  }
  
  function getParameter(name){
    var pair=location.search.substring(1).split("&");
    for (var i=0;i<pair.length;i++)
    {
      var a=pair[i].split("=");
      var n="",v="";
      if (a.length>0)
        n=unescape(a[0]);
      if (a.length>1)
        v=unescape(a[1]);
      if (n==name) return v;
    }
  }
  
  function NewWindow(params) {
 
  	params = String(params);
  	var wparams = params.split(",");
  	var mypage = "";
  	var mytitle = "";
  	var w = 0;
  	var h = 0;
  	var scrolls = "";
  	mypage = wparams[0];
  	mytitle = "VUBIZWindow";
  	w = wparams[2];
  	h = wparams[3];
  	scrolls = wparams[4];
  	var winl = (screen.width - w) / 5;
  	var wint = (screen.height - h) / 3;
  	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrolls+',noresizable';  	
	window.open(mypage, mytitle, winprops).focus();

  }
  
  function GetAssessment(params){
  	//alert("params = "+params);
  	if(document.layers){
  	  //for NE 4
  	  //alert("NS 4");
  	  var decodedURL = String(unescape(unescape(params)));
  	} else {
  	  //test for NE 6
  	  var agt = navigator.userAgent.toLowerCase();
  	  var is_nav6 = agt.indexOf('netscape6')!=-1;
  	  if (is_nav6){
  	    //alert("NE 6 = "+is_nav6);
  	    var decodedURL = String(unescape(unescape(params)));
  	  } else {
  	    //alert("browser is IE or NE 7");
  	    var decodedURL = String(decodeURIComponent(params));
  	  }
  	}
  	var paramsArray = decodedURL.split(",");
  	var AssessURL = paramsArray[0];
  	var newWindow = paramsArray[1];
  	//alert("AssessURL = "+AssessURL);
  	//alert("newWindow = "+newWindow);
  	var url = AssessURL + "&inReview="+inReview;
  	if (newWindow == "1"){
  	   var winl = (screen.width - 750) / 5;
  	   var wint = (screen.height - 475) / 3;
  	   winprops = "height=475,width=750,top="+wint+",left="+winl+",scrollbars=no,noresizable";
  	   win = window.open(url, "AssessmentWindow", winprops).focus();
  	} else {
  	   win = window.open(url, "_self");
  	}
  }
  
  function updateModTime() {
    // Increment the time within this Module
    vTotalModTime++;
    var MovieToDoRefresh = InternetExplorer ? vuplayer : document.vuplayer;
    // Ping the server every 15 min
    if ((vTotalModTime < 121) && (vTotalModTime % 15) == 0){
    	//display alert every 15 minutes (for testing purposes)
    	//alert("time = "+vTotalModTime+" minutes");
  	//Make Flash run refresh code by calling a label within a code clip -- only if time is more than 5 minutes (so player has loaded)
  	if (vTotalModTime > 5){
  		var MovieToDoRefresh = InternetExplorer ? vuplayer : document.vuplayer;	
  		MovieToDoRefresh.TCallLabel("_root.Refresher", "refresh");
  	}
    }
    var timerID = setTimeout("updateModTime()",60000);
    timerRunning = true;
  }
  
  function maxWin(){
  	window.moveTo(0,0);
  	window.resizeTo(screen.availWidth,screen.availHeight);
  }
  
  function restoreWin(){
  	if (document.layers){
  		//for Netscape 4
  		window.resizeTo(750,475);
  	}
  	else {
  		//for IE and NE 6 & 7
  		window.resizeTo(762,506);
  	}
  	window.moveTo((screen.availWidth - 750)/2,(screen.availHeight - 475)/2);
  }

  function SignOffSession(){
    if (popup == "y") {
      window.open('../../CloseObjects.asp?vModId=' + getParameter("vModId") + '&vProgId=' + getParameter("vProgId") + '&vTimeSpent=' + vTotalModTime,'','width=10,height=10,left=0,top=0');
    }
  }  
  
  function windowClose(){
    if (popup == "y") {
      window.close();
    }
    else {  
      location.href = "/v5/wrapper/black.asp";	
   }
 	}
 	
 	
 	
