$(document).ready(function()
{
	slide("#sliding-navigation", 12, 5, 150, .8);
	
	var DhoniShow = function(element, options) {
  if(this.elementsSet(element)){
    this.current_index = 0;
    this.queue = new this.queue();
    this.dom = new this.dom(element, this);
    this.options = jQuery.extend(jQuery.extend(this.defaultOptions(), options), new this.options(element));
    
    this.queue.invokeModulesQueue(this, this.options);
  }
};

});

function slide(navigation_id, pad_out, pad_in, time, multiplier)
{
	// creates the target paths
	var list_elements = navigation_id + " li.sliding-element";
	var link_elements = list_elements //+ " a";
	var link_subelements = list_elements + " ul li";
	var link_usubelements = link_subelements  + " ul li";
	// initiates the timer used for the sliding animation
	var timer = 0;
	
	// creates the slide animation for all list elements 
	$(list_elements).each(function(i)
	{
		// margin left = - ([width of element] + [total vertical padding of element])
		$(this).css("margin-left","-180px");
		// updates timer
		timer = (timer*multiplier + time);
		$(this).animate({ marginLeft: "0" }, timer);
		$(this).animate({ marginLeft: "6px" }, timer);
		$(this).animate({ marginLeft: "0" }, timer);
	});

	// creates the hover-slide effect for all link elements 		
	$(list_elements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).find("a").animate({ paddingTop: pad_out, paddingBottom: pad_out}, 150);
			$(this).find("#list1").css("left", "75px").show('normal');
			$(this).find("#list2").css("left", "155px").show('normal')//.fadeIn('slow');
			
		},		
		function()
		{
			$(this).find("#list1").hide('fast')//.fadeOut('slow');
			$(this).find("#list2").hide('fast')//.fadeOut('slow');
			$(this).find("a").animate({ paddingTop: pad_in, paddingBottom: pad_in}, 150);
		});
	});
	$(link_subelements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).find("#sublist1").fadeIn('easin')//.show('normal')//;
			$(this).find("#sublist2").css("top", "42px").show('normal')//.fadeIn('slow');
			$(this).find("#sublist3").css("top", "84px").show('normal');
			$(this).find("#sublist4").css("top", "168px").show('normal');			
		},		
		function()
		{
			$(this).find("#sublist4").hide('fast')//.fadeOut('slow');
			$(this).find("#sublist3").hide('fast')//.fadeOut('slow');
			$(this).find("#sublist2").hide('fast')//.fadeOut('slow');
			$(this).find("#sublist1").hide('fast')//.fadeOut('slow');
		});
	});
	$(link_usubelements).each(function(i)
	{
		$(this).hover(
		function()
		{
			$(this).find("#sublist5").show('normal');
		},		
		function()
		{
			$(this).find("#sublist5").hide('fast')//.fadeOut('slow');
		});	
	});
}
