if(document.all){
	// fix background image flicker in IE6
	try {
		document.execCommand("BackgroundImageCache", false, true);
	} catch(e) {

	}
}

snap_css = function() {
	var divContentStyle = document.getElementById("content").style;
	divContentStyle.position   = "relative";
	divContentStyle.position   = "static";
	divContentStyle.marginLeft = "0px";
}

if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", snap_css, false);
}

function stateTracker(obj) {
	if(obj.newstate == 'COMPLETED' || obj.newstate == 'IDLE') {
		$('#main-sub-header').show();
		$('#video').hide();
	}
	//console.log('Object: ' + obj.toSource());
};

var player;

function playerReady(obj) {
	var id = obj['id'];
	var version = obj['version'];
	var client = obj['client'];
	player = document.getElementById(id);
	player.addModelListener("STATE","stateTracker");
};

//Get the promo video
function getVideo() {
	$('#video').show();
	//$('#btn_video').hide();
	$('#main-sub-header').hide();
	//playerReady('mpl');
}