/*
$(document).ready(function() {
    $('a.info').click(function(){
    	if(document.getElementById('desc_id').style.display == 'table'){
    		$('table.desc').fadeOut('normal');        
    	}else{
        	$('table.desc').fadeIn('slow');
    	}
        return false;
    });
});
*/
/*
$(document).ready(function() {
    
    //photo strip navigation
    var container = $('ul.photo-strip');
    var links = $('div.nav.strip a');
    var x = 100; //movement amount
    var n = 8; //number of visible items
    var i = $(container).children('li').length; //all items
    var max_pos = Math.floor(i/n) * x;
    
    $(links).each(function(){
        var link = this;
        $(link).click(function(){
            var pos = parseInt($(container).css('left'));
            
            if($(link).attr('class') == 'left' && pos != 0){                
                $(container).animate({left: pos + x}, 700);
            } else if($(link).attr('class') == 'right' && Math.abs(pos) != max_pos){
                $(container).animate({left: pos - x}, 700);
            }
            
            return false;
        }); 
    });
});
*/

$(function(){
  //Get our elements for faster access and set overlay width
  var div = $('div.sc_menu'),
               ul = $('ul.sc_menu'),
               // unordered list's left margin
               ulPadding = 15;

  //Get menu width
  var divWidth = div.width();

  //Remove scrollbars
  div.css({overflow: 'hidden'});

  //Find last image container
  var lastLi = ul.find('li:last-child');

  //When user move mouse over menu
  div.mousemove(function(e){

    //As images are loaded ul width increases,
    //so we recalculate it each time
    var ulWidth = lastLi[0].offsetLeft + lastLi.outerWidth() + ulPadding;

    var left = (e.pageX - div.offset().left) * (ulWidth-divWidth) / divWidth;
    div.scrollLeft(left);
  });
});

