jQuery.films = {
	overlayapi : null,
	goodthru : "( Now - February 9 )",
	films : [
		
		{
			id : 1,
			active : true,
			title : "The Artist",
			rating : "PG-13",
			poster : "artist.jpg",
			runtime : "100 min",
			auditorium : "Downstairs Auditorium",
			starring : "Jean Dujardin, John Goodman, Penelope Ann Miller",
			director : "Michel Hazanavicius",
			synopsis : "Hollywood 1927. George Valentin (Jean Dujardin) is a silent movie superstar. The advent of the talkies will sound the death knell for his career and see him fall into oblivion. For young extra Peppy Miller (Berenice Bejo), it seems the sky's the limit - major movie stardom awaits. The Artist tells the story of their interlinked destinies.",
			trailer : '<iframe width="560" height="315" src="http://www.youtube.com/embed/PNpW93Wd8IQ" frameborder="0" allowfullscreen></iframe>',
			trailerLink : "http://www.youtube.com/watch?v=PNpW93Wd8IQ",
			rtlink : 'http://www.rottentomatoes.com/m/the_artist/',
			daily1 : '1:00 | 4:00 | 7:00 <span style="font-size:11px">(Daily)</span>',
		 	daily2 : '1:00 | 4:00 <span style="font-size:11px">(Mar. 13)</span>',
			lateShows :true,
			late : '9:20 <span style="font-size:11px">(Fri &amp Sat)</span>',
			alert : false,
			alertBody : "Ends Thursday Jan. 5"
		},
		{
			id : 2,
			active : true,
			title : "A Dangerous Method",
			rating : "R",
			poster : "dangerous.jpg",
			runtime : "93 min",
			auditorium : "Upstairs Auditorium",
			starring : "Keira Knightley, Viggo Mortensen, Michael Fassbender",
			director : "David Cronenberg",
			synopsis : "Seduced by the challenge of an impossible case, the driven Dr. Carl Jung (Michael Fassbender) takes the unbalanced yet beautiful Sabina Spielrein (Keira Knightley) as his patient in A Dangerous Method. Jung's weapon is the method of his master, the renowned Sigmund Freud (Viggo Mortensen). Both men fall under Sabina's spell.ung daughters while Matt wrestles with a decision to sell the family's land handed down from Hawaiian royalty and missionaries.",
			trailer : '<iframe width="560" height="315" src="http://www.youtube.com/embed/664eq7BXQcM" frameborder="0" allowfullscreen></iframe>',
			trailerLink : "http://www.youtube.com/watch?v=664eq7BXQcM",
			rtlink : 'http://www.rottentomatoes.com/m/a_dangerous_method/',
			daily1 : '1:20 | 4:20 | 7:20 <span style="font-size:11px">(Daily)</span>',
		 	daily2 : '1:00 | 4:00 <span style="font-size:11px">(Mar. 13)</span>',
			lateShows :true,
			late : '9:30 <span style="font-size:11px">(Fri &amp Sat)</span>',
			alert : false,
			alertBody : "Ends Thursday Jan. 5"
		},
		{
			
				id : 3,
				active : false,
				title : "The Way",
				rating : "PG-13",
				poster : "way.jpg",
				runtime : "115 min",
				auditorium : "Upstairs Auditorium",
				starring : "Martin Sheen, Emilio Estevez",
				director : "Emilio Estevez",
				synopsis : "The Way is a powerful and inspirational story about family, friends, and the challenges we face while navigating this ever changing and complicated world. Martin Sheen plays Tom, an irascible American doctor who comes to St. Jean Pied de Port, France to collect the remains of his adult son (played by Emilio Estevez), killed in the Pyrenees in a storm while walking The Camino de Santiago, falso known as The Way of Saint James. Rather than return home, Tom decides embark on the historical pilgrimage to honor his son's desire to finish the journey. What Tom doesn't plan on, is the profound impact the journey will have on him and his 'California Bubble Life'. Inexperienced as a trekker, Tom soon discovers that he will not be alone on this journey.",
				trailer : '<iframe width="560" height="315" src="http://www.youtube.com/embed/0hy54CpKeqk" frameborder="0" allowfullscreen></iframe>',
				trailerLink : "http://www.youtube.com/watch?v=0hy54CpKeqk",
				rtlink : 'http://www.rottentomatoes.com/m/the_way_2011/',
				daily1 : '1:20 | 4:20 <span style="font-size:11px">(Daily)</span>',
					daily2 : '1:00 | 4:00 <span style="font-size:11px">(Mar. 13)</span>',
				lateShows : false,
				late : '9:45 <span style="font-size:11px">(Fri &amp; Sat)</span>',
				alert : false,
				alertBody : "*4:20 Fri. 25th Thru Thur 1st.."
			},
		{
			id : 1,
			active : false,
			title : "The Whistleblower",
			rating : "R",
			poster : "whistle.jpg",
			runtime : "118 min",
			auditorium : "Upstairs Auditorium",
			starring : "Rachel Weisz, Vanessa Redgrave, David Strathairn",
			director : "Larysa Kondracki",
			synopsis : "Inspired by actual events, Kathy (Academy Award(R) winner Rachel Weisz) is an American police officer who takes a job working as a peacekeeper in post-war Bosnia. Her expectations of helping to rebuild a devastated country are dashed when she uncovers a dangerous reality of corruption, cover-up and intrigue amid a world of private contractors and multinational diplomatic doubletalk. Directed by first time filmmaker Larysa Kondracki, the film also stars Academy Award winner Vanessa Redgrave, Monica Bellucci and Academy Award nominee David Strathairn.",
			trailer : '<iframe width="560" height="315" src="http://www.youtube.com/embed/al3anBiHwmI" frameborder="0" allowfullscreen></iframe>',
			trailerLink : "http://www.youtube.com/watch?v=al3anBiHwmI",
			rtlink : 'http://www.rottentomatoes.com/m/the_whistleblower/',
			daily1 : '1:20 | 7:20 <span style="font-size:11px">(Daily)</span>',
				daily2 : '1:00 | 4:00 <span style="font-size:11px">(Mar. 13)</span>',
			lateShows : false,
			late : '9:30 <span style="font-size:11px">(Fri &amp; Sat)</span>',
			alert : false,
			alertBody : "*No 7:00 Thurs. 29th."
		},
	 	{
	 		id : 3,
	 		active : false,
	 		title : "Potiche",
	 		rating : "R",
	 		poster : "potiche.jpg",
	 		runtime : "103 min",
	 		auditorium : "Upstairs Auditorium",
	 		starring : "Catherine Deneuve, Gerard Depardieu",
	 		director : "Francois Ozon",
	 		synopsis : "Set in 1977 in a provincial French town, POTICHE is a free adaptation of the 1970s eponymous hit comic play. Catherine Deneuve is Suzanne Pujol, a submissive, housebound 'trophy housewife' (or potiche,) who steps in to manage the umbrella factory run by her wealthy and tyrannical husband (Fabrice Luchini) after the workers go on strike and take him hostage. To everyone's surprise, Suzanne proves herself a competent and assertive woman of action. But when her husband returns from a restful cruise in top form, things get complicated. Gérard Depardieu plays a former union leader and Suzanne's ex-beau who still holds a flame for her. Acclaimed writer-director Francois Ozon (Swimming Pool, Under the Sand, Time to Leave,) who had previously directed Ms. Deneuve in the international hit 8 Women, twists the original play on its head to create his own satirical and hilarious take on the war between the sexes and classes. ",
	 		trailer : '<iframe width="640" height="390" src="http://www.youtube.com/embed/AHW_5cgYew0" frameborder="0" allowfullscreen></iframe>',
	 		trailerLink : "http://www.youtube.com/watch?v=AHW_5cgYew0",
	 		rtlink : 'http://www.rottentomatoes.com/m/potiche/',
	 		daily1 : '1:20 | 4:20   <span style="font-size:11px">(Daily)</span>',
	 		hasDaily2 : false,
	 		daily2 : '1:00 | 4:00 <span style="font-size:11px">(Mar. 13)</span>',
	 		lateShows : false,
	 		late : '9:40 <span style="font-size:11px">(Fri &amp; Sat)</span>',
	 		alert : false,
	 		alertBody : "*No 7:20 show Thurs. May 19th."
	 	},
		{
			id : 4,
			active : false,
			title : "Mid-August Lunch",
			rating : "Not Rated",
			poster : "august.jpg",
			runtime : "75 min",
			auditorium : "Upstairs Auditorium",
			starring : "Gianni Di Gregorio, Alfonso Santagata",
			director : "Gianni Di Gregorio",
			synopsis : "<p>This international smash hit from the makers of Gomorrah is an utterly charming tale of good food, feisty ladies and unlikely friendships during a very Roman holiday. Broke, and armed with only a glass of wine and a wry sense of humor, middle-aged Gianni (director and screenwriter Gianni Di Gregorio) is forced to entertain his 93-year-old mother and three other lively mamas in their ancient apartment during Italy’s biggest summer holiday, Pranzo di Ferragosto. Winner of prizes at international festivals including Best First Film at Venice and the Satyajit Ray Award at London, plus the Golden Snail at the Academy of Food and Film in Bologna, Mid-August Lunch is both warmly vibrant family drama and delicately balanced comedy of manners. </p>",
			trailer : '<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/t31wKgagKVU&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/t31wKgagKVU&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=t31wKgagKVU",
			rtlink : 'http://www.rottentomatoes.com/m/mid_august_lunch/',
			daily1 : '1:20 | 4:20 <span style="font-size:11px">(Daily)</span>',
			hasDaily2 : false,
			daily2 : '1:00 | 4:00 <span style="font-size:11px">(Mar. 13)</span>',
			lateShows : false,
			late : '9:50 <span style="font-size:11px">(Fri &amp; Sat)</span>',
			alert : false,
			alertBody : "No 1:00 show Thurs., Mar. 25<sup>th</sup>"
		}
	],
	
	// These are the images used for the Buy Local Logos. Change these to change which logos are used.
	// Logos can be found in the images folder under the LocalLogos sub-folder.
	// Be sure that these logos are sized to 144x193 otherwise they won't look right.
	
	localLogoTop : 'images/LocalLogos/LoveAVL_Small.png',
	localLogoBottom : 'images/LocalLogos/newBlack_Small.png',
	
	loadFilmData : function() {
		// This sets the Buy Local Logos at the top and bottom of the page (defined above)
		$('#localLogoTop').find('img').attr('src', this.localLogoTop);
		$('#localLogoBottom').find('img').attr('src', this.localLogoBottom);
		
		// This loads film data. DO NOT EDIT!
		$('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
				if(film.rating != "")
				{
					$(f).find('h3.film-rating').text(film.rating); // RATING
				}
				else
				{
					$(f).find('h3.film-rating').hide();
				}
				if(film.starring != "")
				{
					$(f).find('span.stars').text(film.starring); // STARRING
				}
				else
				{
					$(f).find('p.starring').hide();
				}
				if(film.director != "")
				{
					$(f).find('span.the-director').text(film.director); // DIRECTOR
				}
				else
				{
					$(f).find('p.director').hide();
				}
				if(film.runtime != "")
				{
					$(f).find('span.runtime').text(film.runtime); // RUNTIME
				}
				else
				{
					$(f).find('p.running-time').hide();
				}
				
				// 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.daily1').html(film.daily1);
				if(film.hasDaily2 == true)
				{
					$(f).find('div.daily2').html(film.daily2);
				}
				else
				{
					$(f).find('div.daily2').hide();
				}
				if(film.lateShows == true)
				{
					$(f).find('div.late').html(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;
				});
			}
		});
	}
}
