$(document).ready(function() {
	if ($('body').css("background") != "#57412B" && !($.browser.msie && $.browser.version < 7)) {
		$('#nav li').css('cursor', 'pointer').hover(
			function () {
				$('ul', this).stop(true, true).slideDown(200);
			}, 
			function () {
				$('ul', this).stop(true, true).slideUp(200);
			}
		);

		$('#ceomsg div.text, #profile div.text, #faq div.text, #rgsadd div.text').jScrollPane({hideFocus: true, enableHorizontal: false});
		
		$('#nav').tabs('#waves > div', { history: true });
		
		$.tools.tabs.addEffect("default", function(tabIndex, done) {
			if ($.browser.msie) {
				if ((Math.floor(Math.random() * 2) % 2) == 0)
					this.getPanes().hide().eq(tabIndex).show('slide', {direction: 'right'});
				else
					this.getPanes().hide().eq(tabIndex).show('slide', {direction: 'left'});
			} else {
				this.getPanes().hide().eq(tabIndex).fadeIn();
			}
			done.call();
		});
		
		$('div.text ul.boxlink li h4, div.text ul.boxlink2 li h4').hover(
			function() {
				$(this).addClass('hover');
			},
			function() {
				$(this).removeClass('hover');
			}
		);

		$('h4[rel]').overlay();
	}
});
