
var $TABS;
var ONBODY = false;
var ACTIVETAB = 0;
$(document).ready(function() {
	var anchor = $.url.attr('anchor');
	
	if (anchor && anchor.substr(0,4)=='tab-') {
		var tabid = anchor.substr(4);
		if (ACTIVETAB!=tabid) {
			ACTIVETAB = parseInt(tabid);
			
		}
	}
	
	$TABS = $('#navigation > ul').tabs({ 
		fx: {
			opacity: 'toggle',
  			duration: 'fast'
  		},
		event: 'mouseover',
		selected: ACTIVETAB
	});
	//ACTIVETAB =  $TABS.data('selected.tabs');
	
	
	
	
	
	$('#navigation > ul > li > a').click(function() {
		location.href = $(this).attr('rel');
		return(false);
	});
	$('div#container').mouseover(function() {
		if (ONBODY) {
			var selected = $TABS.data('selected.tabs');
			if (selected!=ACTIVETAB) {
				$TABS.tabs('select',ACTIVETAB);
			}
		}
	});
	$('div#navigation').mouseover(function() {
		ONBODY = false;
	});
	$('div#navigation').mouseout(function() {
		ONBODY = true;
	});
	
	
	

    $('div.pics').cycle();
});
