/*#############################################
 BLACKMILK.JS
###############################################*/

/*#############################################
 JQUERY FUNCTIONS
###############################################*/


jQuery(function( $ ){



	/* MAIN MENU MÄÄRITYKSET */

	$("ul.navigation li a").css({ opacity: 0.5 });
	$("ul.navigation li.active a").css({ opacity: 1 }); 

	$("ul.navigation li a").hover(
		function(){
			if($(this).parent().hasClass("active")){
				
			}else{
				$(this).animate({ opacity: 1 }, 400 );
			}
		},
		function(){
			if($(this).parent().hasClass("active")){
			}else{
				$(this).animate({ opacity: 0.5 }, 400 );
			}
		}

	);



	/* TAB MÄÄRITYKSET */
	/* Hoover määritykset */


	$("ul.tabgation li a").css({ marginTop: "10px" });
	$("ul.tabgation li.active a").css({ marginTop: "0px" }); 

	$("ul.tabgation li a").hover(
		function(){
			if($(this).parent().hasClass("active")){
				
			}else{
				$(this).animate({ marginTop: "0px" }, 100 );
			}
		},
		function(){
			if($(this).parent().hasClass("active")){
			}else{
				$(this).animate({ marginTop: "10px" }, 100 );
			}
		}

	);



	/* SUB MENU MÄÄRITYKSET */

	$("ul.subgation li:first").addClass("active").children().css({ "background" : "url(gfx/bottom-tab-hover.gif)", color: "#fff"});

	$("ul.subgation li a").click(
		function(){
			$(this).parent().addClass("active");
			$(this).parent().siblings().removeClass("active");
			$(this).parent().siblings().children().css({"background" : "url(gfx/bottom-tab-neutral.gif)", color: "#000" });

		}
	);

	$("ul.subgation li a").hover(
		function(){
			if($(this).parent().hasClass("active")){
				
			}else{
				$(this).css({"background" : "url(gfx/bottom-tab-hover.gif)", color: "#fff"});
			}
		},
		function(){
			if($(this).parent().hasClass("active")){
			}else{
				$(this).css({"background" : "url(gfx/bottom-tab-neutral.gif)", color: "#000"});
			}
		}

	);


	/* Tabit */
	var tabContainers = $('div#polaroid-field > div');
	tabContainers.filter(':first').fadeIn(600);
				
	$("ul.subgation li a").click(function () {
		tabContainers.stop().hide();
		tabContainers.filter(this.hash).fadeIn(600);
		return false;
	}).filter(':first').click();

	/* TUN FIX */
	$('#sub-navi a').click(function() {
	player1.sendEvent('STOP');
	player2.sendEvent('STOP');
	player3.sendEvent('STOP');
	player4.sendEvent('STOP');
	player5.sendEvent('STOP');
	player6.sendEvent('STOP');
	player7.sendEvent('STOP');
	player8.sendEvent('STOP');
	player9.sendEvent('STOP');
	player10.sendEvent('STOP');
	player11.sendEvent('STOP');
	player12.sendEvent('STOP');
	player13.sendEvent('STOP');
	player14.sendEvent('STOP');
	player15.sendEvent('STOP');
	player16.sendEvent('STOP');
	player17.sendEvent('STOP');
	player18.sendEvent('STOP');
	player19.sendEvent('STOP');
	player20.sendEvent('STOP');

	});


	/* PNGFIX MÄÄRITYKSET */
	$(document).pngFix();
	//$(document).pngFix2();


});





