/**
 * FileName: sponsors.js
 * Version: 1.0 
 * Creation Date: 2011/02/28 - 10:37
 * Description: This file is used to the sponsors on the site.
 * Author: jcanedo  
 **/

$(document).ready(initiating_events);

function initiating_events() {
	/**
	 * Function: Hidden Text Slide Controls
	 * Version: 1.2 
	 * Creation Date: 2011/02/28 - 09:32
	 * Description: Execute the function slideShow.
	 * Author: jcanedo  
	**/
	slideShow1(); //480x80 		
	slideShow2(); //723x80
	slideShow3(); //195x250				
} 

/* 
	Functions SlideShow 480x80
*/
function slideShow1() {
	if($('#slideShow480x80 a').length >= 2 ) {
		$('#slideShow480x80 a').css({'opacity': '0.0', 'visibility': 'hidden'});
		$('#slideShow480x80 a:first').css({'opacity': '1.0', 'visibility': 'visible'});
		setInterval('slideShow480x80()',7000);
	}	
}

function slideShow480x80() {
	var current = ($('#slideShow480x80 a.show')?  $('#slideShow480x80 a.show') : $('#slideShow480x80 a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#slideShow480x80 a:first') :current.next()) : $('#slideShow480x80 a:first'));	
	next.css({'opacity': '0.0', 'visibility': 'visible'})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);
	current.animate({opacity: 0.0}, 1000)
	.css({'visibility': 'hidden'})
	.removeClass('show');
}

/* 
	Functions SlideShow 723x80
*/
function slideShow2() {
	if($('#slideShow723x80 a').length >= 2 ) {
		$('#slideShow723x80 a').css({'opacity': '0.0', 'visibility': 'hidden'});
		$('#slideShow723x80 a:first').css({'opacity': '1.0', 'visibility': 'visible'});
		setInterval('slideShow723x80()',7000);
	}	
}

function slideShow723x80() {
	var current = ($('#slideShow723x80 a.show')?  $('#slideShow723x80 a.show') : $('#slideShow723x80 a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#slideShow723x80 a:first') :current.next()) : $('#slideShow723x80 a:first'));	
	next.css({'opacity': '0.0', 'visibility': 'visible'})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);
	current.animate({opacity: 0.0}, 1000)
	.css({'visibility': 'hidden'})
	.removeClass('show');
}

/* 
	Functions SlideShow 195x250
*/
function slideShow3() {
	if($('#slideShow195x250 a').length >= 2 ) {
		$('#slideShow195x250 a').css({'opacity': '0.0', 'visibility': 'hidden'});
		$('#slideShow195x250 a:first').css({'opacity': '1.0', 'visibility': 'visible'});
		setInterval('slideShow195x250()',7000);
	}	
}

function slideShow195x250() {
	var current = ($('#slideShow195x250 a.show')?  $('#slideShow195x250 a.show') : $('#slideShow195x250 a:first'));
	var next = ((current.next().length) ? ((current.next().hasClass('caption'))? $('#slideShow195x250 a:first') :current.next()) : $('#slideShow195x250 a:first'));	
	next.css({'opacity': '0.0', 'visibility': 'visible'})
	.addClass('show')
	.animate({opacity: 1.0}, 1000);
	current.animate({opacity: 0.0}, 1000)
	.css({'visibility': 'hidden'})
	.removeClass('show');
}
