﻿Sys.Application.add_init(OnApplicationInitHandler);

function OnApplicationInitHandler(sender, args) {    
    var homeButtonClicked = false;
	
	$(document).ready(function() {
		
		
		/*	CarouFredSel: an infinite, circular jQuery carousel.
			Configuration created by the "Configuration Robot"
			at caroufredsel.frebsite.nl
		*/
		$('#homeVisualCarousel').carouFredSel({
			width: 910,
			align: false,
			height: 380,
			items: 1,
			scroll: {
				items: 1,
				fx: "crossfade",
				duration: 500
				//easing: "easeInOutExpo"
			},
			auto: 3000
		});
		
		
		if (!(Sys.Browser.agent == Sys.Browser.InternetExplorer && Sys.Browser.version < 7)) {
       
        $('#homemenu a')
            .css({ backgroundPosition: "0px -54px" })
            .mouseover(function() {
                if (!homeButtonClicked) {
                    $(this).stop().animate({ backgroundPosition: "(0px 0px)" }, { duration: 250, easing: "easeOutExpo" })
                }
            })
            .mouseout(function() {
                if (!homeButtonClicked) {
                    $(this).stop().animate({ backgroundPosition: "(0px -54px)" }, { duration: 250, easing: "easeOutExpo", complete: function() {
                        $(this).css({ backgroundPosition: "0px -54px" })
                    }
                    })
                }
            })
			
    	}
		
		$('#homemenu li#internet').click(function() {
				$('#topmenu li#internet').trigger('click');
		});
	})

}
