

/*------------------------

 rewriting QuickTime generation function
 
------------------------*/
function QT_WriteOBJECT_XHTML2() {
	return _QTGenerate("QT_WriteOBJECT_XHTML2", true, arguments);
}


/*------------------------

 initialize width and height definitions
 
------------------------*/

var widthHD = 960;
var heightHD = 450;

var widthStandard = 960;
var heightStandard = 450;


/*------------------------

 show HD video function
 
------------------------*/
function showHDVideo(hdID, standardID, largeAssetsURLbase, qt480, qt720, qt1080) {   
    /* code for embed input field - dependent on standardID variable being passed  */
    var standardEmbed = '&lt;embed src=&quot;http://mediaservices.myspace.com/services/media/embed.aspx/m=' + standardID + ',t=1,mt=video&quot; width=&quot;' + widthStandard + '&quot; height=&quot;' + heightStandard + '&quot; allowFullScreen=&quot;true&quot; type=&quot;application/x-shockwave-flash&quot; /&gt;';
 
    /* swapping in the HD Video content */
    document.getElementById('videoPlayerContent').innerHTML = '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' + hdID +',t=1,mt=video,sr=0,ap=1" width="' + widthHD + '" height="' + heightHD + '" allowFullScreen="true" wmode="transparent" type="application/x-shockwave-flash" />';
    document.getElementById('shareContent').innerHTML = '<div id="sharebox">'  + 
                                                        '<div id="embedContent">&nbsp;Embed Code:<input name="embedCode" type="text" id="embedCode" value="' + standardEmbed + '" onclick="this.select()" /></div><div class="clear"></div></div>';
    document.getElementById('otherVideosContent').innerHTML = '<img src="http://creative.myspace.com/Client/Marketing/TrailerPark/Images/sizes.gif" id="viewsizes"/>' + 
                                                        '<a href="javascript:showStandardVideo(\'' + hdID + '\',\''+ standardID + '\',\''+largeAssetsURLbase+ '\',\'' + qt480 + '\',\'' + qt720 +'\',\'' + qt1080 + '\')" style="float:left;"><img src="http://creative.myspace.com/Client/Marketing/TrailerPark/Images/std.gif" /></a>' + 
                                                        '<div  style="float:left;width:44px;" id="480button"></div><div  style="float:left;width:52px;" id="720button"></div><div  style="float:left;width:67px;" id="1080button"></div>';
    
    /* sets the wrapping DIV width */
    document.getElementById('playerwrapper').style.width = widthHD + "px";
    
    /* bringing in the QT object/embed content to the HD menu */
    document.getElementById('480button').innerHTML = QT_WriteOBJECT_XHTML2("http://creative.myspace.com/Client/Marketing/TrailerPark/Quicktime/480p.mov","44","27","","bgcolor","FFFFFF","controller","false","href", largeAssetsURLbase + qt480,"target","QuickTimePlayer");
    document.getElementById('720button').innerHTML = QT_WriteOBJECT_XHTML2("http://creative.myspace.com/Client/Marketing/TrailerPark/Quicktime/720p.mov","52","27","","bgcolor","FFFFFF","controller","false","href", largeAssetsURLbase + qt720,"target","QuickTimePlayer");
    document.getElementById('1080button').innerHTML = QT_WriteOBJECT_XHTML2("http://creative.myspace.com/Client/Marketing/TrailerPark/Quicktime/1080p.mov","67","27","","bgcolor","FFFFFF","controller","false","href",largeAssetsURLbase + qt1080,"target","QuickTimePlayer");
    
}


/*------------------------

 show standard player function
 
------------------------*/
function showStandardVideo(hdID, standardID, largeAssetsURLbase, qt480, qt720, qt1080) {
    /* code for embed input field - dependent on standardID variable being passed  */
    var standardEmbed = '&lt;embed src=&quot;http://mediaservices.myspace.com/services/media/embed.aspx/m=' + standardID + ',t=1,mt=video&quot; width=&quot;' + widthStandard + '&quot; height=&quot;' + heightStandard + '&quot; allowFullScreen=&quot;true&quot; type=&quot;application/x-shockwave-flash&quot; /&gt;';

    /* swapping in the Stanard Video content */
    document.getElementById('videoPlayerContent').innerHTML = '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' + standardID +',t=1,mt=video,sr=0,ap=1" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" width="' + widthStandard + '" height="' + heightStandard + '" wmode="transparent"/>';
    document.getElementById('shareContent').innerHTML = '<div id="sharebox">'  + 
                                                        '<div id="embedContent">&nbsp;Embed Code:<input name="embedCode" type="text" id="embedCode" value="' + standardEmbed + '" onclick="this.select()" /></div><div class="clear"></div></div>';
    document.getElementById('otherVideosContent').innerHTML = '<a href="javascript:showHDVideo('+ hdID +','+ standardID + ',\''+largeAssetsURLbase+ '\',\'' + qt480 + '\',\'' + qt720 +'\',\'' + qt1080 + '\')" style="float:left;"><img src="http://creative.myspace.com/Client/Marketing/TrailerPark/Images/hd.gif" /></a>  ';
    
    /* sets the wrapping DIV width */
    document.getElementById('playerwrapper').style.width = widthStandard + "px";
}



/*------------------------

 show standard player only (no HD swapping) function
 
------------------------*/
function showStandardOnly(standardID) {
    /* code for embed input field - dependent on standardID variable being passed  */
   
    /* swapping in the Stanard Video content */
    document.getElementById('videoPlayerContent').innerHTML = '<embed src="http://mediaservices.myspace.com/services/media/embed.aspx/m=' + standardID +',t=1,mt=video,sr=0,ap=1" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" width="' + widthStandard + '" height="' + heightStandard + '" wmode="transparent"/>';
    document.getElementById('shareContent').innerHTML = ''; 
    document.getElementById('otherVideosContent').innerHTML = '';
    
    /* sets the wrapping DIV width */
    document.getElementById('playerwrapper').style.width = widthStandard + "px";
}


window.onload=function(){
    showHDVideo(57999299, 57999299, 'http://largeassets.myspacecdn.com/creative/hd/hp6_main/', '57999299_480p.mov', '57999299_720p.mov', '57999299_1080p.mov')
}



