// $Id: wrap.js,v 1.5 2011/04/14 21:36:57 jyu Exp jyu $

$(document).ready(function() {
	
	$('.leftcol_sponsors').each( function() {
		$(this).load('/livepages/' + $(this).attr('id') + '.php', function() {
			$(this).cycle({
				fx: 'fade'
			});
		});
	});
	
	// nav
	$('#nav li').hoverIntent({
		interval: 100,
		timeout: 500,
		over: function() {
			//show its submenu
			$('ul', this).slideDown(100);
		},
		out: function() {
			//hide its submenu
			$('ul', this).slideUp(100);
		}
	 });
	
	// tabs
	$('.tab_content').hide();
	$('.tab_content:first').show();
	$('div.headings a:first').addClass('current').show();
	
	$('div.headings a').click(function() {
		$('div.headings a').removeClass('current');
		$(this).addClass('current');
		$('.tab_content').hide();
		var activeTab = $(this).attr('href');
		$(activeTab).fadeIn();
		return false;
	});
	
	var a = $('#searchquery').autocomplete({ 
		serviceUrl:'/common/search_autocomplete.php',
		width:150,
		delimiter: /(,|;)\s*/,
		deferRequestBy: 0, //miliseconds
		params: { country: 'Yes' },
		noCache: false //set to true, to disable caching
	});
	
});

