// VSTE

// PngFix Start
$(document).ready(function(){
   $('.mask').pngFix();
});

// News tabs
$(document).ready(function(){
$("#news .item").hide(); //Hide all content
$("#news ul li:first").addClass("active").show(); //Activate first tab
$("#news .item:first").show(); //Show first tab content

$("#news ul li").mouseover(function() {
		$("#news ul li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$("#news .item").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).show(); //Fade in the active content
		return false;
});
});








function form__text_onFocus(el, title) { if(el.value == title) { el.value = ''; } }
function form__text_onBlur(el, title) { if(el.value == '') { el.value = title; } }


var bottomPanelStatus = 0;
function bottomPanelToggle()
{
	if(bottomPanelStatus == 0)
	{
		$('#footer-in').show();
		
		$.cookie("dontShowBottomPanel", null);
		
		bottomPanelStatus = 1;
		
      $("#change").text("Schovat");
	}
	else
	{
		$('#footer-in').hide();
		
		$.cookie("dontShowBottomPanel", "1", { expires: 365 });
		
		bottomPanelStatus = 0;
		
		$("#change").text("Zobrazit");
	}
	
	return false;
}

function bottomPanelShow()
{
	if($.cookie("dontShowBottomPanel") == 1)
	{
		$('#footer-in').hide();
		bottomPanelStatus = 0;
		
		$("#change").text("Zobrazit");
	}
	else
	{
		$('#footer-in').show();
		bottomPanelStatus = 1;
		
		$("#change").text("Schovat");
	}
}

function discussionHideMore()
{
	$('#discussions .more').hide();
}

function discussionToggleMore(id)
{
	$('#discussion-category-' + id + ' .more').slideToggle();
}

function gallery_showPhoto(src)
{
	$('#big-photo').attr('src', src);
	
	return false;
}

// Anchors selector
$(document).ready(function(){
    $("a[href^='http']")
    .not(":has(img)")
    .not("a[href^='http:\/\/10rem']")
    .not("a[href^='http:\/\/community.irritatedvowel']")
    .addClass("external")
    .attr({target: "_blank"});
});