jQuery.fx.prototype.originalCustom = jQuery.fx.prototype.custom; 
jQuery.fx.prototype.custom = function(from,to,unit) { 
        if (this.prop=='height') { 
                to = to || 1; 
                from = from || 1; 
        } 
        this.originalCustom(from,to,unit); 
}

$(function(){
	$('.inner-menu').hide();
	/*$('.menu-group').click(
		function(evt) {
			var target = $(this).attr('id');
			$('.inner-menu:visible').not('#'+target+'-content').slideUp();
			$('.menu-group').removeClass('menu-group-active');
			$('#'+target).addClass('menu-group-active');
			if (target=='hang-tabs'||target=='self-adhesive-rigid-injection-hook') {
				$('#hang-tabs').addClass('menu-group-active');
				$('#self-adhesive-rigid-injection-hook').addClass('menu-group-active');
			}
			$('#'+target+'-content').slideDown();
		}
	)*/
	
	var currentdir = $('#currentdir').val();
	if (currentdir=='') {
		currentdir ='.menu-group:first';
	} else {
		currentdir = '#'+currentdir;
	};
	$(currentdir).click(
		function(evt) {
			var target = $(this).attr('id');
			$('.inner-menu:visible').not('#'+target+'-content').slideUp();
			$('.menu-group').removeClass('menu-group-active');
			$('#'+target).addClass('menu-group-active');
			if (target=='hang-tab---self-adhesive-hooks'||target=='rigid-injection-hooks-with-adhesive') {
				$('#hang-tabs').addClass('menu-group-active');
				$('#rigid-injection-hooks-with-adhesive').addClass('menu-group-active');
			}
			$('#'+target+'-content').slideDown();
		}
	);
	$(currentdir).trigger('click');
	
	var currentcat = $('#currentcat').val();
	if (currentcat=='') {
		currentcat ='';
	} else {
		currentcat = '#'+currentcat;
	};
	$(currentcat).css('font-weight', 'bold');
	/*$('.menu-group2').click(
		function(evt) {
			var target = $(this).attr('id');
			$('.inner-menu:visible').not('#'+target+'-content').slideUp();
			$('#'+target+'-content').slideDown();
		}
	)*/
	$('#keyword').focus(
		function(evt) {
			if ($('#keyword').val()=='-- Enter Keywords or Item No --'){
				$('#keyword').val('');
			}
			if ($('#keyword').val()=='-- 請輸入關鍵字或產品編號 --'){
				$('#keyword').val(' ');
				$('#keyword').select();
			}
		}
	)
	$('#keyword').blur(
		function(evt) {
			if ($('#keyword').val()==''){
				$('#keyword').val('-- Enter Keywords or Item No --');
			}
			if ($('#keyword').val()==' '){
				$('#keyword').val('-- 請輸入關鍵字或產品編號 --');
			}
		}
	)
})

function checkform() {
	alert('abc');
	return false;
}