//Navigation
jQuery(document).ready(function(){ 
	$("#mainnav ul").superfish(); 
}); 

//NIVO SLIDER
jQuery(window).load(function() {
jQuery('.sb_slider').nivoSlider({
effect:'sliceUp',
animSpeed:500,
pauseTime:4000,
directionNav:false,
controlNav:false,
});
});

//GO TO TOP
jQuery(document).ready(function($){
$('li.gototop').click(function(){
$('html, body').animate({scrollTop: '0px'}, 500);
return false;
});
});

//Hide while loading fonts in Firefox
(function(){
  var d = document, e = d.documentElement, s = d.createElement('style');
  if (e.style.MozTransform === ''){
    s.textContent = '.w{visibility:hidden}';
    e.firstChild.appendChild(s);
    function f(){ s.parentNode && s.parentNode.removeChild(s); }
    addEventListener('load',f,false);
    setTimeout(f,2000); 
  }
})();

//Login Toggle
jQuery(document).ready(function($){
//Hide (Collapse) the toggle containers on load
$("#loginbox").hide(); 
//Switch the "Open" and "Close" state per click
$("#login_button").toggle(function(){
$(this).addClass("loginopen");
}, function () {
$(this).removeClass("loginopen");
});
//Slide up and down on click
$("#login_button").click(function(){
$("#loginbox").slideToggle("medium");
});
});

//Slideshow
jQuery(document).ready(function(){
$("#fnews").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 4000, true);
$("#fnews").hover(
	function() {
		$("#fnews").tabs("rotate",0,true);
	},
	function() {
		$("#fnews").tabs("rotate",4000,true);
	}
);
});




