var ie6 = (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) == 4 && navigator.appVersion.indexOf("MSIE 6.0") != -1);

$(document).ready(function()
{
  $('.listing-details > .info > .left > ul > li > .tooltip-content').each(function()
  {
    if (jQuery.browser.msie && ie6)
    {
      var a = $(this).prev();
      var tooltip = $(this);
      $(this).slideUp(0);
      $(a).toggle(function()
      {
        tooltip.slideDown(1000);
      }, function()
      {
        tooltip.slideUp(1000);
      });
    }
    else
    {
      var a = $(this).prev();
      $(a).tooltip(
      {
        position: 'top right',
        offset: [ -156, -480 ],
        events: {
          def: 'click, mouseout'
        },
        effect: 'fade'
      });
    }
    $(a).click(function(){return false;});
  });
});

$(window).ready(function() {
  $('.scrollable-content').height($('.scrollable-content .items').height());
  $('.scrollable-content').scrollable({size:1,clickable:false}).navigator({indexed:true, navi: ".navi-content"});
  if($('.navi-content').children().length == 1) {
    $('.navi-content').css({visibility:"hidden"});
  }
  $('.navi-content').children().each(function(i){
    var elements = $(this).children().children();
    if(elements.length == 1) {
      $(this).children().addClass('one-item');
    }
  });
});
