/**************************************************/
/* 
	Name: Kobalt Systems Main jQuery Script 
	Version 1.0
	Copyright (C) 2011 Deepend
*/
/**************************************************/

	 $(document).ready(function() {
	 
		// Cufon
		Cufon.replace(' .quote-source, .header-caption .contact', { fontFamily: 'Museo 300' });
		Cufon.replace('.solutions-table', { fontFamily: 'Frutiger 45 Light' });
		Cufon.replace('.section-title, .quote, .header-caption .contact', { fontFamily: 'Museo 500' });
		Cufon.replace('.container-caption, .solutions-table .title', { fontFamily: 'Frutiger 65 Bold' });
		Cufon.replace('.header-caption .reps', { fontFamily: 'Verdana' });
	
		// Hover effect for menu items
		$("#menu li a").hover(function() {
			$(this).stop().fadeTo(1, 0.0, function() {
				$(this).fadeTo("slow", 1.0, function() {
					$(this).addClass("hover");
				});
			});
			
			return false;
		}, function() {
			$(this).stop().fadeTo("slow", 0.0, function() {
				$(this).removeClass("hover");
			});
			
			return false;
		});
	 
		// Menu items
		$("#menu li a").click(function() {
			
			// Grab the first class name, it might be "myname active"
			var className = $(this).attr('class').split(" ")[0];
			
			$("#container #content #" + className).slideto({ highlight: false });
			
			return false;
		});
		
		// Arrow at the bottom of the page
		$(".home-arrow").click(function() {
			$("#container #content #landing").slideto({ highlight: false });
		});
	
		// Set the initial title for the scroller
		$(".case-study-title").html($(".scrollable .items").children().eq(0).children(".casestudy-client").html());
	
		// Initialize scrollable
		$(".scrollable").scrollable({
			
			onBeforeSeek: function() {
				$(".case-study-title").fadeOut();
			},
			
			onSeek: function() {
				var currentItem = this.getItems().eq(this.getIndex());
				$(".case-study-title").text($(currentItem).children(".casestudy-client").html());
				Cufon.refresh();
				$(".case-study-title").fadeIn();
			}
		});
		
	});


