$(document).ready(function() {
    // Talk with us.
	var ran = Math.floor(Math.random() * 98324545) % 2;
	switch(ran) {
		case 0:
			//tom
			$("#talk_tom").css("display", "block");
			break;
		case 1:
			//donn
			$("#talk_donn").css("display", "block");
			break;
		default:
			//tom
			$("#talk_tom").css("display", "block");
	}

    // Main navigation.
    var nav = new Jmenu('navigation');
});


/*
    JMenu by Roderic Henry, TGP Associates
    A simple fly-down menu that uses jQuery.
    3/9/2009
*/

function Jmenu(id, config){
    this.selector = '#' + id + ' > li';
    this.menuItem = null;
    this.timer = null;
    
    var opts = { delay:1000 };
    this.opts = $.extend(opts, config);
    this.init();
}
Jmenu.prototype.init = function(){
    var self = this;
    $(this.selector).bind('mouseover', function(e){ self.show.call(self, $(this).find('ul').eq(0), e); });
    $(this.selector).bind('mouseout', function(e){ self.doHide.call(self, e); });
    $(document).bind('click', function(){ self.hide(); });
}
Jmenu.prototype.hide = function(){
    if(this.timer){
        clearTimeout(this.timer);
        this.timer = null;
    }
    if(this.menuItem) this.menuItem.css('display', 'none');
}
Jmenu.prototype.doHide = function(e){
    var self = this;
    this.timer = setTimeout(function(){ self.hide(); }, this.opts.delay);
}
Jmenu.prototype.show = function(mi, e){
    this.hide();
    this.menuItem = mi;
    this.menuItem.css('display', 'block');
}
/****************    END OF JMenu */
