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

$(
	function(){
	
	//--------------------------------------------------------------------------//
	// 検索結果表示用
	//--------------------------------------------------------------------------//	

		$("a.products_result").click(function(){
			var id = $(this).attr('href');
			$("form.products_form input[name='products_id']").val(id);
			$("form.products_form input[name='exeMode']").val('searchresult');
			$("form.products_form").trigger('submit');
			// 元にもどす
			$("form.products_form input[name='exeMode']").val('searchlist');
			return false;
		});

		$("a#checkdetall").click(function(){
			$("form.detail_form").trigger('submit');
			return false;
		});

		$("input#btn_reset").click(function(){
			$('form.products_form').clearForm();
			return false;
		});
		$.fn.clearForm = function() {
			return this.each(function() { 
				var type = this.type, tag = this.tagName.toLowerCase(); 
			if (tag == 'form') 
				return $(':input',this).clearForm(); 
			if (type == 'text' || type == 'password' || tag == 'textarea') 
				this.value = ''; 
			else if (type == 'checkbox' || type == 'radio') 
				this.checked = false; 
			else if (tag == 'select') 
				this.selectedIndex = -1; 
			});
		};
		scrollToResult();
	}
);
function scrollToResult(){
	if($('#resultsearch').length){
		var targetOffset = $('#resultsearch').offset().top;
		$('html,body').animate({scrollTop: targetOffset -50 }, 0);
	}
}

