$(document).ready(function() {
	$('#nav li').each(function() {
		$(this).attr('href', $(this).find('a').attr('href'));
		$(this).find('a').remove();
		
		$(this).bind('click', function() {
			location.href = $(this).attr('href');
		})
	});
	
  $('#nav li').hover(function() {
    $(this).toggleClass('hover');
  }, function() {
    $(this).toggleClass('hover');
  });
  
  $('.merchandise').add('.buy_now').add('.iphone').hover(function() {
    $(this).toggleClass('hover');
  }, function() {
    $(this).toggleClass('hover');
  });

  $("img.water-buffalo").hover(function() { $(this).attr('src', 'images/water_buffalo_logo_hover.png'); }, 
  function() { $(this).attr('src', 'images/water_buffalo_logo.png'); } );
  
  $("img.s1management").hover(function() { $(this).attr('src', 'images/s1logo_hover.png'); }, 
  function() { $(this).attr('src', 'images/s1logo.png'); } );
  
  $("img.hover").hover(function() { $(this).data('oldsrc', $(this).attr('src')); $(this).attr('src', $(this).attr('alt')); }, 
  function() { $(this).attr('src', $(this).data('oldsrc') ); } );
  
  if($.browser.firefox()) {
    $("link[rel=stylesheet][title=browser]").attr({href : "stylesheets/ff.css"});
  }
  else if($.browser.safari()) {
    $("link[rel=stylesheet][title=browser]").attr({href : "stylesheets/saf.css"});
  }
  else if( $.browser.msie() && $.browser.version.number() == 6 ) {
		location.href = 'ie6.html';
  }
	
	$('ul.photos.list img').each(function() {
	  $(this).attr('src', $(this).attr('file'));
	});
	
	$('ul.photos.list li a').lightBox();
});


var current_anker = 1;

function up(overall) {
  if(current_anker > 1) {
    current_anker = current_anker-1;
    $('.text').scrollTo( $('#text'+current_anker), 800 );
  }
}

function down(overall) {
  if(current_anker < (overall)) {
    current_anker = current_anker+1;
    $('.text').scrollTo( $('#text'+current_anker), 800 );
  }
}