$(document).ready(function() {
  if ($("#overlay").length > 0) {
    //$("#overlay").hide();
    $("html").css("overflow", "hidden");
    $("#overlay").height($(document).height());
    $("#overlay").fadeIn();
    $("#oc").click(function() {
      return false;
    })
    $("#overlay, #ocl").click(function() {
      $("#overlay").remove();
      $("html").css("overflow", "auto");
    })
  }
  
  $("#stock tr:not(.table-header)").hover(function() {
  	$(this).addClass("highlight");
    $(this).next(".second").addClass("highlight");
    $(this).prev(".first").addClass("highlight");
  },
	function() {
    $(this).removeClass("highlight");
    $(this).next(".second").removeClass("highlight");
    $(this).prev(".first").removeClass("highlight");
	})

  $("#stock tr:not(.table-header)").click(function() {
    if ($(this).hasClass("first")) {
      var pathLink = $(this).find("a").attr("href");
    }
    else {
      var pathLink = $(this).prev().find("a").attr("href");
    }

    window.location.href = pathLink;
  })

	$("#nav-global li").hover(function() {
		$(this).addClass("hover");
		$(this).find("ul").show();
	},
	function() {
		$(this).removeClass("hover");
		$(this).find("ul").hide();
	});

  $("input.clearLabel").attr("value", ($("input.clearLabel").attr("rel")));

  $("input.clearLabel").click(function() {
    if ($(this).attr("value") == $(this).attr("rel")) {
      $(this).attr("value", "");
    }
  })

  $("input.clearLabel").blur(function() {
    if ($(this).attr("value") == "") {
      $(this).attr("value", ($("input.clearLabel").attr("rel")));
    }
  })

  $("#nav-global li").each(function() {
    if ($(this).find("ul").length > 0) {
      $(this).children("a").css("cursor", "default");

      $(this).children("a").click(function() {
        return false;
      })
    }
  })

  $("#extra-loc").hover(function() {
    $("#extra-loc-2").show();
  }, 
  function() {
    $("#extra-loc-2").hide();
  })

  $("#promobox a").hover(function() {
    $(".promo-car-info-sidebar").show();
  },
  function() {
    $(".promo-car-info-sidebar").hide();
  })

})


function load() {
  
}
