
// pms_video-player.js
// Used to setup functions that will pass information from JavaScript to the Flash Players.

// Functions that can be called from the HTML to talk to the Flash.
function newMovie(whatVideoId) {
	thisMovie("vista_player").newMovieSWF(whatVideoId);
	//alert("complete: newMovie");
}

function setMovieTitle(whatTitle) {
	thisMovie("vista_player").movieTitleSWF(whatTitle);
	//alert("complete: setMovieTitle");
}

// Select ONLY the video player, different method for DOM from IE.
function thisMovie(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1 || window.attachEvent) {
		return window[movieName];
	}
	else {
		return document[movieName];
	}
}




var pdpTabs = new Array();

function updateFlashComponents( )
{
	var videoPlayerObj = new Object;
	var par = { };
	var att = { };
	var id = "";
	
	if( $('notebookVideoPlayer') ) 
	{
		par.flashvars = "xmlPath=http://image.alienware.com/images/microsite/intel_technology/intel_player/features.xml";
		par.allowScriptAccess = "always";
		par.wmode = "opaque";
		att = { data:"http://image.alienware.com/images/microsite/intel_technology/intel_player/videoPlayer.swf", width:"453", height:"280", id:"M17_Processor", name:"M17_Processor" };
		id = "notebookVideoPlayer";
		videoPlayerObj = swfobject.createSWF(att, par, id);
	}
	
	if( $('desktopVideoPlayer') ) 
	{
		par.flashvars = "startMovie=5Mi5XQnkTgE";
		par.flashvars += "&movieTitle=The Intel® Core™ i7";
		par.allowScriptAccess = "always";
		par.wmode = "transparent";
		att = { data:"http://image.alienware.com/Images/microsite/pms/pms_player/alienware_pms_player.swf", width:"356", height:"322", id:"vista_player2", name:"vista_player2" };
		id = "desktopVideoPlayer";
		videoPlayerObj = swfobject.createSWF(att, par, id);
	}
	
}

// Initialize Flash Objects & Refresh Tabs on Load
if (window.addEventListener) { // DOM 
	window.addEventListener('load', updateFlashComponents, false);
	window.addEventListener('load', RefreshTabNavigation, false);
} else if (window.attachEvent) { // IE
	window.attachEvent('onload', updateFlashComponents);
	window.attachEvent('onload', RefreshTabNavigation);
}

function RefreshTabNavigation()
{
	try{
	    RefreshTabVisibility();
	    updateFlashComponents( );
	}
	catch( exception ){
		/*alert( exception );*/
	}

//fix PNGs for loaded content
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	if ((version >= 5.5 && version < 7) && (document.body.filters))
		pngfix();

}

function RefreshTabVisibility()
{
    if (pdpTabs == null)
        return;
    
    for (var idx = 0; idx < pdpTabs.length; idx++)
    {
        document.getElementById(pdpTabs[idx]).style.display = 'block';
    }
	if ($('ctl00_ctl00_BodyContent_Main_pageMain_review_tab').className == 'current')
		$('ctl00_ctl00_BodyContent_Main_pageMain_reviews_tab').addClassName("current");
			
}

