// JavaScript Document

jQuery(document).ready(function() {
			
	//png fix
	jQuery('img[@src$=.png], .ad a, .ad .btnBtm').IEPNGHack();
		
	
	// default setting
	var current = "aboutDefenceHealth";
	
	jQuery("#homeFeatureNav li").click(function() {									   		
		
		jQuery("#homeFeatureNav li").removeClass("on");
		jQuery(this).addClass("on");
		
		//get class of link
		var getClass = jQuery("a", this).attr("class");
		
		// set the current one to disappear
		jQuery("#" + current).css({ marginLeft:-9999});
		//$("#" + current).animate({ marginLeft: -9999}, 1000, '');
		
		// set new current
		current = getClass;
		
		// set the new one to appear
		jQuery("#" + getClass).css({ marginLeft:0 });
		//$("#" + getClass).animate({ marginLeft: 0}, 1000, '');
		
		return false;
	});
	
	/* javascript list over to include IE6 (to counter li:hover) */
	
	jQuery("#subNav li").hover(function() {
		jQuery(this).addClass('over');
	},function() {
		jQuery(this).removeClass('over');
	});
		
	// add class to ones with 3rd level
	jQuery('#mainNav ul li ul').each( function(){
		jQuery('ul', this).parent('li').addClass('navExpand');
	});
	
	// drop down
	jQuery('#mainNav li').hover( function(){
		jQuery('ul', this).css({display: 'block'});
		jQuery('ul li ul', this).css({display: 'none'});
	}, function(){
		jQuery('ul', this).css({display: 'none'});
	});

  
  // Popup the right-most menu's 3rd levels on the left, not the right.	
  jQuery('#mainNav > ul > li:last > ul > li.navExpand > ul').addClass('left');
		
	// top hospitals premium table
	jQuery('.premiums').toggle( function(){
		jQuery(this).addClass('close');
		jQuery(this).parents('tr').nextAll().each( function(){
			$(this).css({display:'none'});
		});
	}, function(){
		jQuery(this).removeClass('close');
		jQuery(this).parents('tr').nextAll().each( function(){
			$(this).css({display:''});
		});
	});
	
	
	// page scroller
	

});