// JavaScript Document

// header product menu init
YAHOO.util.Event.onContentReady("product-nav", function () {
	//	Instantiate a MenuBar, passing in the id of the HTML element 
	//	representing the MenuBar.
    var oMenuBar = new YAHOO.widget.MenuBar("product-nav", {
			autosubmenudisplay: true,
			showdelay: 0,
			hidedelay: 750,  
			lazyload: true });
    // Render the MenuBar instance
    oMenuBar.render();
});

// header corporate menu init
YAHOO.util.Event.onContentReady("corporate-nav", function () {
	//	Instantiate a MenuBar, passing in the id of the HTML element 
	//	representing the MenuBar.
	var oMenuBar = new YAHOO.widget.MenuBar("corporate-nav", {
			autosubmenudisplay: true,
			showdelay: 0,
			hidedelay: 750,
			lazyload: true });
	oMenuBar.render();
});

// Site Search watermark onfocus show/hide init
YAHOO.util.Event.onContentReady("site-search", function () {
	YAHOO.util.Event.on(this, "focus", function(e) {
		YAHOO.util.Dom.addClass(this, 'focused');
	});
	YAHOO.util.Event.on(this, "blur", function(e) {
		YAHOO.util.Dom.removeClass(this, 'focused');
		toggleHint(this);
	});
	
	function toggleHint(input) {
		if (input.value == '') {
			YAHOO.util.Dom.addClass(input, 'empty');
		} else {
			YAHOO.util.Dom.removeClass(input, 'empty');
		}
	}
	toggleHint(this);
});

