$(document).ready(function() {



	$("a[rel='external']").click( function() {
		$(this).attr("target","_blank");				
	});


function showNav(){	
		$(this).addClass('hovering');
		$(this).find('ul').slideDown('slow').show();
}
function hideNav(){
		$(this).find('ul').slideUp('slow').show();
		$(this).removeClass('hovering');
}

//$("ul#navigation li").hoverIntent( showNav , hideNav );
// advanced usage receives configuration object only

$("#hmenu-center ul li").hoverIntent({
	sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)
	interval: 100,   // number = milliseconds of polling interval
	over: showNav,  // function = onMouseOver callback (required)
	timeout: 200,   // number = milliseconds delay before onMouseOut function call
	out: hideNav    // function = onMouseOut callback (required)
 });


$('body').append('<div id="loading"></div>');
$("#loading").ajaxStart(
	function() {
	var loadingtop = ($(window).scrollTop()+4);
	$(this).css({top:loadingtop+"px"});
	$(this).html("Processing....").show();
	}
);
$("#loading").ajaxStop(
	function() {
	$(this).html("").hide();
}
);

/*--------Product Catalog Page -------------*/
	$("#orderby").change(function() {
		$("#OrderByForm").submit();							  
	});
	$("#changeorder").click(function() {
		var imagesrc = $(this).children('img').attr('src');
		if( imagesrc == 'images/sort_asc.png' ) {
			$("#DescOrder").val("DESC");	
		} else {
			$("#DescOrder").val("ASC");	
		}
		$("#OrderByForm").submit();	
	});
/*-------------------------------------------*/

$("#keyword").focus(function() {
	if ( $(this).val() == 'Search..' ) {
		$(this).val("");	
	}
});
$("#keyword").focusout(function() {
	if ( $(this).val() == '' ) {
		$(this).val("Search..");	
	}
});


});
