/*
 * Javascript code for "ABCV" website.
 *
 * Author: Gabriel Rodrigues Couto
 * Version: 1, 7 december 2010
 *
 */ 

 //Slideshow
 $('#slideshow').cycle({
	fx: 'fade',
	easing: 'easeInCubic',
	delay: 0,
	pause: 1,		
	pauseOnPagerHover: 1,
	speed:  5000,
	timeout: 5000,
	pager:  '#nav',
	slideExpr: 'img'
});

$(document).ready(function(){ 

//Buscar
	$('#q').focus(function() {
		if ($('#q').val() == 'BUSCAR')
		{
			$('#q').val('');
		}
	});
	
	$('#lupa').click(function() {
		$('#form-buscar').submit();
	});

	correctSize();
}); 

$(window).resize(function() {
	correctSize();
}); 

function correctSize()
{
//Height	
	if ($(window).height() > ($("#container").height() + $("#header").height() + 22))
	{
		$("#container").height($(window).height() - ($("#header").height() + $("#footer").height() + 10));
		
		
		$("#col2").height($(window).height() - ($("#header").height() + $("#footer").height() + 75));
	}
}
