$(document).ready(function() {

	/*---------Header Banners --------------------------------------*/
	
	$('#headerBanners').before('<div id="bannerNav" class="nav">').cycle({
        fx:     'fade', 
   		speed:   4000, 
		speedIn:  1000, 
    	speedOut: 1000, 
        pager:  '#bannerNav',
		random:  1
    });
	
	$('#testimonials').cycle({
        fx:     'fade', 
		speed:   1200, 
		timeout: 10000, 
		next:   '#testimonials', 
		pause:   1 
    });
	
	/*---------Fancy Select Boxes --------------------------------------*/
	
	$("SELECT").selectBox();
	
	/*---------Main Navigation Menu --------------------------------------*/
	
	function menuAnimateIn() {
		var ul = $(this).children("ul");
		ul.animate({ height:"show", opacity:1 }, {duration:30});
	};
			
	function menuAnimateOut() {
		var ul = $(this).children("ul");
		ul.animate({ height:"hide", opacity:0 }, {duration:3});
	};
	
	function menuAnimateInFromLeft() {
		var ul = $(this).children("ul li ul");
		ul.animate({ width:"show", opacity:1 }, {duration:6});
	};
			
	function menuAnimateOutFromLeft() {
		var ul = $(this).children("ul li ul");
		ul.animate({ width:"hide",  opacity:0 }, {duration:6});
	};
	
	$("#nav li").hoverIntent({ over:menuAnimateIn, timeout:500, out:menuAnimateOut});
	$("#nav li ul li").hoverIntent({ over:menuAnimateInFromLeft, timeout:500, out:menuAnimateOutFromLeft});
	
	/*---------Sliding tabs on the right --------------------------------------*/
	
	$('#contactCalloutTab',$(this)).stop().css({"width": "35px"}, "slow");
        $('#contactCalloutTab').hover(
            function () {
                $($(this)).stop().animate({"width": "243px"},400);
            },
            function () {
                $($(this)).stop().animate({"width": "35px"},400);
            }
        );
        
        $('#salesChatCalloutTab',$(this)).stop().css({"width": "35px"}, "slow");
        $('#salesChatCalloutTab').hover(
            function () {
                $($(this)).stop().animate({"width": "243px"},400);
            },
            function () {
                $($(this)).stop().animate({"width": "35px"},400);
            }
        );
		
	/*---------Bundle popups --------------------------------------*/
	$(document).ready(function() {
		$(".bundlePopup").fancybox({
			'width'				: 580,
			'height'			: 540,
			'autoDimensions'	: true,
			'transitionIn'		: 'elastic',
			'transitionOut'		: 'elastic',
			'padding'			: 0,
			'margin'			: 0
		});
	});
	
});

