jQuery(function(){
	jQuery("#image-carousel").carouFredSel({
		auto : {
			play: 			true,
			pauseDuration: 	5000,
			pauseOnHover:	true
		},
		scroll : {
			easing : "easeOutSine",
			duration: 1000
		},
		items: 1,
		direction: "left",
		prev : {   
			button  : "#web-image-carousel-prev"
		},
		next : {
			button  : "#web-image-carousel-next"
		}
	});	
});

jQuery(function(){
	jQuery.fn.supersized.options = {  
		startwidth: 2000,  
		startheight: 1250,
		vertical_center: 1,
		slideshow: 1,
		navigation: 0,
		transition: 0,
		pause_hover: 0,
		slide_counter: 1,
		slide_captions: 0,
		slide_interval: 5000  
	};
	jQuery('#web_supersize').supersized();
});

jQuery(function(){
	var animation = true;
	var menuTimeout = null;
	setTimeout(mmove,1000);
	
	var fclear = function(){
		clearTimeout(menuTimeout);
		menuTimeout = setTimeout(mstop,5000);
	}
	var fmmove = function(event){
		jQuery('.web-nav').stop().animate(
			{"top": "0px"}
		);
		jQuery(this).unbind(event);
	}
	
	function mmove(){
		jQuery(document).bind('mousemove', fclear);
		jQuery(document).bind('mousemove', fmmove);
	}

	function mstop(){
		if(animation){
			clearTimeout(menuTimeout);
			jQuery('.web-nav').stop().animate(
				{"top": "-65px"}
			);
			jQuery(document).bind('mousemove', fmmove);
		}
	}

	jQuery('div.web-sitenav-1 ul.level-1 li').mouseover(function(event){
		animation = false;
	}).mouseout(function(event){
		animation = true;
	});
});

jQuery(function(){
	if(!jQuery.browser.msie){
		jQuery(".web-home-content").click(function(event){
			if(event.currentTarget == event.target){
				var c = jQuery("a.activeslide");
				if(c){
					if(c.attr("target")=="_blank"){
						window.open(c.attr("href"),'h_pop');
					} else {
						document.location.href = c.attr("href");
					}
					return false;
				}
			}
		});
	}
});
