$(document).ready(function(){
  $("ul#main-menu li").click(function() {
    var hrefValue = $(this).children().attr("href");
    $(location).attr('href',hrefValue);
    });    
                $('.locationLink').click(function (e) {
                  e.preventDefault();
                  $('.locationLink').hide();
                  $('.location').show();
              });
});

$(document).ready(function(){
  var li = $("#quotes").find('div');
  var maxQuotesHeight = 0;

  li.each(function(){
    var el = $(this);
    var elHeight = el.height();
    if (maxQuotesHeight < elHeight) {
      maxQuotesHeight = elHeight;
    }
  });
  $(".quotes_area").css('height', maxQuotesHeight + 30);
}); 

$(function(){
  
  $('.zoom').each(function(){
    var thisWidth = $(this).width();
    var thisHeight = $(this).height();
    var bigWidth = 618;
    var bigHeight = bigWidth * thisHeight / thisWidth;
    var smallWidth = 193;
    var smallHeight = smallWidth * thisHeight / thisWidth; 
    $(this).width(smallWidth).height(smallHeight);
  
    $(this).hover(
      
      function(){
        
        $(this).stop().animate({width: bigWidth, height: bigHeight, right:"0", top:"0"}, 400);
      },
      function(){
        $(this).stop().animate({width: smallWidth, height: smallHeight, right:"0", top:"0"}, 400);
      }
      
    );
  });
});


$(function(){
  $('#gallery a:first-child').addClass("show");
});

jQuery.fn.random = function() {
    var randomIndex = Math.floor(Math.random() * this.length);  
    return jQuery(this[randomIndex]);
};

$(document).ready(function()
 {
     setupRotator();
 });
 function setupRotator()
 {
     if($('.textItem').length > 1)
     {
         $('.textItem').random().addClass('current').fadeIn(1);
         setInterval('textRotate()', 20000);
     }
 }
function textRotate()
{
    var currentQoute = $('#quotes > .current');
    if(currentQoute.next().length == 0)
    {
        currentQoute.removeClass('current').fadeOut(1);
        $('.textItem').random().addClass('current').fadeIn(1);
    }
    else
    {
        currentQoute.removeClass('current').fadeOut(1);
        currentQoute.next().addClass('current').fadeIn(1);
    }
}
//


$(document).ready(function()
 {
     setupAdsRotator();
 });
 function setupAdsRotator()
 {
     if($('.adsItem').length > 1)
     {
         $('.adsItem').random().addClass('current').fadeIn(100);
         setInterval('adsRotate()', 10000);
     }
 }
function adsRotate()
{
    var currentAd = $('#ads > .current');
    if(currentAd.next().length == 0)
    {
        currentAd.removeClass('current').fadeOut(1000);
        $('.adsItem').random().addClass('current').fadeIn(100);
    }
    else
    {
        currentAd.removeClass('current').fadeOut(1000);
        currentAd.next().addClass('current').fadeIn(100);
    }
}

/* $(function(){
  if($.browser.msie){
    $('select').focus(function(){
      $(this).parent().parent().addClass('ie_select');
    });
    $('select').blur(function(){
      $(this).parent().parent().removeClass('ie_select');
    });
  }
}); */




