$(document).ready(function(){ //hide other menu level $("#menu.display-1 li.level-2 a, #menu.display-2 li.level-1 a").css({ top: 42 }); //show menu $("#menu li a").show(); //switch menu levels $("#menu li.switch a") .click(function(){ $(this).blur(); if($("#menu").hasClass("display-1")) { hideClass = 1; showClass = 2; } else if($("#menu").hasClass("display-2")) { hideClass = 2; showClass = 1; } else { return false; } $("#menu") .addClass("display-"+showClass) .removeClass("display-"+hideClass); $(this).parent().siblings(".level-"+hideClass).find("a").each(function(){ $(this).stop().animate({ top: 42 }, 300); }); $(this).parent().siblings(".level-"+showClass).find("a").each(function(){ $(this).stop().animate({ top: 0 }, 300); }); return false; }); //nifty box that slides with the mouse in the menu $("#menu").after("
"); $("#menubox").css({ opacity: 0 }); $("#menu li a") .mouseover(function(){ $("#menubox").stop().animate({ opacity: .07, width: $(this).width(), left: $(this).css("left") }, 300); }) .mouseout(function(){ $("#menubox").stop().animate({ opacity: 0 }, 300); }); //color swatch $("#colorswatch input") .mouseover(function(){ $("#colorswatch img").remove(); $("#colorswatch").prepend("
");
$("#colorswatch img").fadeOut(1).css({ right: $(this).css("right") }).fadeIn(300);
})
.mouseout(function(){
$("#colorswatch img").stop().fadeOut(300);
});
//images
$("#content .img img").css({ opacity: .01 });
for(i=0; i<$("#content .img img").length; i++) {
$("#content .img img:eq("+i+")").animate({ opacity: .01 }, i*200).animate({ opacity: 1}, 1000);
}
//buttons
$("button, .submit input")
.mouseover(function(){ $(this).addClass("hover"); })
.mouseout(function(){ $(this).removeClass("hover"); });
//link boxes
$(".page .linkbox").each(function(){
for(i=0; i<$(this).find("li a").length; i++) {
$(this).find("li a:eq("+i+")").parent().css({ display: "block", height: $(this).find("li a:eq("+i+")").height()+10 });
$(this).find("li a:eq("+i+")").hide().animate({ borderWidth: 0 }, i*50).show(400, function(){
$(this)
.mouseover(function(){ $(this).stop().css({ opacity: 1 }); })
.mouseout(function(){ $(this).stop().animate({ opacity: .7 }, 200).animate({ opacity: 1 }, 400); });
});
}
});
});