function PlayIntroVideo(){
flowplayer("player", {src: "Scripts/flowplayer/flowplayer-3.2.7.swf", wmode: 'transparent', allowfullscreen: 'false'}, {
    plugins: {
		controls: {
			url: 'Scripts/flowplayer/flowplayer.controls-3.2.5.swf',
			top:160,
			height:20,
			tooltipColor: 'rgba(255, 255, 255, 0.7)',
			tooltipTextColor: '#000000',
			play:true,
		volume:true,
		mute:true,
		time:true,
		stop:true,
		playlist:false,
		fullscreen:false
		}
	},
	play: {
		width: 60,
		height: 60
	},
	canvas: {
   backgroundGradient: 'none'
				},
	clip:  {
        autoPlay: true,
        autoBuffering: true,
		url: "video/FinalOutput(MAGIC).flv",
		ipadUrl: "video/IphoneLRCIntro.mp4",
		onFinish: function() {
			document.getElementById("chris").style.clip="rect(0px, 300px, 182px, 0px)";
			this.unload();
			},
		onCuepoint: [[109000], function(clip, cuepoint) {
				document.getElementById("chris").style.clip="rect(0px, 300px, 520px, 0px)";
		}],
		onBegin: function() {
		document.getElementById("chris").style.clip="rect(0px, 300px, 182px, 0px)";
		},
		onLastSecond: function() {
		document.getElementById("chris").style.clip="rect(0px, 300px, 182px, 0px)";
		}
	}
    
}).ipad();
}

function donationBox(){
if (__ossIsLoggedIn == 1) {
document.write("<div id=\"SupportLRC2\" onClick=\"location.href='support';\"><\/div>");
}else{
document.write("<div id=\"SupportLRC\" onClick=\"location.href='support';\"><\/div>");
}}
function donationBox2(){
if (__ossIsLoggedIn == 1) {
document.write("<div id=\"support1\" class=\"mosaic-block supporting\">");
document.write("<a href=\"profile\/supporter_donate.php\" class=\"mosaic-overlay log\">");
document.write("				<div class=\"details\">");
document.write("                <img src=\"images\/donatenow_small.png\" width=\"222\" height=\"42\" alt=\"Donate Now\">");
document.write("                <h2>Every little helps!<\/h2>");
document.write("<p>If you're already a registered supporter but would like to contribute a bit more, you can do it here!<\/p>");
document.write("<\/div>");
document.write("	<\/a>");
document.write("    <div class=\"mosaic-backdrop\"><img src=\"images\/block5.jpg\"\/><\/div>");
document.write("<\/div>");
}else{
document.write("<div id=\"support1\" class=\"mosaic-block supporting\">");
document.write("<a href=\"#how-to-donate\" class=\"mosaic-overlay fancy\">");
document.write("				<div class=\"details\">");
document.write("                <img src=\"images\/donatenow_small.png\" width=\"222\" height=\"42\" alt=\"Donate Now\">");
document.write("                <h2>Support your local rep. It's easy.<\/h2>");
document.write("<p>Any donation automatically makes you a Founding Supporter for life.<\/p>");
document.write("<\/div>");
document.write("	<\/a>");
document.write("    <div class=\"mosaic-backdrop\"><img src=\"images\/block1.jpg\"\/><\/div>");
document.write("<\/div>");
}}
function loginProfile(){
if (__ossIsLoggedIn == 1) {
 document.write('<a href=\"profile\/index.php\" class=\"loginBtn\">SUPPORTER PROFILE<br\/><span>'+__ossusername+'<\/span><\/a>');
}else{
 document.write('<a href=\"#login\" id=\"centrelogin\" class=\"loginBtn\">SUPPORTER LOGIN<\/a>');
}}
function tickerIntro(){
if (__ossIsLoggedIn == 1) {
	$("a.headliner").html("<span>Hi "+__ossfirstname+" "+__osslastname+"!</span> You are currently logged into your LRC Supporters Account");
}else{
 $("a.headliner").html("Welcome to the new London Repertory Company website!"); 
}}

$(function() {
	  
		//cache the ticker
		var ticker = $("#tickerboard");
		  
		//wrap dt:dd pairs in divs
		ticker.children().filter("dt").each(function() {
		  
		  var dt = $(this),
		    container = $("<div>");
		  
		  dt.next().appendTo(container);
		  dt.prependTo(container);
		  
		  container.appendTo(ticker);
		});
				
		//hide the scrollbar
		ticker.css("overflow", "hidden");
		
		//animator function
		function animator(currentItem) {
		    
		  //work out new anim duration
		  var distance = currentItem.height();
			duration = (distance + parseInt(currentItem.css("marginTop"))) / 0.025;

		  //animate the first child of the ticker
		  currentItem.animate({ marginTop: -distance }, duration, "linear", function() {
		    
			//move current item to the bottom
			currentItem.appendTo(currentItem.parent()).css("marginTop", 0);

			//recurse
			animator(currentItem.parent().children(":first"));
		  }); 
		};
		
		//start the ticker
		animator(ticker.children(":first"));
				
		//set mouseenter
		ticker.mouseenter(function() {
		  
		  //stop current animation
		  ticker.children().stop();
		  
		});
		
		//set mouseleave
		ticker.mouseleave(function() {
		          
          //resume animation
		  animator(ticker.children(":first"));
		  
		});
		
		
		
	  });
 
 $(document).ready(function() {
	
	/* Using custom settings */
$("input[type=text]").focus(function(){
    // Select field contents
    this.select();
});
	$("#centrelogin").fancybox({
				'hideOnContentClick': false,
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade'
			});
	$("#centrepass").fancybox({
				'hideOnContentClick': false,
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade'
			});
	$("#relogin").fancybox({
				'hideOnContentClick': false,
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade'
			});
	$("ul#newsticker").liScroll();
});
 

