$().ready(function() {
	$('body').tubular('PZLMPW4cXCI','wrapper', '');
	// f-UGhWj1xww cool sepia hd
	// 49SKbS7Xwf4 beautiful barn sepia
	//JfuhZWRmNGQ Fedde Le Grand Takeover Tour
	// p/C9E5B04D154D6DC7
	// fedde teaser		v/1m15N0cdnW8
	
    // Nuke video (for slow connections -- stops loading entirely)
	$("#iFrameW").delay(8800).load(function() {
		ytplayer.playVideo();
	});	
	
	

	// Play/Pause
	$('#videoPause').click(function() {
		if ($(this).hasClass('videoPaused')) {
			ytplayer.playVideo();
			$(this).removeClass('videoPaused');
			$('a#videoPause').html('<img src="img/icon_pause.png" width="30" border="1"/> <span class="playerHover"> PAUSE / BUFFER VIDEO </span>');
		}else if ($(this).hasClass('videoNuked')) {
			ytplayer.playVideo();
			$(this).removeClass('videoPaused');
			$('a#videoPause').html('<img src="img/icon_pause.png" width="30" border="1"/> <span class="playerHover"> PAUSE / BUFFER VIDEO </span>');
		} else {
			ytplayer.pauseVideo();
			$(this).addClass('videoPaused');
			$('a#videoPause').html('<img src="img/icon_play.png" width="30" border="1"/> <span class="playerHover"> PLAY VIDEO </span>');
		}
		return false;
	});
	
	// Mute/Unmute
	$('#videoMute').click(function() {
		if ($(this).hasClass('videoMute')) {
			ytplayer.mute();
			$(this).removeClass('videoMute');
			$('a#videoMute').html('<img src="img/icon_unmute.png" width="30" border="1"/> <span class="playerHover"> PLAY SOUND </span>');
		} else {
			ytplayer.unMute();
			$(this).addClass('videoMute');
			$('a#videoMute').html('<img src="img/icon_mute.png" width="30" border="1"/> <span class="playerHover"> MUTE VIDEO </span>');
		}
		return false;
	});
	
	// Nuke video (for slow connections -- stops loading entirely)
	$('#videoStopx').click(function() {
		ytplayer.stopVideo();
		ytplayer.clearVideo();
		$('#yt-container').hide();
		$('a#videoPause').html('<img src="img/icon_play.png" width="30" border="1"/> <span class="playerHover"> PLAY VIDEO </span>');
		return false;
	});
	// Nuke video (for slow connections -- stops loading entirely)
	$('#videoMain').click(function() {
		ytplayer.stopVideo();
		ytplayer.clearVideo();
		$("#alpha").fadeTo(150, 1);
		$('#yt-container').hide();
		$('body').tubular('Q8opr0q_vdk','wrapper', '');
		$("#alpha").delay(4800).fadeTo(4000, 0.5);
		$("#videoMain").css("display","none");
		$("#playV2").css("display","inline");
		$("#videoPause").css("display","inline");
		$("#videoMute").css("display","inline");
		return false;
	});
	// Nuke video (for slow connections -- stops loading entirely)
	$('#videoOhLand').click(function() {
		ytplayer.stopVideo();
		ytplayer.clearVideo();
		$("#alpha").fadeTo(150, 1);
		$('#yt-container').hide();
		$('body').tubular('p/C3F39837DDE937DB','wrapper','1');
		$("#alpha").delay(4800).fadeTo(4000, 0.5);
		return false;
	});	
	
	
	// Nuke video (for slow connections -- stops loading entirely)
	$('#playV1').click(function() {
		ytplayer.stopVideo();
		ytplayer.clearVideo();
		$("#alpha").fadeTo(150, 1);
		$('#yt-container').hide();
		$('body').tubular('DpkDaIL2OOo','wrapper','0');
		$("#alpha").delay(4800).fadeTo(4000, 0.5);
		return false;
	});	
	
	// Nuke video (for slow connections -- stops loading entirely)
	$('#playV2').click(function() {
		$('#alpha').fadeTo("fast", 0.9);
		ytplayer.stopVideo();
		ytplayer.clearVideo();
		$('#yt-container').hide();
		$('body').tubular('nQ6Tgh-c1jU','wrapper','0');
		$("#alpha").delay(4800).fadeTo(4000, 0.5);
		$("#videoMain").css("display","inline");
		$("#playV2").css("display","none");
		$("#videoPause").css("display","none");
		$("#videoMute").css("display","none");
		$('a#videoMain').fadeTo("fast", 0.3);
		muteVideo();
		return false;
	});		

	// Nuke video (for slow connections -- stops loading entirely)
	$('#playV2x').click(function() {
		$("#alpha").fadeIn();
		return false;
	});	
		
	
});

