/*
 *	Innerfade
*/

jQuery.noConflict();	
	jQuery(document).ready(function(){  	
		jQuery('#slider').innerfade({
				animationtype: 'fade', 
				speed: '3000',
				timeout: 7000,
				type: 'sequence',
				containerheight: 'auto'
		});	
});

/*
 *	Newsticker
*/

jQuery.noConflict();
	jQuery(document).ready(function(){
		jQuery(".news ul").newsTicker();
	});


/*
 *	Table Style
*/

jQuery.noConflict();	
	jQuery(document).ready(function(){  	
		jQuery("#table-a tr:odd").addClass("alt");	
	});

/*
 *	About.html content transitions
 */
jQuery.noConflict();
	jQuery(document).ready(function() {
		
		/* Support Page Specific */
		jQuery("#support-button a").addClass("selected");
		jQuery("#tos-button a").removeClass("selected");
		/* About Page Specific */
		jQuery("#about-button a").addClass("selected");
		jQuery("#infrastructure-button a").removeClass("selected");
		jQuery("#green-button a").removeClass("selected");
		jQuery("#partner-button a").removeClass("selected");
		jQuery("#legal-button a").removeClass("selected");
	
		jQuery(".main-content li.button a").click(function(){
			
			var clicked = jQuery(this);
			
			// if the button is not already "transformed" AND is not animated
			if (!(clicked.hasClass("selected"))) {
				
				clicked.addClass("selected");
				
				// each button div MUST have a "xx-button" and the target div must have an id "xx" 
				var idToLoad = clicked.parent().attr("id").split('-');
				
				//we search trough the content for the visible div and we fade it out
				jQuery(".main-content .col-right").find("div:visible").fadeOut("fast", function(){
					//once the fade out is completed, we start to fade in the right div
					jQuery(this).parent().parent().parent().parent().find("#"+idToLoad[0]).fadeIn();
				})
			}
			
			//we reset the other buttons to default style
			clicked.parent().siblings().children(".button a").removeClass("selected");
			
		});
	});