var $last_Dropped;
jQuery(document).ready(function()
{       
 
 jQuery("#mainNav ul li").hover(
	function()
	{
	  if($last_Dropped != null && jQuery(this) != $last_Dropped)
        $last_Dropped.css("display","");
      
      showSubNav(this);
      $last_Dropped = jQuery(this);  
	},
	function()
	{
		jQuery("#" + this.id + "subNav").stop().animate({opacity:"0", top:"-120px"}, 300, function(){ jQuery("#" + this.id + "subNav").css({"display":"", "top":""}); } );
	});
	
	jQuery("#logoImage").click(function(){
	
    window.location = "http://alpha.atomni.net/";

	});

	jQuery("#logoImage").hover(
	function(){
    $(this).addClass("hover");
	},
	function(){
    $(this).removeClass("hover");
	});
	
	jQuery(".subNav").hover(
	function()
        {
		jQuery(this).stop().css("display","block").animate({opacity:"1", top:"-5px"}, 300);
	},
	function()
        {
	        jQuery(this).stop().animate({opacity:"0", top:"-120px"}, 300, function(){ jQuery(this).css({"display":"", "top":""}); } );
        });
});


function showSubNav(sender)
{
      jQuery("#" + sender.id + "subNav").stop().css("display","block").animate({opacity:"1", top:"-5px"}, 300);
}
function selectAccordion(index)
{
  jQuery.post("<?=jQueryinitialPop?>" + "/navigateToAccordion", { "navElement" : index },
       function(data){
       if(data !=null)
       {
        var index = data;
        jQuery("#interiorList a")[index].click();
        }
       }, "json");
}
