﻿
$(document).ready(function()
{

            $(".ui-fade-rollover").each(function(){
	            var wrapper = "<div style='display: block; height: auto; width: auto; background-repeat: no-repeat; background-image: url(" + $(this).attr("src").replace("_off", "_on") + ")'></div>";
	            if($(this).parent().get(0).tagName == "A")
                {
		            $(this).parent().wrap(wrapper);
	            }
	            else
                {
		            $(this).wrap(wrapper);
                }
            
	            $(this).bind("mouseenter", function(e){
	                $(this).stop().animate({opacity: 0}, 300);
});
	            $(this).bind("mouseleave", function(e){
	                $(this).stop().animate({opacity: 1}, 300);
	            });
            });

});




var curCont;

var opts =
  // horizontal Dock with images expanding downwards in the vertical axis...
{ align: 'bottom'
, size: 50
, labels: false
, duration: 200
, distance: 68
};


	$(document).ready(function(){
		
		
		if(defaultHomeImage == null) return;
		
			$('#home_Menu').jqDock(opts);
			if(defaultHomeImage != '')
			{
			    changeContent(defaultHomeImage);
			}
			if(counter == 1)
			{
			    changeContent(7)
			}
			else
			{
			    changeContent(Math.floor(Math.random()*7) + 1)
			}
			
		});	
	
	

	function changeContent(in_val)
	{

		
		if(curCont != null)
		{
			$("#Home_Content" + curCont).fadeOut(300, function(){
					$("#Home_Content" + in_val).fadeIn(300);
				});
		}
		else
		{

			$("#Home_Content" + in_val).fadeIn(300);
		}
			curCont = in_val;
	}
	
	