//Global variables
var COPYWRITESTATEMENT = 'A.R.R. No part of this website may be reproduced in any form or by any means without prior written permission from Florida Twin Theatre Inc. and <a href="http://www.bts-i.com/" target="_blank" style="color:#FFFFFF;">BTSI</a>' ;
var ADULT_TICKET_PRICE = '$6.00' ;
var CHILD_TICKET_PRICE = '$5.00' ;
var SENIOR_TICKET_PRICE = '$5.00' ;
var MATINEE_TICKET_PRICE = '$5.00' ;
var NUMBEROFNAVLINKS = 8 ;
var NavLinkHoverBackgroundColor = '#77BBFF' ;
var OnOff = 0 ;
var NEWS_MESSAGE_ON = 0 ; // 1 = News Message On ... 0 = News Message Off
var NEWS_MESSAGE_HTML = '<div style="text-align:center;vertical-align:middle;font-size:2em;font-weight:bold;">' +
 																						'<table><tr>' + 
																						'<td><img src="../IMAGES/StrawberryFestival.gif" alt=""/></td>' +
 																						'<td style="text-align:center;vertical-align:middle;font-size:2em;font-weight:bold;">Strawberry Festival Special!<br/> All tickets only $4 each!<br/>Special price available April 22nd, 23rd, 24th only!<br/><br/><a href="javascript:RemoveNewsMessage()" style="font-size:.5em;">[ continue to showtimes ]</a></td>' +
 																						'<td><img src="../IMAGES/StrawberryFestival.gif" alt=""/></td>' +
																						'</tr></table>' +
  																					'</div>' ;
var URGENT_MESSAGE_ON = 0 ; // 1 = Urgent Message On ... 0 = Urgent Message Off
var URGENT_MESSAGE_HTML = '<table style="width:100%;height:100%;text-align:center;vertical-align:middle;"><tr>' +
			  '<td style="font-weight:bold;font-size:2em;">' +
  			  'Florida Twin Theatre will be<br />' + 
			  'CLOSED<br />' +
	 		  'April 18 through April 24<br />' +
	 		  'for maintenance.<br /><br />' +
	 		  '<span style="font-size:.8em;">Movie listings for April 25 and forward will be available on Tuesday April 22.</span><br/>' +
	 		  'Please check back with us then!' +
	 		  '</td>' +
			  '</tr></table>' ;

// W3C Images
var W3C_XHTML_A = new Image ;
var W3C_XHTML_B = new Image ;
var W3C_CSS_A = new Image ;
var W3C_CSS_B = new Image ;
W3C_XHTML_A.src = "../IMAGES/w3c_XHTML1.0_A.gif" ;
W3C_XHTML_B.src = "../IMAGES/w3c_XHTML1.0_B.gif" ;
W3C_CSS_A.src = "../IMAGES/w3c_CSS_A.gif" ;
W3C_CSS_B.src = "../IMAGES/w3c_CSS_B.gif" ;
function chgW3Cimg(imgName,newImg) {
 document.getElementById(imgName).src = eval(newImg + '.src') ;
}

//Links to be randomized
var Links = new Array() ;
Links[0] = '<a href="http://www.filmratings.com/" target="_blank"><img src="http://www.floridatwintheatre.com/IMAGES/links_filmratings.gif"/></a>' ;
Links[1] = '<a href="http://www.cocacola.com/" target="_blank"><img src="http://www.floridatwintheatre.com/IMAGES/links_cocacola.gif"/></a>' ;
Links[2] = '<a href="http://www.floridatwintheatre.com/OurHistory/" style="color:#0000FF;"><img src="http://www.floridatwintheatre.com/IMAGES/links_ourhistory.gif"/></a>' ;
Links[3] = '<a href="http://www.floridatwintheatre.com/ComingAttractions/" style="color:#0000FF;">' +
									'<img src="http://www.floridatwintheatre.com/IMAGES/CA_Movie1.jpg" height="40" width="27"/><img src="http://www.floridatwintheatre.com/IMAGES/CA_Movie2.jpg" height="40" width="27"/><br/>Coming Soon' + 
									'</a>' ;
Links[4] = '<a href="http://www.floridatwintheatre.com/StartingNextWeek/" style="color:#0000FF;">' +
							  '<img src="http://www.floridatwintheatre.com/IMAGES/NW_Movie1.jpg" height="40" width="27"/><img src="http://www.floridatwintheatre.com/IMAGES/NW_Movie2.jpg" height="40" width="27"/><br/>Next Week' +
									'</a>' ;
Links[5] = '<a href="http://www.imdb.com/" target="_blank"><img src="http://www.floridatwintheatre.com/IMAGES/links_IMDB.gif"/></a>' ;
var RandomLinks = new Array(Links.length) ;


function PageLoader(PageName){
 document.getElementById('PageWidthKeeper').width = 600
 document.getElementById('PageWidthKeeper').height = 0
 document.getElementById('NavWidthKeeper').width = 130
 document.getElementById('NavWidthKeeper').height = 0
 document.getElementById('Footer').innerHTML = document.getElementById('Footer').innerHTML + COPYWRITESTATEMENT ;
 document.getElementById('TicketPrices').innerHTML = '	Admission Prices:<br/> ' +
					' Adults - ' + ADULT_TICKET_PRICE + '<br/>' +
					' Children - ' + CHILD_TICKET_PRICE + '<br/>' +
					' Seniors - ' + SENIOR_TICKET_PRICE + '<br/>' +
					' Matinee - ' + MATINEE_TICKET_PRICE + '<br />' +
					' <br/><span style="font-weight:bold;">Sorry, but we do NOT accept credit or debit cards at this time.</span>' ;

 switch(PageName){
	case 'Home Page':
   for(x = 1 ; x <= NumberOfMovies ; x++){
	  AlternateColors(document.getElementById('CurrentFeatureRow' + x),'transparent','#EEEECC');
	 }
	 break;
	case 'Now Showing':
   for(x = 1 ; x <= NumberOfMovies ; x++){
	  for(y = 1 ; y <= 7 ; y++){
	   AlternateColors(document.getElementById('ShowtimeRow' + x + y),'#EFEFEF','#FDFDFD');
    }
	 }
	 break;
	case 'Starting Next Week':
   for(x = 1 ; x <= NumberOfMovies ; x++){
	  for(y = 1 ; y <= 7 ; y++){
	   AlternateColors(document.getElementById('ShowtimeRow' + x + y),'#EFEFEF','#FDFDFD');
    }
	 }
	 break;
 }
 AssignNavLinks() ;
 RandomizeLinks() ; 
}


function AssignNavLinks(){
 var NavLinkX,NewLinkText ;
 for(x = 1 ; x <= NUMBEROFNAVLINKS ; x++){
  NavLinkX = document.getElementById('NavLink' + x) ;
  NewLinkText = NavLinkX.innerHTML.replace(/ /g,'') ;
  NavLinkX.href = NavLinkX.href.replace(/AddLinkHere/, NewLinkText) ;
 }
}


function AlternateColors(DocObj,FirstColor,SecondColor){ 
 if(OnOff == 0){
	DocObj.style.backgroundColor = FirstColor ;
 	OnOff = 1 ;
 }
 else{
	DocObj.style.backgroundColor = SecondColor ;
	OnOff = 0 ;   
 }
}


function GenRndNum(LowestNumber,HighestNumber){
 var Difference ;
 if(LowestNumber >= HighestNumber){
	return "ERROR: LowestNumber must be less than the HighestNumber!" ;
 }
 else{
	Difference = HighestNumber - LowestNumber ;
  return LowestNumber + Math.round(Math.random()*Difference) ;
 }
}


function RandomizeLinks(){
 var x,y,z ;
 y = 0 ;
 
 while(z != 1){ //Loop is not exited by 'while' conditional statement, it exits via the 'break;' statement below
  x = GenRndNum(0,Links.length - 1)
	if(RandomLinks[x] === undefined){
	 RandomLinks[x] = Links[y] ;
	 y = y + 1 ;
	} 
	if(y < Links.length){}
	else{break;}
 }  
	
 for(counter = 0 ; counter < 6 ; counter++){ //this loop populates the 'BottomLink#' cells with the randomized links
	document.getElementById('BottomLink' + counter).innerHTML = RandomLinks[counter]
 }
}


function HideContent(){
 document.getElementById('DisplayDIV').style.visibility = "hidden" ;
 document.getElementById('DisplayDIV').innerHTML = null ;
}

function LoadContent(LinkText){
 var DivObj = document.getElementById('DisplayDIV') ;
 var CloseButton = '<a href="javascript:HideContent()" style="text-decoration:none;">[x] close</a><br/>' ;
 DivObj.style.width = null ;
 switch(LinkText){
  case '1943pic':
	 DivObj.style.width = "565px" ;
	 DivObj.innerHTML = CloseButton + '<img src="../IMAGES/OH_theatre1943.jpg" alt=""/>' ;
	 break;
  case '2003pic':
	 DivObj.style.width = "565px" ;
	 DivObj.innerHTML = CloseButton + '<img src="../IMAGES/OH_theatre2003.jpg" alt=""/>' ;
	 break;
  case 'A Yank in the R.A.F.':
	 DivObj.style.width = "300px" ;
	 DivObj.innerHTML = CloseButton + 
																						  "<center><img src='../IMAGES/OH_AYankInTheRAF.jpg'/><br/>" +
																								"<b>A Yank in the R.A.F. (1941)</b></center><br/>" +
																								"Tyrone Power is a pilots' pilot, but he doesn't believe " + 
																								"in anything beyond his own abilities. He gets into " +
																								"trouble by flying a new fighter directly to Canada " +
																								"instead of to New York and letting it be towed across " +
																								"as the law demands, but is offered a new job ferrying " +
																								"bombers to war torn England. While on a layover he " +
																								"finds Betty Grable, an old flame, has joined the RAF " +
																								"as a WREN in her attempt to fight for democracy. Power " +
																								"joins up to impress her and in the course of his several " +
																								"missions begins to develope an understanding of what " +
																								"they are fighting for." ;
	 break;
  case 'Ringside Maisie':
	 DivObj.style.width = "300px" ;
	 DivObj.innerHTML = CloseButton + 
	 																					  '<center><img src="../IMAGES/OH_RingsideMaisie.jpg"/><br/>' +
																								'<b>Ringside Maisie (1941)</b></center><br/>' +
																								'Young undefeated boxer Terry Dolan, who has been lying ' +
																								'to his invalid mother about his career, confides to ' +
																								'Maisie that he hates and is terrified by boxing and ' +
																								'wants out. Not wanting to let	down his best friend ' +
																								'and manager Skeets Maguire, who has hopes of him becoming ' +
																								'the next champion, he is reluctant to bring up the ' +
																								'subject with him. Maisie convinces Terry to tell Skeets, ' +
																								'whose unexpected reaction induces him to step into the ring again.' ;
	 break;
  case 'this one':
	 DivObj.style.width = "490px" ;
	 DivObj.innerHTML = CloseButton + 
	 																					  '<table border="0" width="0">' +
																								' <tr>' +
																								'	<td><center><img src="../IMAGES/OH_articleJan1999pic1.jpg" width="480" height="352"/></center></td>' +
																								' </tr>' +
																								' <tr>' +
																								'	<td style="font-weight:bold;font-size:28pt;">Hometown favorite</td>' +
																								' </tr>' +
																								' <tr>' +
																								'	<td style="font-weight:bold;font-size:14pt;">Florida Twin keeps the movies rolling</td>' +
																								' </tr>' +
																								' <tr>' +
																								'	<td>' +
																								'	<table border="0" width="0">' +
																								'	 <tr>' +
																								'		<td rowspan="2" width="240" valign="top">' +
																								'		<p style="font-weight:bold;border-style:solid;border-color:#00000;border-width:0px;border-top-width:1px;border-bottom-width:1px;">By Lise Fisher</p>' +
																								'	<div class="Paragraph">Cars forever drive by Starke' + "'" + 's Florida Twin Theatre in an old black and white photo ' +
																								'	hanging inside the movie house lobby.</div>' +
																								'	<div class="Paragraph">That scene isn' + "'" + 't much different now, more than 50 years after the theatre started ' +
																								'	showing films in the building, located at Call and Walnut streets, and despite ' +
																								'	competition from multiscreen theatres in Gainesville and Orange Park.</div>' +
																								'	<div class="Paragraph">Headlights still shine through the theatre' + "'" + 's front doors as kids desert parents ' +
																								'	and file in with their giggling friends. Adults belly up to the concession stand for ' +
																								'	popcorn and soda, eyeing nachos, M&M' + "'" + 's and Slim Jims.</div>' +
																								'	<div class="Paragraph">And, as it' + "'" + 's been since the early 1960' + "'" + 's, someone from the Barksdale family is running ' +
																								'	the business.</div>' +
																								'	<div class="Paragraph">Vicki and Lee Sparks, the daughter and son-in-law of former owner Robert C. Barksdale, ' +
																								'	manage the two screen movie house. Often, Lee Sparks is the one behind the glass window ' +
																								'	selling tickets. Filling in for an employee, Vicki Sparks shovels popcorn and chats with ' +				
																								'	the small crowd gathering for the nights showing of "Patch Adams" and "Stepmom."</div>' +
																								'	<div class="Paragraph">When they purchased the theatre from Barksdale in 1984, the two remodeled ' +
																								'	the place. They added stereo surround-sound and a second upstairs screen that boasts cushy stadium ' +
																								'	seating long before it became the in-thing in mall multiplexes.</div>' +
																								'	<div class="Paragraph">The two take care of everything - from stocking concessions to booking first-run ' +
																								'	films.</div>' +
																								'	<div class="Paragraph">"You aren' + "'" + 't going to get rich by no means," Lee Sparks said about his job.</div>' +
																								'	<div class="Paragraph">But Sparks guesses the theatre business is in his blood, a condition that started ' +
																								'	when he used to meet the teen-age Vicki at her father' + "'" + 's theatre.</div>' +
																								'	<div class="Paragraph">Sparks operated a United Artists theatre in Orlando for about five years, then returned ' +
																								'	to Starke.</div>' +
																								'	<div class="Paragraph">"I guess the one thing I like about this is the freedom of choice without having to go ' +
																								'	through 30 people to do it," Sparks said, comparing his Orlando experience with managing ' +
																								'	his theatre.</div>' +
																								'	<div class="Paragraph">Sparks says his business' + "'" + ' survival is based on a simple premise.</div> ' +
																								'	<div class="Paragraph">"I just think they are trying to glamorize theatres too much, almost turn them into a ' +
																								'	mini-mall," he said. "They' + "'" + 've gone too far to the extreme in building some of the stuff."</div>' +
																								'  </td>' +
																								'	<td colspan="2" valign="top"><img src="../IMAGES/OH_articleJan1999pic2.jpg"/></td>' +
																								'	<tr>' +
																								'	<td width="240" valign="top">' +
																								'	<div class="Paragraph">"I think you can go in and offer a good movie at a good price. People would rather ' +
																								'	come in and sit down, have good sound and a clean theatre, rather than all the neon ' +
																								'	lights."</div>' +
																								'	<div class="Paragraph">Offering a good movie means Sparks needs to know his audience. So, while he' + "'" + 's shown ' +
																								'	his share of R-rated flicks, many of the theatre' + "'" + 's films are family movies.</div>' +
																								'	<div class="Paragraph">"I always try to keep something here for the kids," since this is one of the few ' +
																								'	places for them in Starke, Sparks said.</div>' +
																								'	<div class="Paragraph">But that doesn' + "'" + 't mean the theatre hasn' + "'" + 't featured some of Hollywood' + "'" + 's hottest movies. ' +
																								'	"Jaws" and "Jurassic Park" came. This year' + "'" + 's showings will include what' + "'" + 's predicted to ' +
																								'	be 1999' + "'" + 's biggest film, "Star Wars: The Phantom Menace."</div>' +
																								'	<div class="Paragraph">Sparks' + "'" + ' patrons admit to enjoying a night out at larger theatres. They agree, however, ' +
																								'	that the Florida Twin holds its own.</div>' +
																								'	<div class="Paragraph">"I come every week," unless the theatre' + "'" + 's showing the same movies, said 12-year-old ' +
																								'	Tiffany Rowe of Starke. It doesn' + "'" + 't really matter if it' + "'" + 's not like larger theatres she ' +
																								'	said. "A lot of my friends hang out here."</div>' +
																								'	<div class="Paragraph">"Mostly it' + "'" + 's because of the people who own it," said Kimberly Woodell of Keystone ' +
																								'	Heights. Woodell and Valerie Jones of Starke, enjoying a girls' + "'" + ' night out, said people ' +
																								'	keep coming because of what the Sparkses do for the community. They offer summer programs ' +
																								'	for children at the theatre and help area schools, they said.</div>' +
																								'	<div class="Paragraph">It' + "'" + 's closer and cheaper, said Beverly Durrance of Starke, who has been coming to the ' +
																								'	theatre for years.</div>' +
																								'	<div class="Paragraph">"It' + "'" + 's more of the hometown thing."</div>' +
																								'		</td>' +
																								'	 </tr>' +
																								'	</table>' +
																								'	</td>' +
																								' </tr>' +
																								'</table>' ;
   break;
 }
 DivObj.style.top = "125px" ;
 DivObj.style.left = "155px" ;
 DivObj.style.visibility = "visible" ;
}


function DisplayNewsMessage(){
 var NM = document.getElementById("MessageDIV");
 var MC = document.getElementById("MainContent");
 NM.style.width = MC.offsetWidth ;
 NM.style.height = MC.offsetHeight ;
 NM.style.visibility = "visible" ;
 NM.innerHTML = NEWS_MESSAGE_HTML ;
}


function RemoveNewsMessage(){
 document.getElementById("MessageDIV").style.visibility = "hidden" ;
}


function DisplayUrgentMessage(){
 var UM = document.getElementById("MessageDIV");
 var MC = document.getElementById("MainContent");
 UM.style.width = MC.offsetWidth + 'px';
 UM.style.height = MC.offsetHeight + 'px' ;
 UM.style.visibility = "visible" ;
 UM.innerHTML = URGENT_MESSAGE_HTML ;
}

