


function OnLoad()
{
	   vid = document.getElementById( "video1" );
   addEvent( vid, "click", divClickHandler );
	
	   timerInit();
	
}
function SeekTime( Time )
{
   if( document.mediaPlayer == undefined || document.mediaPlayer == null )
   {
      return;
   }
   
   if (navigator.appName == "Netscape" && !window.GeckoActiveXObject ) 
   {
      document.mediaPlayer.getControls().setCurrentPosition( Time );
      document.mediaPlayer.getControls().Play();
   } 
   else 
   {
      document.mediaPlayer.controls.currentPosition = Time;
      document.mediaPlayer.controls.play();
   }	
}


function ScrollToIndex( DivID, destIndex ) 
{
   var nDestYCoord = destIndex.offsetTop; 
   var thisNode    = destIndex; 
   
   while ( thisNode.offsetParent && ( thisNode.offsetParent !=  document.body) ) 
   { 
      thisNode     = thisNode.offsetParent; 
      nDestYCoord += thisNode.offsetTop; 
   }

   nCurWindowYPos = GetCurrentScrollYPos( DivID.id );

   //Only scroll if it's needed..
   if( destIndex.offsetTop + destIndex.offsetHeight > DivID.clientHeight )
   {      
      nDestYCoord -= DivID.clientHeight;
      
      if( nDestYCoord > DivID.scrollTop )
      {
         DivID.scrollTop = nDestYCoord;
      }
   }
}

function GetCurrentScrollYPos( DivID ) 
{ 
   var aDivs = document.body.getElementsByTagName("DIV");

   for ( var i=0; i < aDivs.length; i++ ) 
   { 
      var Div = aDivs[i]; 

      if ( Div.id == DivID ) 
      { 
         return Div.scrollTop
      }
   }

   return 0;
}


function timerInit() 
{
   //Sets the timer to check every .1 second
   window.setInterval("timer()", 100);
}

function timer() 
{       
   if( document.mediaPlayer == undefined || document.mediaPlayer == null )
   {
      return;
   }
   
   if( document.mediaPlayer.PlayState == 3 ) 
   {
      var destIndex = null;
      
var curTime = mediaPlayer.controls.currentPosition;
      if( curTime >= 0.000000 && curTime < 22.500000 )
      {
         document.getElementById('Index0').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index0');
      }
      else
      {
         document.getElementById('Index0').style.backgroundColor = '';
      }
      if( curTime >= 22.500000 && curTime < 60.600000 )
      {
         document.getElementById('Index1').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index1');
      }
      else
      {
         document.getElementById('Index1').style.backgroundColor = '';
      }
      if( curTime >= 60.600000 && curTime < 86.500000 )
      {
         document.getElementById('Index2').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index2');
      }
      else
      {
         document.getElementById('Index2').style.backgroundColor = '';
      }
      if( curTime >= 86.500000 && curTime < 113.400000 )
      {
         document.getElementById('Index3').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index3');
      }
      else
      {
         document.getElementById('Index3').style.backgroundColor = '';
      }
      if( curTime >= 113.400000 && curTime < 124.600000 )
      {
         document.getElementById('Index4').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index4');
      }
      else
      {
         document.getElementById('Index4').style.backgroundColor = '';
      }
      if( curTime >= 124.600000 && curTime < 133.200000 )
      {
         document.getElementById('Index5').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index5');
      }
      else
      {
         document.getElementById('Index5').style.backgroundColor = '';
      }
      if( curTime >= 133.200000 && curTime < 148.500000 )
      {
         document.getElementById('Index6').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index6');
      }
      else
      {
         document.getElementById('Index6').style.backgroundColor = '';
      }
      if( curTime >= 148.500000 && curTime < 157.200000 )
      {
         document.getElementById('Index7').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index7');
      }
      else
      {
         document.getElementById('Index7').style.backgroundColor = '';
      }
      if( curTime >= 157.200000 && curTime < 186.000000 )
      {
         document.getElementById('Index8').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index8');
      }
      else
      {
         document.getElementById('Index8').style.backgroundColor = '';
      }
      if( curTime >= 186.000000 && curTime < 231.100000 )
      {
         document.getElementById('Index9').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index9');
      }
      else
      {
         document.getElementById('Index9').style.backgroundColor = '';
      }
      if( curTime >= 231.100000 && curTime < 360.100000 )
      {
         document.getElementById('Index10').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index10');
      }
      else
      {
         document.getElementById('Index10').style.backgroundColor = '';
      }
      if( curTime >= 360.100000 && curTime < 428.600000 )
      {
         document.getElementById('Index11').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index11');
      }
      else
      {
         document.getElementById('Index11').style.backgroundColor = '';
      }
      if( curTime >= 428.600000 && curTime < 475.600000 )
      {
         document.getElementById('Index12').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index12');
      }
      else
      {
         document.getElementById('Index12').style.backgroundColor = '';
      }
      if( curTime >= 475.600000 && curTime < 510.200000 )
      {
         document.getElementById('Index13').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index13');
      }
      else
      {
         document.getElementById('Index13').style.backgroundColor = '';
      }
      if( curTime >= 510.200000 && curTime < 593.233000 )
      {
         document.getElementById('Index14').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index14');
      }
      else
      {
         document.getElementById('Index14').style.backgroundColor = '';
      }
      if( curTime >= 593.233000 && curTime < 659.000000 )
      {
         document.getElementById('Index15').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index15');
      }
      else
      {
         document.getElementById('Index15').style.backgroundColor = '';
      }
      if( curTime >= 659.000000 && curTime < 766.466000 )
      {
         document.getElementById('Index16').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index16');
      }
      else
      {
         document.getElementById('Index16').style.backgroundColor = '';
      }
      if( curTime >= 766.466000 && curTime < 1014.966000 )
      {
         document.getElementById('Index17').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index17');
      }
      else
      {
         document.getElementById('Index17').style.backgroundColor = '';
      }
      if( curTime >= 1014.966000 && curTime < 1050.433000 )
      {
         document.getElementById('Index18').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index18');
      }
      else
      {
         document.getElementById('Index18').style.backgroundColor = '';
      }
      if( curTime >= 1050.433000 && curTime < 1072.300000 )
      {
         document.getElementById('Index19').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index19');
      }
      else
      {
         document.getElementById('Index19').style.backgroundColor = '';
      }
      if( curTime >= 1072.300000 && curTime < 1399.600000 )
      {
         document.getElementById('Index20').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index20');
      }
      else
      {
         document.getElementById('Index20').style.backgroundColor = '';
      }
      if( curTime >= 1399.600000 && curTime < 1447.800000 )
      {
         document.getElementById('Index21').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index21');
      }
      else
      {
         document.getElementById('Index21').style.backgroundColor = '';
      }
      if( curTime >= 1447.800000 && curTime < 1551.400000 )
      {
         document.getElementById('Index22').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index22');
      }
      else
      {
         document.getElementById('Index22').style.backgroundColor = '';
      }
      if( curTime >= 1551.400000 && curTime < 1574.766000 )
      {
         document.getElementById('Index23').style.backgroundColor = '#ffffcc';
         destIndex = document.getElementById('Index23');
      }
      else
      {
         document.getElementById('Index23').style.backgroundColor = '';
      }

      
      if( destIndex != null )
      {
         ScrollToIndex( document.getElementById('indexlinks'), destIndex );
      }
   }     
}

   var toc1     = null;
   var toc2     = null;
   var vid      = null;
     
   //adds and event listener across major browser versions
   function addEvent( obj, type, fn )
   {
	   if ( obj.addEventListener )
	   {
		   obj.addEventListener( type, fn, true );
	   }
	   else if ( obj.attachEvent )
	   {
		   obj.attachEvent( "on" + type, fn );
	   }
	   else
	   {
		   obj["on" + type] = fn;
	   }
   }

   //removes event listeners across major browser versions
   function removeEvent( obj, type, fn )
   {
      if ( obj.removeEventListener )
	   {
	      obj.removeEventListener( type, fn, true );	
	   }
	   else if ( obj.detachEvent )
	   {
	     obj.detachEvent( "on" + type, fn );
	   }
	   else
	   {
		   delete obj["on" + type];	
	   }
   }
   
   function divClickHandler()
   {
      SwitchPlayer( "video1", "video2", "Bim to Facilitate Construction 09-06-12-1 WAV.wmv", "640", "545", "Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/", "Bim to Facilitate Construction 09-06-12-1 WAV_media/", "mediaPlayer", "application/x-oleobject", "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6", "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701", "Loading Microsoft Windows Media Player components...", "EmbedmediaPlayer", "false", "true", "full", toc1, toc2 );
      
      removeEvent( vid, 'click', divClickHandler );
   } 
   toc1 = 
               '<table id="CsEmdPlr">'
             + '   <tr>'
             + '      <td class="top_center_clr">'
             + '         <div class="contentWrapper_left">'
             + '            <div class="content_left">'
             + '               <img src="Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/images/top_left_corner.jpg" alt=" " class="borderTL" />'
             + '               <img src="Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/images/top_right_corner.jpg" alt=" " class="borderTR" />'
             + '               <div id="indexlinks" class="indexlinks"><br/>'
             + '                  <h3>Bim to Facilitate Construction 09-06-12-1 WAV</h3>'
+ '                  <p id="Index0"><a href="javascript:SeekTime(0.000000);" title="The Use of BIM to Facilitate Concrete Design & Construction">  The Use of BIM to Facilitate Concrete Design & Construction</a></p>'
+ '                  <p id="Index1"><a href="javascript:SeekTime(22.500000);" title="Leveraging Integration">  Leveraging Integration</a></p>'
+ '                  <p id="Index2"><a href="javascript:SeekTime(60.600000);" title="Case Presentation">  Case Presentation</a></p>'
+ '                  <p id="Index3"><a href="javascript:SeekTime(86.500000);" title="Back Ground">  Back Ground</a></p>'
+ '                  <p id="Index4"><a href="javascript:SeekTime(113.400000);" title="California State University Northridge Center for Performing Arts">  California State University Northridge Center for Performing Arts</a></p>'
+ '                  <p id="Index5"><a href="javascript:SeekTime(124.600000);" title="Mercury Insurance Administration Parking Structure">  Mercury Insurance Administration Parking Structure</a></p>'
+ '                  <p id="Index6"><a href="javascript:SeekTime(133.200000);" title="LACMTA (Metro) East LA Lt. Rail Expansion Pomona Atlantic Park & Ride">  LACMTA (Metro) East LA Lt. Rail Expansion Pomona Atlantic Park & Ride</a></p>'
+ '                  <p id="Index7"><a href="javascript:SeekTime(148.500000);" title="Empire Center Office Bldg. & Parking Structure">  Empire Center Office Bldg. & Parking Structure</a></p>'
+ '                  <p id="Index8"><a href="javascript:SeekTime(157.200000);" title="Benefits of BIM">  Benefits of BIM</a></p>'
+ '                  <p id="Index9"><a href="javascript:SeekTime(186.000000);" title="Pre-Building">  Pre-Building</a></p>'
+ '                  <p id="Index10"><a href="javascript:SeekTime(231.100000);" title="Design Completeness Reviews">  Design Completeness Reviews</a></p>'
+ '                  <p id="Index11"><a href="javascript:SeekTime(360.100000);" title="Constructability Reviews">  Constructability Reviews</a></p>'
+ '                  <p id="Index12"><a href="javascript:SeekTime(428.600000);" title="Clash Detection">  Clash Detection</a></p>'
+ '                  <p id="Index13"><a href="javascript:SeekTime(475.600000);" title="Virtual RFIs">  Virtual RFIs</a></p>'
+ '                  <p id="Index14"><a href="javascript:SeekTime(510.200000);" title="Site Logistics & Planning">  Site Logistics & Planning</a></p>'
+ '                  <p id="Index15"><a href="javascript:SeekTime(593.233000);" title="Phaseing & Scheduling">  Phaseing & Scheduling</a></p>'
+ '                  <p id="Index16"><a href="javascript:SeekTime(659.000000);" title="Work Flow & Crew Planning">  Work Flow & Crew Planning</a></p>'
+ '                  <p id="Index17"><a href="javascript:SeekTime(766.466000);" title="The Intelligent BIM">  The Intelligent BIM</a></p>'
+ '                  <p id="Index18"><a href="javascript:SeekTime(1014.966000);" title="Advanced Budgeting / Cost Control">  Advanced Budgeting / Cost Control</a></p>'
+ '                  <p id="Index19"><a href="javascript:SeekTime(1050.433000);" title="Dynamic Planning">  Dynamic Planning</a></p>'
+ '                  <p id="Index20"><a href="javascript:SeekTime(1072.300000);" title="5D Simulations (BIM+TIME+COST)">  5D Simulations (BIM+TIME+COST)</a></p>'
+ '                  <p id="Index21"><a href="javascript:SeekTime(1399.600000);" title="The Ultimate in Communication & Coordination">  The Ultimate in Communication & Coordination</a></p>'
+ '                  <p id="Index22"><a href="javascript:SeekTime(1447.800000);" title="Rendered Flythough">  Rendered Flythough</a></p>'
+ '                  <p id="Index23"><a href="javascript:SeekTime(1551.400000);" title="Conclusion">  Conclusion</a></p>'

             + '               </div>'
             + '            </div>'
             + '         </div>'
             + '         <div id="menuBottom"></div>'
             + '      </td>'
             + '      <td class="top_center">'
             + '         <div class="contentWrapper">'
             + '            <div class="content">'
             + '               <img src="Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/images/top_left_corner.jpg" alt=" " class="borderTL" />'
             + '               <img src="Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/images/top_right_corner.jpg" alt=" " class="borderTR" /><br/><br/>';          

   toc2 = 
               '               <br/>  '
             + '            </div>'
             + '         </div>'
             + '      </td>'
             + '   </tr>'
             + '   <tr>'
             + '      <td></td>'
             + '      <td class="bottom_center">'
             + '         <div class="contentWrapper">'
             + '            <div class="content">'
             + '               <img src="Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/images/bottom_left.jpg" alt=" " class="borderBL"  />'
             + '               <img src="Bim%20to%20Facilitate%20Construction%2009-06-12-1%20WAV_media/images/bottom_right.jpg" alt=" " class="borderBR" />'
             + '             </div>'
             + '         </div>'
             + '      </td>'
             + '   </tr>'
             + '</table>';
