//-----------------------------------------------------------------------------------------
//Virginia Samford Theater
//  created by Dave Coleman 10/25/2007
//	of Bottlecap Development, Inc.
//
//	this page customized the Scriptaculous Javascript Effects Library for fade effects
//-----------------------------------------------------------------------------------------
	
	var ucArrayLocation = 1;

function loadShows() {
	new Effect.Opacity('box4', {duration:0, to:0, afterFinish:loadNewUpcoming});	
	//use the next line if we need to add fade effect to now playing.  however, this would requite removing the table and reformatting
	//new Effect.Opacity('box1', {duration:0, to:0, afterFinish:loadNowPlaying});		

	//instead:
	loadNowPlaying();

	if (!window.XMLHttpRequest) 
			fixTransparency();	//this calls pngfix2.js if browser is under IE 7	
}

function loadNowPlaying() {

	locationNP = 0;
	$vendini_code ="<!--\n\WARNING!!! DO NOT MODIFY THIS CODE: Modification of this code may disable your account.\n\START OF VENDINI TAG\nCopyright (C) 2009 Vendini, Inc.\nAll Rights Reserved.\n\TROUBLESHOOTING: The HTML code below is one continuous line.  Line breaks in the code below may cause problems launching the window.\n-->\n\n<a href=\"https://www.vendini.com/ticket-software.html?j=ee9335553d3542bf5ec22ac0b1b84368&t=join\" onclick=\"window.open('https://www.vendini.com/ticket-software.html?j=ee9335553d3542bf5ec22ac0b1b84368&t=join', 'order_window', 'scrollbars,width=606,height=510,status=yes,left='+((window.screen.width - 606)/2)+',top='+((window.screen.height - 510)/2.5)).focus();return false;\" onMouseOver=\"window.status='Join Now!';return true;\"     onMouseOut=\"window.status='';return true;\"><img src=\"http://www.vendini.com/images/buttons/join-our-mailing-list.png\" width=\"148\" height=\"22\" border=\"0\"></a>\n<!-- END OF VENDINI TAG -->\n";
	
	
	
  $("upcomingAreaTitleNP").innerHTML = $vendini_code;
	$("upcomingStageNP").innerHTML = "";
	$("upcomingTitleNP").innerHTML = "<a href='moreinfo.php?event_id="+ucIDs[locationNP]+"'>"+ucTitles[locationNP]+"</a>";
	$("upcomingSubtitleNP").innerHTML = "<a href='moreinfo.php?event_id="+ucIDs[locationNP]+"'>"+ucSubtitles[locationNP]+"</a>";
	$("upcomingDateNP").innerHTML = "<b>"+ucDates[locationNP]+"</b>";
	$("upcomingShowTimeNP").innerHTML = ucShowTime[locationNP];

	if(ucVideos[locationNP] != '')
	  $("upcomingVideoNP").innerHTML = "<a href='moreinfo.php?event_id="+ucIDs[locationNP]+"#video'>Click here to watch a preview!</a>";		
    //$("upcomingVideoNP").innerHTML =  "<a href='"+ucVideos[locationNP]+"' target='_blank'>Click here to watch a preview!</a>";
	else
		
		$("upcomingVideoNP").innerHTML =  '';
	
	if(ucLinks[locationNP] != '')
		$("upcomingGetTicketsNP").innerHTML =  "<a href='"+ucLinks[locationNP]+"' target='_blank'>Get Tickets</a>";
	else
		
		$("upcomingGetTicketsNP").innerHTML =  '<a href="http://www.vendini.com/service/tickets/noJavaScript.html" onclick="window.open(\'https://www.vendini.com/service/tickets/index.html?m=3157106b811d433f1f4ecb26500afe94\', \'order_window\', \'scrollbars,width=596,height=485,status=yes,left=\'+((window.screen.width - 596)/2)+\',top=\'+((window.screen.height - 460) /2.5)).focus();return false;" onmouseover="window.status=\'Buy Tickets Now!\';return true;" onmouseout="window.status=\'\';return true;" style="z-index:1000;">Get Tickets</a>';
		//$("upcomingGetTicketsNP").innerHTML =  "<a href='boxoffice.php?event_id="+ucIDs[locationNP]+"'>Get Tickets</a>";
	
	//$("upcomingGetTicketsNP").innerHTML =  "<img src='images/tix.png' align='absmiddle' /><a href='boxoffice.php?event_id="+ucIDs[locationNP]+"'>Get Tickets</a>";
	$("upcomingImageNP").innerHTML = "<img src='images/largethumb/"+ucImages[locationNP]+"' class='marquee' width='160' />";
	if(ucImages[locationNP]=='default.gif')
		document.getElementById('npTable').width='';
	else
		document.getElementById('npTable').width='75%';
	new Effect.Appear('box1', {duration: 2});
}

function loadNewUpcoming() {
	
	if(ucArrayLocation >= ucTitles.length) ucArrayLocation = 1;

  $("upcomingAreaTitle").innerHTML = "";
	$("upcomingTitle").innerHTML = "<a href='moreinfo.php?event_id="+ucIDs[ucArrayLocation]+"'>"+ucTitles[ucArrayLocation]+"<br /><small>"+ucSubtitles[ucArrayLocation]+"</small></a>";
	$("upcomingDate").innerHTML = ucDates[ucArrayLocation];
	
	if(ucLinks[ucArrayLocation] != '')
		$("upcomingGetTickets").innerHTML =  "<a href='"+ucLinks[ucArrayLocation]+"' target='_blank'>Get Tickets</a>";
	else
		$("upcomingGetTickets").innerHTML =  '<a href="http://www.vendini.com/service/tickets/noJavaScript.html" onclick="window.open(\'https://www.vendini.com/service/tickets/index.html?m=3157106b811d433f1f4ecb26500afe94\', \'order_window\', \'scrollbars,width=596,height=485,status=yes,left=\'+((window.screen.width - 596)/2)+\',top=\'+((window.screen.height - 460) /2.5)).focus();return false;" onmouseover="window.status=\'Buy Tickets Now!\';return true;" onmouseout="window.status=\'\';return true;" style="z-index:1000;">Get Tickets</a>';
		//$("upcomingGetTickets").innerHTML =  "<a href='boxoffice.php?event_id="+ucIDs[ucArrayLocation]+"'>Get Tickets</a>";
	
	$("upcomingImage").innerHTML = "<img src='images/fullthumb/"+ucImages[ucArrayLocation]+"' width='77' height='95' />";	
	ucArrayLocation = ucArrayLocation + 1;
	
	new Effect.Appear('box4', {duration: 2, afterFinish: startTimer});	
}

function startTimer() {
	timer1 = setTimeout("NextSlide()",4500);	
}

function NextSlide() {
	new Effect.Fade('box4', {duration: 2, afterFinish: loadNewUpcoming});	
}
