function hideTopBar() {
	setTimeout(function(){
		window.scrollTo(0,1);
	},500);
}

/*
movies template
	"TITLE" : {
		"url" : "",
		"title" : "",
		"description" : ""
	}
*/


var movies = {
	"celine" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/CelineDion_HotTicket-TRLR_mobile.mp4",
		"title" : "Celine: Through the Eyes of the World",
		"description" : "Celine Dion, the international superstar and best-selling female artist of all time, has toured around the world and back again, and now, Sony Pictures Releasing's special programming division, The Hot Ticket, will let audiences follow her everywhere. For a limited engagement beginning early next year in wide release, Celine: Through the Eyes of the World will bring Celine Dion's 2008-2009 Taking Chances World Tour to theaters. This special motion picture event gives Dion fans who attended the extremely popular tour - which placed Dion second only to Madonna in ticket sales in 2008 - another chance to experience the magical event, this time from a vantage point unparalleled by any ticket."
	},
	"thebountyhunter" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/BountyHunter_AdobeMobile.mp4",
		"title" : "The Bounty Hunter",
		"description" : "Milo Boyd (Gerard Butler), a down-on-his-luck bounty hunter, gets his dream job when he is assigned to track down his bail-jumping ex-wife, reporter Nicole Hurly (Jennifer Aniston). He thinks all that's ahead is an easy payday, but when Nicole gives him the slip so she can chase a lead on a murder cover-up, Milo realizes that nothing ever goes simply with him and Nicole. The exes continually one-up each other - until they find themselves on the run for their lives. They thought their promise to love, honor and obey was tough - staying alive is going to be a whole lot tougher. Andy Tennant (Hitch, Sweet Home Alabama) directs."
	},
	"deathatafuneral" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/DeathAtAFuneral_AdobeMobile.mp4",
		"title" : "Death At A Funeral",
		"description" : "In Theaters April 16, 2010 - Directed by Neil LaBute, Death at a Funeral is a hilarious day in the life of an American family come together to put a beloved husband and father to rest. As mourners gather at the family home, shocking revelations, festering resentments, ugly threats, blackmail and a misdirected corpse unleash lethal and riotous mayhem."
	},
	"kennychesney" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/KC-HotTicket_TRLR_mobile.mp4",
		"title" : "Kenny Chesney Summer in 3D",
		"description" : "In Theaters April 21, 2010 - Kenny Chesney, the biggest ticket-seller of this century in any musical genre, has wrapped his latest concert tour, the Sun City Carnival. This spring, Sony Pictures Releasing's special programming division, The Hot Ticket, will take audiences for another ride. For a limited engagement beginning in April 2010 in movie theatres nationwide, Kenny Chesney: Summer in 3D, will give fans the chance to live the fun, the friends, the songs and the moments that make Kenny Chesney the must-see concert experience to kickoff the summer season."
	},
	"grownups" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/GrownUps_AdobeMobile.mp4",
		"title" : "Grown Ups",
		"description" : "In Theaters June 25, 2010 - Grown Ups, starring Adam Sandler, Kevin James, Chris Rock, Rob Schneider, and David Spade, is a comedy about five friends and former teammates who reunite years later to honor the passing of their childhood basketball coach. With their wives (Salma Hayek, Maria Bello, Maya Rudolph) and kids in tow, they spend the Fourth of July holiday weekend together at the lake house where they celebrated their championship years earlier. Picking up where they left off, they discover why growing older doesn't mean growing up."
	},
	"thekaratekid" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/KarateKid_AdobeMobile.mp4",
		"title" : "The Karate Kid",
		"description" : "In Theaters June 11, 2010 - In Columbia Pictures' The Karate Kid, 12-year-old Dre Parker (Jaden Smith) could've been the most popular kid in Detroit, but his mother's (Taraji P. Henson) latest career move has landed him in China. Dre immediately falls for his classmate Mei Ying - and the feeling is mutual - but cultural differences make such a friendship impossible. Even worse, Dre's feelings make an enemy of the class bully, Cheng. In the land of kung fu, Dre knows only a little karate, and Cheng puts &quot;the karate kid&quot; on the floor with ease. With no friends in a strange land, Dre has nowhere to turn but maintenance man Mr. Han (Jackie Chan), who is secretly a master of kung fu. As Han teaches Dre that kung fu is not about punches and parries, but maturity and calm, Dre realizes that facing down the bullies will be the fight of his life."
	},
	"takers" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/Takers_AdobeMobile.mp4",
		"title" : "Takers",
		"description" : "In Theaters May 14, 2010 - TAKERS takes you into the world of a notorious group of criminals (Idris Elba, Paul Walker, T.I., Chris Brown, Hayden Christensen and Michael Ealy) who continue to baffle police by pulling off perfectly executed bank robberies. They are in and out like clockwork, leaving no evidence behind and laying low between heists. But when they attempt to pull off one last job with more money at stake than ever before, the crew may find their plans interrupted by a hardened detective (Matt Dillon) who is hell-bent on solving the case"
	},
	"salt" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/Salt_AdobeMobile.mp4",
		"title" : "Salt",
		"description" : "In Theaters July 23, 2010 - Angelina Jolie stars in Salt, a contemporary action thriller from Columbia Pictures. As a CIA officer, Evelyn Salt (Jolie) swore an oath to duty, honor and country. Her loyalty will be tested when a defector accuses her of being a Russian spy. Salt goes on the run, using all her skills and years of experience as a covert operative to elude capture. Salt's efforts to prove her innocence only serve to cast doubt on her motives, as the hunt to uncover the truth behind her identity continues and the question remains: \"Who Is Salt?\""
	},
	"eatpraylove" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/EatPrayLove_AdobeMobile.mp4",
		"title" : "Eat Pray Love",
		"description" : "In Theaters August 13, 2010 - Julia Roberts stars in EAT PRAY LOVE - a conflicted woman travels around the world and discovers the powers of nourishment, prayer, and love during her journey."
	},
	"theotherguys" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/otherguys_adobeMobile.mp4",
		"title" : "The Other Guys",
		"description" : "In Theaters August 6, 2010 - Will Ferrell &amp; Mark Wahlberg are THE OTHER GUYS, two mismatched police detectives who have trouble getting along. Also starring Dwayne Johnson &amp; Samuel L. Jackson."
	},
	"easya" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/easyA_adobeMobile.mp4",
		"title" : "Easy A",
		"description" : "In Theaters September 17, 201 - Starring Emma Stone, Amanda Bynes, Penn Badgley, and Lisa Kudrow, EASY A is a comedy about a high school girl who manipulates gossip and rumors for personal gain."
	},
	"residentevilafterlife" : {
		"url" : "http://flash.sonypictures.com/video/mobile/flash/residentEvil4_adobeMobile.mp4",
		"title" : "Resident Evil: Afterlife",
		"description" : "In Theaters September 10, 2010 - Presented in 3D, starring Milla Jovovich & Ali Larter. As the battle with Umbrella Corporation intensifies, Alice receives help from an old friend."
	}
	

}

function embedSwf(movie) {
	var playerID = "flashcontent";
	var player;

	var movie = eval("movies."+movie);

	var flashVars = {
		mediaID:"4321",
		allowInlinePlay:"false",
		//mediaPosterURL:"../images/demo/fullscreen.jpg",
		mediaSourceURL: movie.url,
		mediaTitle: movie.title,
		mediaDescription: movie.description,
		mediaLinkURL: "http://www.sonypictures.com/mobile/flash/mwc/",
		skinURL:"http://www.sonypictures.com/mobile/flash/mwc/media/sonyPicturesSkin.swf",
		playerAutoPlay:"true",
		playerAllowInlinePlay:"true",
		playerOnEndExitFullScreen:"true",
		playerOnEndShowPoster:"false"
	};

	var params = {
		allowFullScreen:"true", 
		bgcolor: "#000000"
	};

	var attributes = {
		id:playerID,
		name:playerID
	};
	
	swfobject.embedSWF("http://www.sonypictures.com/mobile/flash/mwc/media/mobileplayer.swf", playerID, 320, 214, "10.0.0", "http://www.sonypictures.com/mobile/flash/mwc/media/media/expressInstall.swf",flashVars,params,attributes);
}

function playClip() {
	if($('#flashcontent').length) {
		$('.link').click(function(){
			window.scrollTo(0,1);
			embedSwf($(this).attr('id'));
			return false;
		});
		$('.billboard').click(function(){
			window.scrollTo(0,1);
			embedSwf($(this).attr('rel'));
			return false;
		});
	}
}

function billboardsInit() {
	$('#billboards').cycle({			
		fx: 'fade', 
		speed: 4000,
		timeout: 1000,
		pause: 1
	});
}

addLoadEvent(hideTopBar);
addLoadEvent(playClip);
addLoadEvent(billboardsInit);