if (typeof(sIFR)=='object' && useSIFR!=false) {
	var metanormal = {src: '/_admin/swf/sifr3/metanormal.swf'};
	var metamedium = {src: '/_admin/swf/sifr3/metamedium.swf'};
	
	sIFR.useStyleCheck = true;
	sIFR.activate();
	
	sIFR.replace(metamedium, {
		onReplacement:function(){sIFR.removeFlashClass();},
		selector: 'h1.themebannerSubTitleWhite',
		css: ['.sIFR-root { font-size:35px; leading: -2; color: #ffffff }'],
		wmode: 'transparent'
		});
	sIFR.replace(metanormal, {
		onReplacement:function(){sIFR.removeFlashClass();},
		selector: 'h1.bannerSubTitleWhite',
		css: ['.sIFR-root { font-size:24px; leading: -2; color: #ffffff }'],
		wmode: 'transparent'
		});
}

Event.observe(window,'load',function(){
	doVideo('themeLeftVideoPlayer');
});

//videoplayer activation code
function doVideo(which) {
	if ($(which)) {
		if ($(which).select('.videoURL')[0]) {
		    targetVP=$(which).select('.vPlayer')[0];
		    var imageURL='';
		    if (targetVP.select('img')[0]) {
			imageURL=targetVP.select('img')[0].src;
			$(which).insert({bottom:'<div class="imageURLstored" style="display:none;">'+imageURL+'</div>'});
		    } else if ($(which).select('.imageURLstored')[0]) {
			imageURL=$(which).select('.imageURLstored')[0].innerHTML;
		    }
		    targetVP=targetVP.identify();
		    videoURL=$(which).select('.videoURL')[0].innerHTML;
		    var so = new SWFObject('/_admin/swf/themes/videoplayer-emmerse.swf', 'vPlayer'+targetVP, '240', '154', '8', '#ffffff');
		    so.addVariable('videoURL',videoURL);
		    so.addVariable('imageURL',imageURL);
		    so.addVariable('videoPlayerCSSID','vPlayer'+targetVP);
		    so.addVariable('isExplorer',BrowserDetect.browser=='Explorer');
		    so.addVariable('popupVideoRolloverText',$('popupVideoRolloverText')?$('popupVideoRolloverText').innerHTML:'Toggle full screen');
		    so.addVariable('tStr',window.s.pageName);//+': '+tStr);
		    so.addParam('wmode','transparent');
		    so.addParam('allowFullscreen','true');
		    so.addParam('quality','autohigh');
		    so.addParam('scale','noscale');
		    so.addParam('salign','tl');
		    so.write(targetVP);
		}
	}
}
//videoplayer resize callback -- called when player resizes for any reason, should be used to adjust HTML container's height to match
function videoPlayerLayoutCallback(vPlayerCSSID,updatedSpecs) {
	$(vPlayerCSSID).style.height=(updatedSpecs.videoHeight+updatedSpecs.interfaceHeight)+'px';
}

//omniture tracking wrapper for videoplayers (taken from /_admin/js/omniture_wrapper.js since this file was not included in the page...)
var originalPageName=false;
function emcTrack(tStr,filename,mode) {

	if (console.log) {
		console.log('DATA RECEIVED FROM FLASH:')
		console.log('tStr: '+tStr);
		console.log('filename: '+filename);
		console.log('mode: '+mode);
	}

	if (!originalPageName) {
		//originalPageName='WRAPPER TEST '+(useFlash?'FLASH':'NOFLASH')+' '+window.s.pageName;
		originalPageName=window.s.pageName;
	}

	if (console.log) {
		console.log('ORIGINALPAGENAME VALUE: '+originalPageName);
	}

	//download and custom link tracking -- shows up in File Downloads or Custom Links
	var s=s_gi('emc-emccom');
	s.dynamicAccountSelection=true;
	s.dynamicAccountList=window.s.dynamicAccountList;
	if (mode=='d') {
		s.tl(true,'d',filename);

		if (console.log) {
			console.log('SENT FILE DOWNLOAD TRACKING: '+filename);
		}

	} else if (mode=='o') {

		s.tl(true,'o',tStr);

		if (console.log) {
			console.log('SENT CUSTOM LINK TRACKING: '+tStr);
		}

	}

	//normal pageName tracking to enable pathing, etc. for both download and normal (but not custom)
	if (mode!='o') {
		
		var s=s_gi('emc-emccom');
		s.dynamicAccountSelection=true;
		s.dynamicAccountList=window.s.dynamicAccountList;
		s.pageName=originalPageName+': '+tStr;
		s.t();
		
		if (console.log) {
			console.log('SENT NORMAL PAGENAME-BASED TRACKING: '+originalPageName);
		}
		

	}

}

