$().ready(function() {  
  //find out the current open index
  var open_index = 0;
  $('.colournav_wrapper ul li').each(function(i){
    if($(this).hasClass('open')){
      open_index = i;
    }
  });
  
	$('.colournav_wrapper ul').kwicks({
	   max: 320, 
	   duration: 400, 
	   sticky: true,
	   defaultKwick: open_index,
	   spacing: -20,
	   easing: 'easeInOutCubic', 
	   complete: 'colournav_mouseout_callback'
	});

  //slide open the current one
  //setTimeout( function (){$('.colournav_wrapper ul li.open a').trigger('mouseover')}, 500);
	
	//keep the current colour open, when mouseout
	$('.colournav_wrapper ul').mouseout(function(){
	  $('.colournav_wrapper ul li.open a').trigger('mouseover');	  
	});	
});