
var args = new Object();
var query = location.search.substring(1);

// Get query string
var pairs = query.split( "," );

// Break at comma
for ( var i = 0; i < pairs.length; i++ )
{
   var pos = pairs[i].indexOf('=');
   if( pos == -1 ) 
   {   
      continue; // Look for "name=value"
   }

   var argname  = pairs[i].substring( 0, pos );  // If not found, skip
   var value    = pairs[i].substring( pos + 1 ); // Extract the name
   args[argname] = unescape( value );            // Extract the value
} 

// Added by Screencast.com team for flash detection.
// The other values referenced here are already included within the view/playlist pages

// NOTE: The vars passed in are set on the view/playlist pages via javascript
var flash = checkFlash( minFlashVersionMajor, minFlashVersionMinor, minFlashVersionRev );
      
if ( flash == needsUpgrade )
{
   displayWarning( 'You appear to be using an outdated version of the Adobe Flash Player. If you experience problems viewing this media, please try upgrading to the latest version which is available for free at <a href="http://www.adobe.com/go/getflashplayer" target="_blank">http://www.adobe.com/go/getflashplayer</a>.', true, 0 );
}

/* End Screencast.com addition */


function OnLoad()
{
	   vid = document.getElementById( "video1" );
   addEvent( vid, "click", divClickHandler );
	
		
}



   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', '595', '720', 'http://content.screencast.com/?parameters=6f642707-a343-4827-a97b-c3894586ed14_4a4c1f81-29ed-46dc-aa70-bec087c03e31_static_2097152_application/x-shockwave-flash_', 'http://content.screencast.com/?parameters=6f642707-a343-4827-a97b-c3894586ed14_4a4c1f81-29ed-46dc-aa70-bec087c03e31_dynamic_4_text/xml_', 'PackAndShow_controller.swf', 'PackAndShow_config.xml', 'best', '7', 'FFFFFF', 'http://content.screencast.com/?parameters=6f642707-a343-4827-a97b-c3894586ed14_4a4c1f81-29ed-46dc-aa70-bec087c03e31_static_4096_application/x-shockwave-flash_PackAndShow_preload.swf', '' );
      
      removeEvent( vid, 'click', divClickHandler );
   } 


