// JavaScript Document

/**
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};

// FadeToggle plugin
jQuery.fn.fadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle'}, speed, easing, callback);
};

// jQuery Begin
jQuery(document).ready(function() {
// Smoothscroll
jQuery('a[href*=#]').click(function() { 
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
&& location.hostname == this.hostname) {var $target = $(this.hash);
$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
if ($target.length) {
var targetOffset = $target.offset().top;
$('html,body').animate({scrollTop: targetOffset}, 1000);
return false;
}
}
});

// SideBar Tabs
jQuery('.inside ul li:last-child').css('border-bottom','0px') // remove last border-bottom from list in tab conten
jQuery('.tabs_js').each(function(){
jQuery(this).children('li:first').addClass('selected'); // Add .selected class to first tab on load
});
jQuery('.inside > *').hide();
jQuery('.inside > *:first-child').show();
jQuery('.tabs_js li').click(function(evt){ // Init Click funtion on Tabs
var clicked_tab_ref = jQuery(this).attr('title'); // Strore Href value
jQuery(this).parent().children('li').removeClass('selected'); //Remove selected from all tabs
jQuery(this).addClass('selected');
jQuery(this).parent().parent().children('.inside').children('*').hide()
jQuery('.inside ' + clicked_tab_ref).fadeIn(1000);
evt.preventDefault();
});

// Bottom Logo Fade
jQuery('#f_wsqlogo strong,#f_wordpresslogo strong').hide().animate({opacity: '0',left: '-15px',top: '-25px'},0);
jQuery('#f_wsqlogo,#f_wordpresslogo').hover(function() {jQuery(this).find('strong').show().animate({opacity: '0.9',left: '-15px',top: '-35px'},400);
}, function() {
jQuery(this).find('strong').animate({opacity: '0',left: '-15px',top: '-25px'},500,function() {
jQuery(this).hide();});
});

// Fade Download Hover
jQuery(".postcontent-img-hover").hide().css("opacity","0");
jQuery(".postcontent-img").hover(function () {
jQuery(this).find(".postcontent-img-hover").show().animate({opacity: 0.9}, 500);
},
function(){
jQuery(this).find(".postcontent-img-hover").stop().animate({opacity: '0'},500,function() {
jQuery(this).hide();});
});



});// END


// Target Blank
function externallinks() { 
if (!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
var anchor = anchors[i]; 
if (anchor.getAttribute("href") && 
anchor.getAttribute("rel") == "external") 
anchor.target = "_blank"; 
} 
} 
window.onload = externallinks;
