
/* Optional: Temporarily hide the "tabber" class so it does not "flash"
   on the page as plain HTML. After tabber runs, the class is changed
   to "tabberlive" and it will appear. */
//document.write('<style type="text/css">.tabber{display:none;}<\/style>');

/* vertically center the arrow for selected show */
window.addEvent("domready", function(){
	var selshowheight = $('showlistsel').offsetHeight;
	var arwpos = parseInt((selshowheight/2) - (13/2)); //vertically center the arrow
	$('arwshowsel').setStyle('top', arwpos);
	
	if ($ES('.showlistitem').length > 0) {
		$ES('.showlistitem')[0].addClass("itemsel");
		$E(".itemarwsel").injectInside($ES('.showlistitem')[0]);
	}
	
	writeplayer(); 
	
	
});

/*
window.addEvent("load", function(){
	var head = document.getElementsByTagName('head')[0];
	script = document.createElement('script');
	script.id = 'dynamicScriptTag';
	script.type = 'text/javascript';
	script.src = '/js/video_tutorials.js';//would include custom functions for the tutorials
	head.appendChild(script)	
	
});
*/


var positionArrow = function () {
	var selshowheight = $('showlistsel').offsetHeight;
	var arwpos = parseInt((selshowheight/2) - (13/2)); //vertically center the arrow
	$('arwshowsel').setStyle('top', arwpos);	
}

//Don't let the tabber tabify our inline source
//var initTabs = function () {
//    var origParent = $('overlaywrap').parentNode;
//    var original = $('overlaywrap').remove();	
//    tabberAutomatic();
//    original.inject(origParent);
//};

var tabberOptions = { manualStartup: true };
//window.addEvent('domready', initTabs);

//Tabify on showWindow overlay
var smoothbox_TB_showWindow = TB_showWindow;
TB_showWindow = function () {
	//initTabs();
    smoothbox_TB_showWindow();	
}

function moveDown(swit) {
		var theScr = window.getScrollTop();
		var dist;
		// #s 190 and 180 need to change when masthead is added to page
		
		if (theScr > 340) {
			$E('#div_showitemdetailswrap').setStyle('padding-top', (theScr - 280));
		} else {
			$E('#div_showitemdetailswrap').setStyle('padding-top', 0);
		}

		newItem = ($ES('.showlistitem'))[swit-1];
		
		// set highlight
		$E(".itemsel").removeClass("itemsel");
		newItem.addClass("itemsel");
		$E(".itemarwsel").injectInside(newItem);
		
		writeplayer();
		
		initTabs();
}
