
  // check if global DOL flash detect has already been included on this page 
  if( typeof CreateInterface != 'function' ) document.write( '<script type="text/javascript" src="http://disney.go.com/detect/scripts/master_flash_full.js"></script>' );


  function insertVideo( flashVars, videoSize, disableAds )
  {    
    var player = "player_" + videoSize + ".swf",        
        swfDimensions = new Array( 2 );
        
    if( disableAds != undefined && disableAds == true ) disableAds = "disableAds=true&";    
    else disableAds = "";
    
    flashVars = disableAds + "playerSize=" + videoSize + "&" + flashVars;
      
    switch( videoSize )
    {
      case "420x315":
        swfDimensions[ 0 ] = "426";
        swfDimensions[ 1 ] = "385";
        break;
      case "320x240":
        swfDimensions[ 0 ] = "326";
        swfDimensions[ 1 ] = "310";
        break;
      case "432x240":
        swfDimensions[ 0 ] = "438";
        swfDimensions[ 1 ] = "310";
        break;
    }
    
    document.write( '<!-- begin ad tracking and hit tracking code for EFSP (Embedded Flash Standard Player) -->' );
    document.write( '<iframe id="hitIF" name="hit" scrolling="no" style="position:absolute;overflow:hidden;width:0px;height:0px;top:0px;left:0px;z-index:1002;border:0px"></iframe>' );
    document.write( '<iframe id="logIF" name="ads" scrolling="no" style="position:absolute;overflow:hidden;width:0;height:0;top:0;left:0;z-index:1001;border:0px"></iframe>' );
    document.write( '<scr' + 'ipt type="text/vbscript" language="VBScript">' );
    document.write( '  <!--' );
    document.write( '    sub fspContainer_FSCommand( ByVal command, ByVal args )' );
    document.write( '      call fspContainer_DoFSCommand( command, args )' );
    document.write( '    end sub' );
    document.write( '  //-->' );
    document.write( '</scr' + 'ipt>' );
    document.write( '<!-- end ad tracking and hit tracking code for EFSP -->' );

    CreateInterface();
    DetectFlash( "7", "http://family.go.com/generaltemplate.do?id=Software-Center", "" );

    flashObj = new FlashObj( "http://family.go.com/videoplayer/ads/" + player,  // swf location
                             swfDimensions[ 0 ],                                // width
                             swfDimensions[ 1 ],                                // height
                             "#ffffff",                                         // background
                             "7",                                               // version # of flash used in creating SWF
                             "EFSP",                                            // id
                             flashVars,                                         // FlashVars
                             true,                                              // optional argument. false = "no autoplay". true or blank = "autoplay"
                             "http://family.go.com/videoplayer/ads/" );         // base target
    
    flashObj.render( true, "opaque" ); // sets flash movie to opaque so ads can display over the content
  }



  // tracking code
  // ****************************************************************************************************************
  var stitchArray;
  var clearSynchedAd = false;

  function fspContainer_DoFSCommand( command )
  {
    eval( command );
  }

  function synchIFDisplay( isVis, sifUrl, iWidth, iHeight )
  {
    debug.innerHTML += "<br>synch if: " + isVis + ":" + sifUrl;
    var sifn = frames[ "synch" ];
    var sifid = document.getElementById( "synchIF" );
    if( sifn)
    {
      if( isVis )
      {
        if( !iWidth ) { iWidth=0 }
        if( !iHeight ) { iHeight=0 }
        sifid.style.width = iWidth + "px";
        sifid.style.height = iHeight + "px";
        sifn.location.replace( sifUrl );
      }
      else if( clearSynchedAd )
      {
        sifid.style.width = "0px";
        sifid.style.height = "0px";
      }
    }
  }
  function sendLogIF( logUrl )
  {
    logUrl = logUrl.replace( "&amp;", "&" );
    
    if( frames[ 'ads' ] )
    {
      frames[ 'ads' ].location.replace( logUrl );
    }
  }
  function sendHitIF( hitUrl )
  {
    if( frames[ 'hit' ] )
    {
      hitUrl = hitUrl.replace( /liiiid/, "lid" );
      frames[ 'hit' ].location.replace( hitUrl );
    }
  }
  function stitch(index, frag)
  {
    if( stitchArray == undefined ) stitchArray = new Array();
    if( stitchArray[ index ] == undefined )
    {
      stitchArray[ index ] = frag;
    }
    else
    {
      stitchArray[ index ] += frag;
    }
    if( stitchArray[ index ].lastIndexOf( ")" ) == stitchArray[ index ].length - 1 )
    {
      stitchArray[ index ] = stitchArray[ index ].replace( /~/gi, "\'" );
      eval(stitchArray[ index ] );
      delete stitchArray[ index ];
    }
  }
  