google.setOnLoadCallback(function() {
$(document).ready(function() {
        initRotator();
    });
});

var slideEq = 0;
function initRotator(){
	$(".rotatorContent .slide:not(:first)").hide();
	$(".rotatorMenu ul li").hover(function(){
		slideEq = $(this).prevAll().length;
		$(".rotatorContent .slide").hide().eq(slideEq).show();
		$(".rotatorMenu ul li").removeClass("current");
		$(this).addClass("current");
	}, function(){ });
	
	$(".rotatorMenu ul li").click(function(){
		if(window.location.href.indexOf("index.htm") != -1)
		{
			window.location = window.location.href.replace("index.htm",$(".rotatorContent .slide").eq(slideEq).find("a").attr("href"));
		}
		else
		{
			if(window.location.href.charAt(window.location.href.length) != "/")
			{
			window.location = window.location.href + $(".rotatorContent .slide").eq(slideEq).find("a").attr("href");
			}
			else
			{
				window.location = window.location.href + "/" + $(".rotatorContent .slide").eq(slideEq).find("a").attr("href");
			}
		}
	});
}
