// JavaScript Document
// Coded by Chaddoesdesign.


$(document).ready(function() {

	if (jQuery.browser.mozilla) {
	 	$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'http://www.fearlessrecords.com/breathe/tumblr-final/styles/firefox.css') );
	}
	
	if (jQuery.browser.safari) {
	 	$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'http://www.fearlessrecords.com/breathe/tumblr-final/styles/chrome.css') );
	}
	
	if (jQuery.browser.msie) {
	 	$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'http://www.fearlessrecords.com/breathe/tumblr-final/styles/ie.css') );

	}
	
	if (jQuery.browser.opera) {
	 	$('head').append( $('<link rel="stylesheet" type="text/css" />').attr('href', 'http://www.fearlessrecords.com/breathe/tumblr-final/styles/chrome.css') );
	}
	
	$("div#player-contain").css("display","none")
	
	$("div#show-player a, a#x-out").click(function(event){
		event.preventDefault();
    		$("div#player-contain").slideToggle("slow");
	});	
	
	$(
		function() {
			$("a#x-out").css("opacity",".4");
			$("a#x-out").hover(function () {
				$(this).stop().animate({
					opacity: 1
				}, '500');
			},
		function () {
			$(this).stop().animate({
				opacity: .4
			}, 'slow');
		});
	});
	
	$(
		function() {
			$("a#cc-logo").css("opacity",".6");
			$("a#cc-logo").hover(function () {
				$(this).stop().animate({
					opacity: 1
				}, 'slow');
			},
		function () {
			$(this).stop().animate({
				opacity: .6
			}, 'slow');
		});
	});
	
	
				   
});

var fixed = false;

	$(document).scroll(function() {
		if( $(this).scrollTop() >= 370 ) {
			if( !fixed ) {
				fixed = true;
				$('#video-over').addClass("video-over-fixed");
				$('#show-player').addClass("show-player-fixed");
				$('#player-contain').addClass("player-contain-fixed");
			}
		} else {
			if( fixed ) {
				fixed = false;
				$('#video-over').removeClass("video-over-fixed");
				$('#show-player').removeClass("show-player-fixed");
				$('#player-contain').removeClass("player-contain-fixed");
			}
		}
	});
