function ed_vid(file,autostart,width,height,overstretch,is18,img,id,pid,playbar,tracking){
    id = 'flashcontent_myInSkin1';
    pid = 'InSkinFlashPlayer';

    document.write('<div style="width:540px;margin:0 auto;clear:both;">');
    
    inskin1();
     ed_vid2(file,autostart,width,height,overstretch,is18,img,id,pid,playbar,tracking);
    inskin2();
    
    document.write('</div>');
};

/* renamed to use inskin */
function ed_vid2(file,autostart,width,height,overstretch,is18,img,id,pid,playbar,tracking){
    file = file ||'10063';
    autostart = autostart || 'true';
    width = width || '480';
    height = height || '360';
    overstretch = overstretch || 'false';
    is18 = is18 || '';
    img = img || '';
    id = id || 'video1';
    pid = pid || 'player1';
    playbar = playbar || 'true';
    tracking = tracking || '';
    
    // call a different player depending on settings 
    // http://mediamanager.internetvideoarchive.com/FlashPlayerV5Manager.aspx for more players
    // Get login info from digital team
    var player = 310;
    if ( autostart == 0 || autostart == 'false' ) { player = 311; }
    // annoyingly, html 5 players do not support inline height and width so...
    // we need to create a new smaller player just for small videos on the ipad for page /features/get-more-out-of-lovefilm/
    if ( width == '275') { player = 388; }
    
    // playbar required?
    var playbar_param = 'over';    
    if ( playbar == 0 || playbar == 'false' ) { playbar_param = 'none'; }
    
    // create video div if it doesnt already exist
    if ($("#" + id).length == 0){
        document.write('<div style="margin: 0 auto; width:'+width+'px;"><div id="'+id+'" style="width:'+width+'px;height:'+height+'px; position:relative;"></div></div>');
    }
    
    // do not try to implement the video detective player until external script is loaded 
    // http://www.videodetective.net/html5/js/ivaplayer.js
    $.getScript('http://www.videodetective.net/html5/js/ivaplayer.js', function() {
        ivaplayer(id).setup({
            'flashplayer': 'http://www.videodetective.net/flash/players/?pversion=5.2&playerid='+player,
            'customerid': '33400',
            'publishedid': file,
            'playerid': player,
            'videokbrate': '750',
            'fmt': '4',
            'width': width,
            'height': height,
            'sub': tracking,
            'controlbar.position': playbar_param
            });
    });
    
};

function inskin1(){
    var print1 ='<!-- Start of InSkin Ad Code -->'+
    '<link type="text/css" rel="stylesheet" href="http://inskin.vo.llnwd.net/o21/ikit/default/css/default.css" />'+
    '<!-- Start of InSkin Container -->'+
    '<div id="InSkinContainer_myInSkin1" class="InSkinContainer">'+
    '<!-- Start of InSkin Base Container -->'+
    '<div id="InSkinBaseContainer_myInSkin1" class="InSkinBaseContainer">'+
    '<div id="InSkinIDiv_myInSkin1"></div>'+
    '</div>'+
    '<!-- End of InSkin Base Container -->'+
    '<!-- Start of Content/Player Container -->'+
    '<div id="InSkinContentContainer_myInSkin1" class="InSkinContentContainer" style="width: 480px; height: 360px; background: #000000;">';
    document.write(print1);    
}

function inskin2(){
    var print2 ='</div>'+
    '<!-- End of Content/Player Container -->'+
    '</div>';
    document.write(print2);    
}

