// JavaScript Document


/* -------------------------------------------------------------------------------------------
*	Menu and Sub menu
*  -----------------------------------------------------------------------------------------*/
$("ul.subnav").parent().find("a").attr('class', 'subnavbtn');

$("ul.topnav li a.subnavbtn").hover(
	function() {
		$(this).parent().find("ul.subnav").slideDown('fast').show(); //Drop down the subnav on click  

		$(this).parent().hover(
			function() {}, 
			function(){  
				$(this).parent().find("ul.subnav").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up  
			}
		);  
	},
	function(){}
)


$(".search-by-cate SPAN").hover(
	function() {
		$(this).parent().find("ul").slideDown('fast').show(); //Drop down the subnav on click  

		$(this).parent().hover(
			function() {}, 
			function(){  
				$(this).parent().find("ul").slideUp('fast'); //When the mouse hovers out of the subnav, move it back up  
			}
		);
	},
	function(){}
)
	
	
	
/* -------------------------------------------------------------------------------------------
*	Navigator search input 
*  -----------------------------------------------------------------------------------------*/
// on focus
$("#g_tbx_search_word").focus(function(){
	if (this.value == this.defaultValue){
		this.value = "";
	}else{
		this.select();
	}
});

// onblur
$('#g_tbx_search_word').blur(function() { 
	if ($.trim(this.value) == ''){  
		this.value = (this.defaultValue ? this.defaultValue : '');  
	}  
});
