home *** CD-ROM | disk | FTP | other *** search
/ ftp.novell.com / 2014.06.ftp.novell.com.tar / ftp.novell.com / forge / camtasia.msi / Cabs.w1.cab / JavaScriptInc.js54 < prev    next >
Text File  |  2009-08-17  |  2KB  |  64 lines

  1. var vid;
  2.  
  3. $JSSCOFunctions
  4.  
  5. //adds and event listener across major browser versions
  6. function addEvent( obj, type, fn )
  7. {
  8.    if ( obj.addEventListener )
  9.    {
  10.       obj.addEventListener( type, fn, true );
  11.    }
  12.    else if ( obj.attachEvent )
  13.    {
  14.       obj.attachEvent( "on" + type, fn );
  15.    }
  16.    else
  17.    {
  18.       obj["on" + type] = fn;
  19.    }
  20. }
  21.  
  22. //removes event listeners across major browser versions
  23. function removeEvent( obj, type, fn )
  24. {
  25.    if ( obj.removeEventListener )
  26.    {
  27.       obj.removeEventListener( type, fn, true );    
  28.    }
  29.    else if ( obj.detachEvent )
  30.    {
  31.       obj.detachEvent( "on" + type, fn );
  32.    }
  33.    else
  34.    {
  35.       delete obj["on" + type];    
  36.    }
  37. }
  38.    
  39. function divClickHandler()
  40. {
  41.    var id = "video1";
  42.     var so = new SWFObject( "$URI", "csSWF", "$Width", "$Height", "$PlayerVersion", "#1a1a1a");
  43.     so.addParam( "quality", "best" );
  44.     so.addParam( "allowFullScreen", "$FullScreen" );
  45.     so.addParam( "scale", "$ScaleMode" );
  46.     so.addParam( "allowScriptAccess", "always" );
  47.     so.addVariable( "autostart", "true" );
  48.     if( !so.write( "video1" ) )    
  49.     {
  50.        var node = '<div id="cs_noexpressUpdate">'
  51.                     + '<p align="center">The Camtasia Studio video content presented here </p><p align="center"> requires JavaScript to be enabled and the latest version </p><p align="center">of the Macromedia Flash Player.  If you are you using </p><p align="center">a browser with JavaScript disabled please enable it now.</p><p align="center"> Otherwise, please update your version of the </p><p align="center">free Flash Player by <a href="http://www.macromedia.com/go/getflashplayer">downloading here</a>. </p>'
  52.                + '</div>'
  53.       var n = (typeof id == 'string') ? document.getElementById( id ) : id;
  54.       n.innerHTML = node;
  55.     }
  56.  
  57.    removeEvent( vid, 'click', divClickHandler );
  58.  
  59. function pageLoad()
  60. {
  61.    $JSAddClickEvent
  62.    $JSCallLoadPage
  63. }