//JAVASCRIPT FOR shows.php Version 1.2 beta

var ol_width = 275; //set the tooltip width for overlib

function getShowDetail(evt) {
	var theShowCode = this.src.split('images/')[1];
	theShowCode = theShowCode.split('_')[0];
	var d = loadJSONDoc('ajaxshow.php?show='+theShowCode);
	var gotMetaData = function(meta) {
		//build show info
		showInfoTxt = '<h3>' + meta.title + '<\/h3>' + meta.description;
		showInfoTxt = (meta.runtime) ? showInfoTxt + '<p><strong>Running time:<\/strong> ' + meta.runtime + '<\/p>' : showInfoTxt;
		return overlib(showInfoTxt, VAUTO, HAUTO);
	}
	d.addCallback(gotMetaData);
}

addLoadEvent(function () {
	document.body.onmouseout = function() {
		return nd();
	}
});

addLoadEvent(function () {
	var topShowsLinks = getElementsByTagAndClassName('img',null,$('Moreshows'));
	for (i=0; i<topShowsLinks.length; i++) {
		topShowsLinks[i].onmouseover = getShowDetail;
		topShowsLinks[i].onmouseout = function() {
			return nd();
		}
	}
});
