/*Recently:jiafei Updated Date: 2008-12-31 14:22*/
var duk = {};
duk.__init__ = function() {
	duk.initSearch();
}





duk._initSearchBox = function() {
	jQuery("#search_keywords").toggleVal( {
		focusClass :"input_sb2",
		populateFrom :"alt"
	}).keypress( function(e) {
		if (e.which == 13) {
			duk.search(jQuery("#search_keywords").val(), "search_all");
			jQuery("#search_keywords").blur();
		}
	});
	
	jQuery("#searchoption").click( function(e) {
		var text = jQuery("#search_keywords").val();
		var type = e.target.className;
		duk.search(text, type);
	});
}

duk.initSecondaryNavigation = function() {
	duk._initSearchBox();
	jQuery("#brandopt span").css("cursor", "pointer");
	jQuery("#brandopt span, #brandopt a:first").click( function(e) {
		var text = jQuery("#search_keywords").val();
		if (text == "ÇëÊäÈëËÑË÷¹Ø¼ü´Ê...") {
			alert("ÊäÈëËÑË÷¹Ø¼ü´Ê...");
			return ;
		}
		duk.search(text, "search_all");
	});
	
//	jQuery("#brandopt a, #searchoption").bind('mouseenter', function(){
//		jQuery("#brandopt").children(":first").addClass("mouseover");
//		jQuery("#searchoption").show();
//	});
//	
//	jQuery("#brandopt, #searchoption").bind('mouseleave', function(){
//		jQuery(this).prev().removeClass("mouseover");
//		jQuery("#searchoption").hide();
//	});

	jQuery("#pbobj a, #pbtar").bind('mouseenter', function(){
		jQuery("#pbtar").show();
		jQuery("#pbobj a").addClass('mouseover');
	});
	
	jQuery("#pbobj, #pbtar").bind('mouseleave', function(){
		jQuery("#pbtar").hide();
		jQuery("#pbobj a").removeClass('mouseover');
	});
	
	jQuery("#ppobj a, #pptar").bind('mouseenter', function(){
		jQuery("#ppobj a").addClass('mouseover');
		jQuery("#pptar").show();
	});
	
	jQuery("#ppobj, #pptar").bind('mouseleave', function(){
		jQuery("#ppobj a").removeClass('mouseover');
		jQuery("#pptar").hide();
	});


	
	jQuery('#notice').cycle({
	  	pause:1,
	  	timeout: 4000,
	  	speed: 400,
	  	height: 8,
	  	fx: 'scrollUp'
	});
	jQuery('#notice1').cycle({
	  	pause:1,
	  	timeout: 4000,
	  	speed: 400,
	  	height: 8,
	  	fx: 'scrollUp'
	});
}



