// JavaScript Document
	
	function onYouTubePlayerReady(playerId) {
			//alert('hello');
			//alert("playerid");
			//alert(playerid);
			//alert('pass');
			//var player = $('#player')[0];
			//player.addEventListener('onStateChange', '(function(state) { return playerState(state, "' + playerId + '"); })' );
	}
	
	function playerState(state, playerId) {
			//alert(state);
			//alert(playerId);
	}
	
	
	
	
$(document).ready(function(){
	
	
			//Cufon.replace('h2');
			//Cufon.replace('h3');
			//Cufon.replace('.doMyriad');
			//Cufon.replace('li.page_item');
			
			
	
	// override wordpress driven menu urls
	$('#flexipages-4 li.page_item.page-item-3 a').attr('href', 'javascript://');
	$('#flexipages-4 li.page_item.page-item-3 a').click(function(){
		
		window.location.href = 'http://info.schedulist.com/heres-a-snapshot-of-what-we-do/';
	});
	
	$('#flexipages-4 li.page_item.page-item-2 a').attr('href', 'javascript://');
	$('#flexipages-4 li.page_item.page-item-2 a').click(function(){
		
		window.location.href = 'http://info.schedulist.com/start-a-conversation/';
	});
	
	$('#flexipages-4 li.page_item.page-item-7 a').attr('href', 'javascript://');
	$('#flexipages-4 li.page_item.page-item-7 a').click(function(){
		
		window.location.href = 'http://info.schedulist.com/take-us-for-a-test-drive/';
	});
	
	$('#flexipages-4 li.page_item.page-item-630 a').attr('href', 'javascript://');
	$('#flexipages-4 li.page_item.page-item-630 a').click(function(){
		
		window.location.href = 'http://info.schedulist.com/blog/';
	});
	
	
	
	// home page stuff
	
	if ($(".body.home".length)){
		//<!-- For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. --> 
		var swfVersionStr = "10.0.0";
		//<!-- To use express install, set to playerProductInstall.swf, otherwise the empty string. -->
		var xiSwfUrlStr = "/wp-content/themes/schedulist/playerProductInstall.swf";
		var flashvars = {};
		
		var params = {};
		params.quality = "high";
		//params.bgcolor = "#ffffff";
		params.allowscriptaccess = "always";
		params.allowfullscreen = "true";
		params.wmode = "transparent";
		var attributes = {};
		attributes.id = "trailer";
		attributes.name = "trailer";
		attributes.align = "middle";
		//alert('hello');
		swfobject.embedSWF(
		"http://www.youtube.com/v/-rFbI0YXRu4?fs=1&hl=en_US&rel=0&hd=1&color1=0x2b405b&color2=0x6b8ab6&autoplay=1&enablejsapi=1&version=3", "flashContent", 
		"560", "340", 
		swfVersionStr, xiSwfUrlStr, 
		flashvars, params, attributes);
		//<!-- JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. -->
		
		//swfobject.createCSS("#flashContent", "display:block;text-align:left;");
		
		
		
		//alert("page ready to start");
		// read the slide array
		//Define: ContentSlider("slider_ID", [autorotate_miliseconds], [custompaginatelinkstext], [customnextlinktext])
		ContentSlider("slider1", "", "", "Next Slide");
		//alert('hello');
		//OR ContentSlider("slider1", 3000)
		//OR ContentSlider("slider1", 3000, linktextarray)
		//OR ContentSlider("slider1", 3000, linktextarray, "Foward")
		//OR ContentSlider("slider1", "", linktextarray)
		//OR ContentSlider("slider1", "", "", "Foward")
	
	
	
		$('.pagination a.page-next').click(function(){
				//alert('next');
				var myPlayer = document.getElementById('trailer');
				//alert(myPlayer);
				myPlayer.pauseVideo();
	
		});
	
		function getMovie(movieName) {
				//return document.getElementById(movieName);
				if (navigator.appName.indexOf("Microsoft") != -1) {
						 return window[movieName];
				 } else {
						 return document[movieName];
				 }
	
		}
	}
	
	

	
	

	
});
