	$(function(){
		// Set starting slide to 1
		var startSlide = 1;
		// Get slide number if it exists
		if (window.location.hash) {
			startSlide = window.location.hash.replace('#','');
		}
		// Initialize Slides
		$('#slides').slides({
			generatePagination: true,
			play: 10000,
			pause: 2500,
			hoverPause: true,
			// Get the starting slide
			start: startSlide,
			animationComplete: function(current){
				// Set the slide number as a hash
				window.location.hash = '#' + current;
			}
		});
	});

    var scrollSpeed = 20;       // Speed in milliseconds
    var step = 1;               // How many pixels to move per step
    var current = 0;            // The current pixel row
    var imageHeight = 4300;     // Background image height
    var headerHeight = 300;     // How tall the header is.
   
    //The pixel row where to start a new loop
    var restartPosition = -(imageHeight - headerHeight);
   
    function scrollBg(){
       
        //Go to next pixel row.
        current -= step;
       
        //If at the end of the image, then go to the top.
        if (current == restartPosition){
            current = 0;
        }
       
        //Set the CSS of the header.
        $('#banner-wrapper').css("background-position", current+"px 0");
       
       
    }
   
    //Calls the scrolling function repeatedly
    var init = setInterval("scrollBg()", scrollSpeed);
$(document).ready(function(){
	$("#sme").mouseover(function(){
		if($("#main-slider").is(":visible")){
				$("#main-slider-2").fadeIn('slow');
				$("#main-slider").fadeOut('slow');
			
		}else
			if($("#main-slider-3").is(":visible")){
				$("#main-slider-2").fadeIn('slow');
				$("#main-slider-3").fadeOut('slow');
				
			}
		

	});	
	$("#solution").mouseover(function(){
		if( $("#main-slider").is(":visible") ){
				$("#main-slider").fadeOut('slow');
				$("#main-slider-3").fadeIn('slow');
			
		}else if($("#main-slider-2").is(":visible")){
					$("#main-slider-2").fadeOut("slow");
					$("#main-slider-3").fadeIn("slow");
				
			
		}
	});	
	
	$("#marketing").mouseover(function(){
		if( $("#main-slider-3").is(":visible") ){
				$("#main-slider-3").fadeOut('slow');
				$("#main-slider").fadeIn('slow');
		}else if($("#main-slider-2").is(":visible")){
					$("#main-slider").fadeIn('slow');
					$("#main-slider-2").fadeOut(100);
				
			
		}
	});	
	
}); 

