jQuery.noConflict();

jQuery(document).ready(function($) {
  
  var isIE6 = $.browser.msie && parseFloat($.browser.version) < 7;
  var isiOS = isiPhone();
  
  if (!isIE6 && !isiOS) {
    adjustHeight(800);
    
    $(window).resize(function() {
      adjustHeight(800);
    });
  }
  
  if (isiOS) {
    $('#footer').css('position', 'relative');
  }
  
  function isiPhone() {
    return (
      (navigator.platform.indexOf("iPhone") != -1) ||
      (navigator.platform.indexOf("iPad") != -1) ||
      (navigator.platform.indexOf("iPod") != -1)
    );
  }
  
  function adjustHeight(max) {
    var height = $('body').height();
    var diff = height - max;
    if (height > max) {
      $('#footer').css('bottom', diff);
      $('#main').css('padding-bottom', 80 + diff);
      $('#pad').css({'display' : 'block', 'height' : diff + 1});
    } else {
      $('#footer').css('bottom', 0);
      $('#main').css('padding-bottom', 80);
      $('#pad').css('display', 'none');
    }
  }
  
  $('<span class="gt">&gt;</span> ').prependTo('.links-menu ul li a');
  
  $("ul.login_form label").inFieldLabels({
    fadeOpacity: 0.2,
    fadeDuration: 200
  });
  
});
