// Novo Ministries - JavaScript Document

// Navigation Dropdown Menu
$ = jQuery.noConflict();
$ = jQuery;

$(document).ready(function(){
	$("#nav > li").hover(
		function(){ $("ul:first", this).css({display: 'block'}); }, 
		function(){ $("ul:first", this).css({display: 'none'}); } 
	);
	$("#nav > li ul li").hover(
		function(){ $("ul:first", this).css({display: 'block'}); }, 
		function(){ $("ul:first", this).css({display: 'none'}); } 
	);
	$("#nav li ul").css({display: 'none'});

});

$(document).ready(function(){
//Home Page Banner Fader

	if($('#homepage-banner').length > 0){ //If element exists
		$('#homepage-banner').cycle({
			fx : 'fade',
			next : '#banner-next',
			prev : '#banner-previous',
			timeout : 10000,
			cleartype :  1, // enable cleartype corrections
			pause : 1
		});
	  }
});

$(window).load(function () {
$('#mts-fader').cycle({ 
    fx:    'fade',
    speed:  3500,
	random: 1,
	pause:  3 
  });
});

$(function(){$.fn.scrollToTop=function(){$(this).hide().removeAttr("href");if($(window).scrollTop()!="0"){$(this).fadeIn("fast")}var scrollDiv=$(this);$(window).scroll(function(){if($(window).scrollTop()=="0"){$(scrollDiv).fadeOut("fast")}else{$(scrollDiv).fadeIn("fast")}});$(this).click(function(){$("html, body").animate({scrollTop:0},"slow")})}});
$(function() {
	$("#toTop").scrollToTop();
});