﻿Sys.Application.add_init(OnApplicationInitHandler);

function OnApplicationInitHandler(sender, args) {    
    var homeButtonClicked = false;
	
	$(document).ready(function() {
		$('#homeVisual').cycle({
			fx: 'fade'
		});
		
		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');
		});
	})

}