//if javascript enabled (i.e. this script is being called), remove the 'enable javascript' text'
var playObj = document.getElementById('play');
var p  = playObj.getElementsByTagName('p')[0];

// create 'get flash' link and image
var a = document.createElement('a');
a.setAttribute('href', 'http://www.bbc.co.uk/webwise/categories/plug/flash/flash.shtml?intro');
var img = document.createElement('img');
img.setAttribute('src' , '/signsoflife/images/buttons/no_flash.gif');
img.setAttribute('width' , '470');
img.setAttribute('height' , '45');
img.setAttribute('alt' , 'You need the free Adobe Flash plugin to play. Click here to download it');
a.appendChild(img);

// remove old text
playObj.removeChild(p);
playObj.appendChild(a);

// embed splash page clip
try{
    if(document.getElementById('clip')){
        var soMain = new SWFObject('/signsoflife/protected/livingPoster.swf',    'signsoflife', '100%', '100%', '8', '#000000');
        soMain.addParam('loop', true);
        soMain.write('clip');
    }
}
catch(e){}

// embed play button
try{
    if(document.getElementById('play')){
        var so = new SWFObject('/signsoflife/protected/playButton.swf',    'signsoflife', '470', '45', '8', '#ffffff');
        so.addVariable('redirectUrl', '/signsoflife/episodeselect/index.shtml');
        so.addParam('allowScriptAccess', 'sameDomain');
        so.addParam('swliveconnect', true);
        so.addParam('WMODE', 'opaque');
        so.write('play');
    }
}
catch(e){}
