jQuery.films = {
	overlayapi : null,
	goodthru : "( Mar 5 - Mar 11 )",
	films : [
		{
			id : 1,
			active : true,
			title : "Crazy Heart",
			rating : "R",
			poster : "crazy.jpg",
			runtime : "1 hr 52 min",
			auditorium : "Upstairs Auditorium",
			starring : "Jeff Bridges, Colin Farrell, Maggie Gyllenhaal, Robert Duvall",
			director : "Scott Cooper",
			synopsis : "<p>Four-time Academy Award nominee JEFF BRIDGES stars as the richly comic, semi-tragic romantic anti-hero Bad Blake in the debut feature film CRAZY HEART from writer-director Scott Cooper. Bad Blake is a broken-down, hard-living country music singer who's had way too many marriages, far too many years on the road and one too many drinks way too many times. And yet, Bad can't help but reach for salvation with the help of Jean (Golden Globe nominee MAGGIE GYLLENHAAL), a journalist who discovers the real man behind the musician. As he struggles down the road of redemption, Bad learns the hard way just how tough life can be on one man's crazy heart.</p>",
			trailer : '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/Y0349E7kFEM&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Y0349E7kFEM&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>',
			trailerLink : "http://www.youtube.com/watch?v=Y0349E7kFEM",
			rtlink : 'http://www.rottentomatoes.com/m/crazy_heart/',
			daily : '1:00 | 4:00 | 7:00* (Daily)',
			lateShows : true,
			late : '9:30 (Fri & Sat)',
			alert : true,
			alertBody : "No 7:00 show Thurs., Mar. 11<sup>th</sup>"
		},
		{
			id : 2,
			active : true,
			title : "The Last Station",
			rating : "R",
			poster : "station.jpg",
			runtime : "1 hr 52 min",
			auditorium : "Downstairs Auditorium",
			starring : "Helen Mirren, James McAvoy, Paul Giamatti, Christopher Plummer",
			director : "Michael Hoffman",
			synopsis : "<p>Fact and fiction converge in this talent-driven drama based on Jay Parini's novel about Leo Tolstoy. THE LAST STATION focuses on the marriage between Tolstoy (Christopher Plummer) and his wife Sofya (Helen Mirren) in its final years. James McAvoy stars as a young man who works for the couple, while Paul Giamatti plays an advisor to the writer who fights his wife over financial issues.</p>",
			trailer : '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/bTh-vQho7UU&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bTh-vQho7UU&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>',
			trailerLink : "http://www.youtube.com/watch?v=bTh-vQho7UU",
			rtlink : 'http://www.rottentomatoes.com/m/last_station/',
			daily : '1:20 | 4:20 | 7:20 (Daily)',
			lateShows : true,
			late : '9:40 (Fri & Sat)',
			alert : false,
			alertBody : "No 9:20 show Fri., Jan. 29<sup>th</sup>"
		},
		{
			id : 3,
			active : false,
			title : "Bad Lieutenant: Port of Call ...",
			rating : "R",
			poster : "lieutenant.jpg",
			runtime : "2 hrs 1 min",
			auditorium : "Upstairs Auditorium",
			starring : "Nicolas Cage, Eva Mendes, Val Kilmer, Fairuza Balk",
			director : "Werner Herzog",
			synopsis : "<p>In Werner Herzog's new film \"The Bad Lieutenant: Port Of Call New Orleans,\" Nicolas Cage plays a rogue detective who is as devoted to his job as he is at scoring drugs -- while playing fast and loose with the law. He wields his badge as often as he wields his gun in order to get his way. In the aftermath of Hurricane Katrina he becomes a high-functioning addict who is a deeply intuitive, fearless detective reigning over the beautiful ruins of New Orleans with authority and abandon. Complicating his tumultuous life is the prostitute he loves (played by Eva Mendes). Together they descend into their own world marked by desire, compulsion, and conscience. The result is a singular masterpiece of filmmaking: equally sad and manically humorous.</p>",
			trailer : '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/o-GpX3TTvrE&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/o-GpX3TTvrE&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>',
			trailerLink : "http://www.youtube.com/watch?v=o-GpX3TTvrE",
			rtlink : 'http://www.rottentomatoes.com/m/bad_lieutenant_port_of_call_new_orleans/',
			daily : '7:20 (Daily)',
			lateShows : true,
			late : '9:50 (Fri & Sat)',
			alert : false,
			alertBody : "No 9:20 show Fri., Jan. 29<sup>th</sup>"
		},
		{
			id : 4,
			active : false,
			title : "American Harmony",
			rating : "Not Rated",
			poster : "harmony.jpg",
			runtime : "86 minutes",
			auditorium : "Downstairs",
			starring : "Patrick Claypool, Sean Devine, Cory Hunt, Shawn York",
			director : "Aengus James",
			synopsis : '<p>SPELLBOUND exposed the ambition at the national spelling bee, WORDPLAY revealed the struggles at crossword-puzzle championships, and now AMERICAN HARMONY chronicles the rivalries in the cutthroat world of...barbershop singing. At the International Championships of Barbershop Singing, 50 groups vie for the title, but only one quartet can sing its way to the top. Will it be OC Times, a handsome foursome? Or will the supergroup Max Q reign? Poised to spoil either team\'s chances are the green but talented Vocal Spectrum and their polar opposites, Reveille, who have been singing together for 30 years. This documentary explores a world that most have never seen, but these singers\' devotion to their craft is infectious.</p>',
			trailer : '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/bRvvCslN3w0&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/bRvvCslN3w0&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>',
			trailerLink : "http://www.youtube.com/watch?v=bRvvCslN3w0",
			rtlink : 'http://www.rottentomatoes.com/m/american_harmony/',
			daily : '1:20 (Saturday, Sept. 19)',
			lateShows : false,
			late : '7:00 (Thursday, Sept. 17)',
			alert : false,
			alertBody : ""
		}
	],
	
	loadFilmData : function() {
		$('span.goodthru').text(this.goodthru);
		$.each(this.films, function(i, film) {
			if(film.active == true)
			{
				var f = $('#film-template > div.film').clone();
				$('#films').append(f);
				$(f).attr('id', 'film-' + film.id);
				
				$(f).find('img.poster').attr('src', 'images/films/' + film.poster); // POSTER
				$(f).find('h3.film-title').html(film.title); // TITLE
				$(f).find('h3.film-rating').text(film.rating); // RATING
				$(f).find('span.stars').text(film.starring); // STARRING
				$(f).find('span.the-director').text(film.director); // DIRECTOR
				$(f).find('span.runtime').text(film.runtime); // RUNTIME
				
				// FILM INFO LINK
				$(f).find('a.film-info-btn').click(function(){
					$('#film-synop-' + film.id).fadeIn('slow');
					$(f).css('margin-bottom', '0');
					return false;
				});
				
				// RT LINK
				$(f).find('a.film-rt-link').attr('href', film.rtlink);
				
				// TRAILER
				//$(f).find('a.film-trailer-btn').attr('id', 'trailer-' + i);
				$(f).find('a.film-trailer-btn').click(function() {
					$('#vid-targ').html(film.trailer);
					$.films.overlayapi.load();
					return false;
				});
				
				// Showtimes
				$(f).find('div.daily').text(film.daily);
				if(film.lateShows == true)
				{
					$(f).find('div.late').text(film.late);
				}
				else
				{
					$(f).find('div.late').hide();
				}
				$(f).find('div.auditorium').text(film.auditorium);
				if(film.alert == true)
				{
					$(f).find('div.alert').html(film.alertBody);
				}
				else
				{
					$(f).find('div.alert').hide();
				}
				
				// Synopsis
				var s = $('#film-template > div.film-synopsis').clone();
				$('#films').append(s);
				$(s).attr('id', 'film-synop-' + film.id);
				$(s).prepend(film.synopsis);
				$(s).find('a.close-btn').click(function() {
					$(this).parent().parent().fadeOut('slow', function() {
						$(f).css('margin-bottom','15px');
					});
					
					return false;
				});
			}
		});
	},
	
	loadiPhone : function() {
		$('span.goodthru').text(this.goodthru);
		$.each(this.films, function(i, film) {
			if(film.active == true)
			{
				var f = $('#iphone-film-template > div.film').clone();
				$('#films').append(f);
				$(f).attr('id', 'film-' + film.id);				
				
				$(f).find('img.poster').attr('src', "images/films/" + film.poster);
				$(f).find('h2.film-title').text(film.title);
				$(f).find('p.daily').text(film.daily);
				if(film.lateShows == true)
				{
					$(f).find('p.late').text(film.late);
				}
				else
				{
					$(f).find('p.late').hide();
				}
				$(f).find('p.auditorium').text(film.auditorium);
				if(film.alert == true)
				{
					$(f).find('p.alert').html(film.alertBody);
				}
				else
				{	
					$(f).find('p.alert').hide();
				}
				
				$(f).find('a.info-btn').attr('id', 'info-' + film.id);
				$(f).find('a#info-' + film.id).click(function() {
					$("#filminfo-" + film.id).fadeIn('slow');
					return false;
				});
				
				var s = $('#iphone-film-template > div.film-synop').clone();
				$('#films').append(s);
				$(s).attr('id', 'filminfo-' + film.id);
				
				$(s).find('p.rating').text('Rated ' + film.rating);
				$(s).find('span.runtime').text(film.runtime);
				$(s).find('span.stars').text(film.starring);
				$(s).find('span.director').text(film.director);
				$(s).find('div.synopsis').html(film.synopsis);
				$(s).find('a.trailer-link').attr('href', film.trailerLink);
				$(s).find('a.rt-link').attr('href', film.rtlink);
				
				$(s).find('a.close-btn').click(function() {
					$(this).parent().parent().fadeOut('fast', function() {
						window.location = "#top";
					});
					return false;
				});
			}
		});
	}
}