﻿$(document).ready(function() {
	$(".fadeIn").hide();
	
	// Menu functions
	$("#navh ul li").hover(function() {
			$(this).css('background', '#436A93');
			$(this).children("ul").fadeIn("normal");
		}, function() {
			$(this).css('background', 'none');
			$(this).children("ul").hide();
		}
	);

	$("#navh ul ul li").hover(function() {
			$(this).children("ul").fadeIn("normal");
		}, function() {
			$(this).children("ul").hide();
		}
	);
	
	//Miscellaneous
	$(window).load(function() {
		$(".fadeIn").fadeIn("slow");
	});
	
	// Clients Page functions
	if ($(".clientLogo").length) {
		$("#content").height(600);
		$(".clientLogo").hide();
		fadeLogo();
	}
	
	function fadeLogo() {
		if ($(".clientLogo:hidden").length) {
			var rnd = Math.floor(Math.random()*$(".clientLogo").length);
			if ($(".clientLogo").eq(rnd).is(":hidden"))
				$(".clientLogo").eq(rnd).fadeIn("normal", fadeLogo);
			else
				fadeLogo();
		}
	}
});
