// JavaScript Document
$(document).ready(function() {
	// top pull down
	$('li.mm_s2 > ul').css('opacity',0);
	
	$('li.mm_s2').hover(
		function() { $(this).children('ul').stop(true,false).fadeTo(150, 1); },
		function() { $(this).children('ul').stop(true,false).delay(300).fadeTo(150, 0).hide(0); }
	);
	
	/* Focus Input */
	var $inputs;
	$("input#searchfield").focus(function() {
        if($(this).val() == $(this).attr('defaultValue')){
            $(this).val('');
		}
	}).blur(function() {
        if(jQuery.trim($(this).val()) == "") {
            $(this).val($(this).attr('defaultValue'));
        }
    });
	
	$('#gotop a').click(function () {
		$(this).blur();
        $('html,body').animate({ scrollTop: 0 }, 550, 'easeOutQuart');
		return false;
    });
});

jQuery.easing.easeOutQuart = function (x, t, b, c, d) {return -c * ((t=t/d-1)*t*t*t - 1) + b;}
