//<script language="JavaScript">
        /*===== DEFINIZIONE DELLE DIMENSIONI =================================*/
        var currentSize=2;
		var widths=new Array(4);
		var heights=new Array(4);
		var xVideo=new Array(4);
		var yVideo=new Array(4);
		var xSlide=new Array(4);
		var ySlide=new Array(4);
		// 
		baseVS_X=0;
		baseVS_Y=0;
		baseLinks_X=780;
		baseLinks_Y=0;
		//
		widths[1]=189;
		widths[2]=360;
		widths[3]=550;
		//
		heights[1]=144;
		heights[2]=288;
		heights[3]=450;
		//
		xVideo[1]=0;
		xVideo[2]=0;
		xVideo[3]=0;
		//
		yVideo[1]=150;
		yVideo[2]=30;
		yVideo[3]=0;
		//
		xSlide[1]=210;
		xSlide[2]=380;
		xSlide[3]=580;
		//
		ySlide[1]=0;
		ySlide[2]=32;
		ySlide[3]=150;

		
		/*====== OBJECT DETECTION TECHNIQUES CONSTANTS =======================*/
		var isW3C = (document.getElementById) ? true : false
		var isAll = (document.all) ? true : false
		
		/*====== OBJECT DETECTION FUNCTION ===================================*/
		function check() { // CHECK IF THE BROWSER IS W3C
		   if (isW3C) return;
		   else if (isAll) alert("WARNING: your browser was never tested with the LODE system, it might not function well.");
		   else alert("Sorry, we do not support this browser. The LODE system will not work correctly.");
		 }
		function detectAndAlert(elemID) { // DETECT AN OJECT BY ITS NAME
    	   var elem = (isW3C) ? document.getElementById(elemID) : ((isAll) ? document.all[elemID] : null);
		   if (elem) return elem;
    	   else {
		   	 alert("CANNOT RESOLVE "+elemID);
		   }	   
		 }
		 function detect(elemID) { // DETECT AN OJECT BY ITS NAME
    	   var elem = (isW3C) ? document.getElementById(elemID) : ((isAll) ? document.all[elemID] : null);
		   	 return elem;
		 }
		 function isdefined(x) { if(typeof(x) !="undefined") return true; else return false; }
		 function resolveMovie() {
		    objE=detect("movie_E");
		    objO=detect("movie1");
		 	if (objE!=null) {
			   objO.id="movieO";
			   objE.id="movie1";
			   //alert("EMBED");
			}
			//else alert("OBJECT");
		 }

        /*===== CONTROLLING QUICKTIME ========================================*/
        function PlayIt(anObj) // take a QT movie and call its "Play" method 
        {
                anObj.Play();
        }
        function StopIt(anObj) // take a QT movie and call its "Play" method 
        {
                anObj.Stop();
        }
        function StartIt(anObj) // take a QT movie and call its "Rewind" method 
        {
                anObj.Rewind();
        }
        function ReverseIt(anObj) // take a QT movie and go back by 1 frame 
        {
        anObj.Step(-1);
        }
        function ForwardIt(anObj) // take a QT movie and go forward by 1 frame 
        {
         		 anObj.Step(1);
        }
		function getTime(anObj) // get the current time for a QT Movie
		{ 
		  		 return anObj.GetTime();
		}
		function setTime(anObj,sec)//reposition a QT movie to the given time (in sec)
  		{
    	 		 anObj.Stop();
    			 anObj.SetTime(sec);
    			 anObj.Play();
  		}


        /*===== RESIZING AND REPOSITIONING OBJECTS ===========================*/
		function setSize(mode,anObj) {
           anObj.width  = widths[mode];	
           anObj.height = heights[mode];
		}
		function setSizeById(mode,aName) {
		   anObj=detect(aName);
		   anObj.style.visibility="visible";
           anObj.width  = widths[mode];	
           anObj.height = heights[mode];
		}
		function setMoviePos(mode) {
		   anObj=detect("movie1"); //movieContainer
		   anObj.style.left=xVideo[mode];
		   anObj.style.top=yVideo[mode];
		}
		function setSlidePos(mode) {
		   anObj=detect("slideContainer");
		   anObj.style.left=xSlide[mode];
		   anObj.style.top=ySlide[mode];
		}
		// take element with id="name", move it to (x,y) and set its visibility
		// visibility must be "visible" or "hidden"
		function showElementAt(nameID,x,y,visibilityMode) {
			  var o=detect(nameID);
			  o.style.visibility=visibilityMode;
			  o.style.left=x;
			  o.style.top=y;
		}
		function reshape(mode) { 
		  setSizeById(mode,"movie1");
		  setSizeById(4-mode,"image");
		  setSlidePos(mode);
		  setMoviePos(mode);
		  titleID="LectureTitle";	  
		  if (mode==1) {
			 showElementAt(titleID,5,10,'visible');		 
		  } else if (mode==2) {
			 showElementAt(titleID,300,330,'visible');		 
		  } else if (mode==3) {
			 showElementAt(titleID,575,10,'visible');		 
		  }
		}
		function loadImage(string) {
		    img=detect('image');
			img.src=string+".jpg";
		}
		function hide(id) {
			obj=detect(id);
			obj.style.visibility="hidden";
		}

		/*===== INTERACTING WITH THE APPLET ==================================*/
  		function setTick(tick)
  		{
				 applet=detect("timeLine");
    	 		 applet.setTick(tick);
  		}

		function cleanUp() {
			x=detect('timeLine'); 
			if (x!=null) x.StopIt();
			y=detect('movie1');
			if (y!=null) y.Stop();
		}
		
  //----------------------------------------------------------------------------//
  // Rileva il tempo di riproduzione ed allinea la timeline
  //----------------------------------------------------------------------------//
  /*function refreshTime()
  {
    top.timeline_frame.alignTimeLine(Math.round(MP4P.GetTime() / timeFactor));
  }
  */
 
  
  /*function getTime()
  { 
    return Math.round(MP4P.GetTime() / timeFactor);
  }*/
