/* Home page Javascript */
$().ready(function(){

	function stopMovies(){
		if(navigator.appName.indexOf("Microsoft") != -1) {
			 document.getElementById("player1").sendEvent('stop');
			 document.getElementById("player2").sendEvent('stop');
			 document.getElementById("player3").sendEvent('stop');
			 document.getElementById("player4").sendEvent('stop');
			 document.getElementById("player5").sendEvent('stop');
			 document.getElementById("player6").sendEvent('stop');
   	    }else{
   	    	setTimeout(function() {$('#player1').sendEvent('stop'); }, 200 );
   	    	setTimeout(function() {$('#player2').sendEvent('stop'); }, 200 );
   	    	setTimeout(function() {$('#player3').sendEvent('stop'); }, 200 );
   	    	setTimeout(function() {$('#player4').sendEvent('stop'); }, 200 );
   	    	setTimeout(function() {$('#player5').sendEvent('stop'); }, 200 );
   	    	setTimeout(function() {$('#player6').sendEvent('stop'); }, 200 );
		}
    }
// movie in leaderboard
// pulls some values from the HTML
var ph = $("#leaderboard-video img.leaderboard-video-placeholder");//placeholder image
var hpl = new SWFObject('/sites/all/themes/biblemesh/movie/player-licensed.swf','leaderboard-video-v',ph.attr("width"),ph.attr("height")+24,'9',"#73859C");
	hpl.addParam('allowfullscreen','true');
	hpl.addParam('allowscriptaccess','always');
	hpl.addParam('wmode','transparent');
	hpl.addVariable('image',ph.attr('src'));
	hpl.addVariable('file',$("#leaderboard-video").attr("rel"));
	hpl.addVariable('streamer', 'rtmp://cp23245.edgefcs.net/ondemand/'); 
    hpl.addVariable('plugins', 'gapro-1'); 
    hpl.addVariable('gapro.accountid', 'UA-17464006-1');
   // hpl.addVariable('controlbar','over'); 
    hpl.addVariable('volume','100');
	hpl.write('leaderboard-video'); 

// movies in right column

	    $('#video-accordion').accordion({header:'h3','change':stopMovies});

});

// accordion in right column
