var navSearchBar_editFocusedFlag=false;

function navSearchBar_editFocused(ev) {
	if (navSearchBar_editFocusedFlag==false) {
		navSearchBar_editFocusedFlag = true;
		if ($id("kwords").value=="Search")
			$id("kwords").value="";
	}
}

function navSearchBar_btnClicked(ev) {
	if ($id("kwords").value=="" || $id("kwords").value=="Search") 
		return false;
	else 
		return true;
}

function open_ssl_seal() {
	var w = window.open("https://smarticon.geotrust.com/smarticonprofile?Referer=http://www.okobe.co.uk", "win", "status=1,toolbar=0,menubar=1,scrollbars=1,resizable=1,directories=0,width=415,height=545");
	w.focus();
}

var addthis_config = {
	username: "okobe",
	services_exclude: "amazonwishlist"
};

// Category Navigational Menu.
//
function initCatNavMenu() {
	
}

CatNavMenu = function(cfg) {
	this.init(cfg);
}

var initNavMenuBar = function() {
    this.buttons = 0;
    this.buttonPrefix = 0;
    this.curButton = -1;
    this.domNode = null;
	this.menu = null;
	this.ctimer = null;
	this.iframe = null;
	
	this.init = function(cfg) {
		this.buttons = 0;
    	this.domNode = $id("navMenuBar");
		this.setupMenuHooks();
	}

	this.setupMenuHooks = function() {
		var tags = $className("navCatMenuCntr","div",this.domNode);
    	YAHOO.Event.addListener(tags, 'mouseout', this.onMouseOut, this, true );
		YAHOO.Event.addListener(tags, 'mouseover', this.cancelTimer, this, true);
			 
		var tags = $className("navtab","li",this.domNode);
		YAHOO.Event.addListener(tags, 'mouseover', this.onMouseOver, this, true);
		YAHOO.Event.addListener(tags, 'mouseout', this.onMouseOut, this, true);

        var UA = YAHOO.env.ua;
		if (UA.ie == 6) {
			this.iframe = $new("iframe");
			this.iframe.frameborder="0";
			this.iframe.border="0";
			this.iframe.style.borderWidth="0";
			this.iframe.id = "navCatMenuCntrIframe";
	        document.body.insertBefore(this.iframe, document.body.firstChild);
		}
	}
	
	this.cancelTimer = function() {
        if (this.ctimer) {  
            clearTimeout(this.ctimer);
            this.ctimer = null;
        }
	}
	
	this.onMouseOver = function(ev) {
		var li = this._getTarget(ev);
		var items = $className("navCatMenuCntr","div",li);
		if (items.length) {
			var div = items[0];
			this.cancelTimer();
			
			if (this.menu != div) {
				this.closeMenu();
				this.menu = div;
				YAHOO.Dom.setStyle(div, "display", "block");
				
				if (this.iframe) {
					div.style.visibility='hidden';
					this.iframe.style.width=div.offsetWidth+"px";
					this.iframe.style.height=div.offsetHeight+"px";
					this.iframe.style.visibility='visible';
					YAHOO.Dom.setXY( this.iframe, YAHOO.Dom.getXY(div) )
					div.style.visibility='visible';
				}
			}			
		}
	}
	
	this.onMouseOut = function(ev) {
        var self = this;
		this.cancelTimer();
        this.ctimer = setTimeout( function() { self.closeMenu(); }, 100 );
	}
	
	this.closeMenu = function() {
		if (this.menu) {
			YAHOO.Dom.setStyle(this.menu, "display", "none");
			this.menu = null;
		}
		if (this.iframe) {
			this.iframe.style.visibility='hidden';
		}
	}
	
    this._getTarget = function(ev) {
		var t = YAHOO.util.Event.getTarget(ev);
		return (t.tagName.toLowerCase()=="li" ? t : $parent(t,"li"));
    }
    
	
	this.init();
};

