// ============= 
// ! TABS HOME   
// ============= 
$(document).ready(function(){
$('#tabshome div').hide(); // Hide all divs
$('#tabshome div:first').show(); // Show the first div
$('#tabshome ul li:first').addClass('active'); // Set the class for active state
$('#tabshome ul li a').click(function(){ // When link is clicked
$('#tabshome ul li').removeClass('active'); // Remove active class from links
$(this).parent().addClass('active'); //Set parent of clicked link class to active
var currentTab = $(this).attr('href'); // Set currentTab to value of href attribute
$('#tabshome div').hide(); // Hide all divs
$(currentTab).show(); // Show div with id equal to variable currentTab
return false;
});
});

// =============== 
// ! TABS PLAYER   
// =============== 
$(document).ready(function(){
	$('#tabsplayer div.tab').hide(); // Hide all divs
	$('#tabsplayer div:first').show(); // Show the first div
	$('#tabsplayer ul li:first').addClass('active'); // Set the class for active state
	$('#tabsplayer div ul li a').click(function(){ // When **INNER* link is clicked
		this.skip= true;											
		//return false;
		return true;
	});
	$('#tabsplayer ul li a').click(function(){ // When link is clicked
		if (!this.skip){
			$('#tabsplayer ul li').removeClass('active'); // Remove active class from links
			$(this).parent().addClass('active'); //Set parent of clicked link class to active
			var currentTab = $(this).attr('href'); // Set currentTab to value of href attribute
			$('#tabsplayer div.tab').hide(); // Hide all divs
			$(currentTab).show(); // Show div with id equal to variable currentTab
			return false;
		};
	});
});

// =============== 
// ! TABS MEMBER   
// =============== 
$(document).ready(function(){
	//$('#tabsmember div.tab').hide(); // Hide all divs
	//$('#tabsmember div:first').show(); // Show the first div
	//$('#tabsmember ul li:first').addClass('active'); // Set the class for active state
	$('#tabsmember div ul li a').click(function(){ // When **INNER* link is clicked
		this.skip= true;											
		//return false;
		return true;
	});
	$('#tabsmember ul li a').click(function(){ // When link is clicked
		if (!this.skip){
			$('#tabsmember ul li').removeClass('active'); // Remove active class from links
			$(this).parent().addClass('active'); //Set parent of clicked link class to active
			var currentTab = $(this).attr('href'); // Set currentTab to value of href attribute
			$('#tabsmember div.tab').hide(); // Hide all divs
			$(currentTab).show(); // Show div with id equal to variable currentTab
			return false;
		};
	});
});

// =============
// PROFILE PIC FAILURE
// =============
//$(window).load(function() {
//$('img.fix').each(function() {
//if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
//this.src = "/img/user-big.png"; // image was broken, replace with new image
//}
//});
//});
