$(document).ready(function()
{
	$('form').validate();
	$('.new-window').click(function(){return !window.open($(this).attr('href'));});

	theRotator();

	$('#btn-apply-for-job input').live('click',function(){
		$(this).attr('disabled','disabled').fadeTo(0,0.3);
	});
});

function theRotator ()
{
	$('ul#slideshow li').css({opacity: 0.0});
	$('ul#slideshow li:first').css({opacity: 1.0});
	setInterval('rotate()',7000);
}

function rotate ()
{
	var current = ((typeof $('ul#slideshow li.show').attr('class') != 'undefined')?  $('ul#slideshow li.show') : $('ul#slideshow li:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('show')) ? $('ul#slideshow li:first') :current.next()) : $('ul#slideshow li:first'));
	next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 2500);
	current.animate({opacity: 0.0}, 2500).removeClass('show');
};

