$(document).ready(function () {

    //alert(document.documentMode);

    //determine a document's compatibility mode, include code that supports older versions of Internet Explorer
    engine = null;
    if (window.navigator.appName == "Microsoft Internet Explorer") {
        // This is an IE browser. What mode is the engine in?
        if (document.documentMode) // IE8
            engine = document.documentMode;
        else // IE 5-7
        {
            engine = 5; // Assume quirks mode unless proven otherwise
            if (document.compatMode) {
                if (document.compatMode == "CSS1Compat")
                    engine = 7; // standards mode
            }
        }
        // the engine variable now contains the document compatibility mode.
    }

    // hide all sub menus
    $('#topnav ul').each(function () {
        $(this).hide();
    });

    $('#submenu_top ul').each(function () {
        $(this).hide();
    });


    // show sub menu when hover
    $('#topnav li').hover(
    function () {
        $('ul', this).show();
        $('#submenu_top', this).hide();
    },

    function () {
        $('ul', this).hide();
    }
  );


    // show child sub menus when clicked
    $("li[id^='submenu_parent']").click(function () {

        $('#submenu_top', this).slideToggle();

    });



	/* UK & Default */
    $(".Home").hover(function () {
        $(this).attr("src", "/Image/home_hover.gif");
    }, function () {
        $(this).attr("src", "/Image/home.gif");
    });

    $(".Services").hover(function () {
        $(this).attr("src", "/Image/services_hover.gif");
    }, function () {
        $(this).attr("src", "/Image/services.gif");
    });

    $(".AboutUs").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus.gif");
    });

    $(".NewsandEvents").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents.gif");
    });

    $(".ContactUs").hover(function () {
        $(this).attr("src", "/Image/contactus_hover.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus.gif");
    });
	
	/* DE */
	$(".Home_DE").hover(function () {
        $(this).attr("src", "/Image/home_hover_DE.gif");
    }, function () {
        $(this).attr("src", "/Image/home_DE.gif");
    });

    $(".Services_DE").hover(function () {
        $(this).attr("src", "/Image/services_hover_DE.gif");
    }, function () {
        $(this).attr("src", "/Image/services_DE.gif");
    });

    $(".AboutUs_DE").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_DE.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_DE.gif");
    });

    $(".NewsandEvents_DE").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_DE.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_DE.gif");
    });

    $(".ContactUs_DE").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_DE.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_DE.gif");
    });
	
	/*ES*/
	$(".Home_ES").hover(function () {
        $(this).attr("src", "/Image/home_hover_ES.gif");
    }, function () {
        $(this).attr("src", "/Image/home_ES.gif");
    });

    $(".Services_ES").hover(function () {
        $(this).attr("src", "/Image/services_hover_ES.gif");
    }, function () {
        $(this).attr("src", "/Image/services_ES.gif");
    });

    $(".AboutUs_ES").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_ES.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_ES.gif");
    });

    $(".NewsandEvents_ES").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_ES.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_ES.gif");
    });

    $(".ContactUs_ES").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_ES.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_ES.gif");
    });
	
	/*FR*/
	$(".Home_FR").hover(function () {
        $(this).attr("src", "/Image/home_hover_FR.gif");
    }, function () {
        $(this).attr("src", "/Image/home_FR.gif");
    });

    $(".Services_FR").hover(function () {
        $(this).attr("src", "/Image/services_hover_FR.gif");
    }, function () {
        $(this).attr("src", "/Image/services_FR.gif");
    });

    $(".AboutUs_FR").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_FR.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_FR.gif");
    });

    $(".NewsandEvents_FR").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_FR.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_FR.gif");
    });

    $(".ContactUs_FR").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_FR.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_FR.gif");
    });
	
	/*IT*/
	$(".Home_IT").hover(function () {
        $(this).attr("src", "/Image/home_hover_IT.gif");
    }, function () {
        $(this).attr("src", "/Image/home_IT.gif");
    });

    $(".Services_IT").hover(function () {
        $(this).attr("src", "/Image/services_hover_IT.gif");
    }, function () {
        $(this).attr("src", "/Image/services_IT.gif");
    });

    $(".AboutUs_IT").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_IT.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_IT.gif");
    });

    $(".NewsandEvents_IT").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_IT.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_IT.gif");
    });

    $(".ContactUs_IT").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_IT.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_IT.gif");
    });
	
	/*NL*/
	$(".Home_NL").hover(function () {
        $(this).attr("src", "/Image/home_hover_NL.gif");
    }, function () {
        $(this).attr("src", "/Image/home_NL.gif");
    });

    $(".Services_NL").hover(function () {
        $(this).attr("src", "/Image/services_hover_NL.gif");
    }, function () {
        $(this).attr("src", "/Image/services_NL.gif");
    });

    $(".AboutUs_NL").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_NL.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_NL.gif");
    });

    $(".NewsandEvents_NL").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_NL.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_NL.gif");
    });

    $(".ContactUs_NL").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_NL.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_NL.gif");
    });
	
	/*PL*/
	$(".Home_PL").hover(function () {
        $(this).attr("src", "/Image/home_hover_PL.gif");
    }, function () {
        $(this).attr("src", "/Image/home_PL.gif");
    });

    $(".Services_PL").hover(function () {
        $(this).attr("src", "/Image/services_hover_PL.gif");
    }, function () {
        $(this).attr("src", "/Image/services_PL.gif");
    });

    $(".AboutUs_PL").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_PL.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_PL.gif");
    });

    $(".NewsandEvents_PL").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_PL.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_PL.gif");
    });

    $(".ContactUs_PL").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_PL.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_PL.gif");
    });
	
	/*PT*/
	$(".Home_PT").hover(function () {
        $(this).attr("src", "/Image/home_hover_PT.gif");
    }, function () {
        $(this).attr("src", "/Image/home_PT.gif");
    });

    $(".Services_PT").hover(function () {
        $(this).attr("src", "/Image/services_hover_PT.gif");
    }, function () {
        $(this).attr("src", "/Image/services_PT.gif");
    });

    $(".AboutUs_PT").hover(function () {
        $(this).attr("src", "/Image/aboutus_hover_PT.gif");
    }, function () {
        $(this).attr("src", "/Image/aboutus_PT.gif");
    });

    $(".NewsandEvents_PT").hover(function () {
        $(this).attr("src", "/Image/newsevents_hover_PT.gif");
    }, function () {
        $(this).attr("src", "/Image/newsevents_PT.gif");
    });

    $(".ContactUs_PT").hover(function () {
        $(this).attr("src", "/Image/contactus_hover_PT.gif");
    }, function () {
        $(this).attr("src", "/Image/contactus_PT.gif");
    });

});
