/*
 * jQuery custom scripts for Solis
 * http://www.solisbrands.com/
 *
 * Copyright (c) 2010
 * Dual licensed under the MIT and GPL licenses.
 * http://docs.jquery.com/License
 *
 * Date: 2010-10-14 (Thu, 14 October 2010)
 * Revision: 1
 */





/* Custom functions
------------------------------------------------- */
var speed   = 20;
var step    = 1;
var current = -750;

function scroll() {
	current += step;
	if(current >= 0) {current = -750}
	$("#athletes").css("background-position", current + "px 0");
}

function cycleQuotes(n) {
	if (!document.getElementById) return;
	
	var delay = 10000;
	
	$("div.blockquote").fadeOut(1000);
	
	switch(n) {
		case 1: $("#good").fadeIn(1000);    setTimeout("cycleQuotes(2);", delay); break;
		case 2: $("#dixon").fadeIn(1000);   setTimeout("cycleQuotes(3);", delay); break;
		case 3: $("#optimal").fadeIn(1000); setTimeout("cycleQuotes(1);", delay); break;
		default: n = 1;
	}
}

function initialize() {
	$("#optimal").fadeIn(3000);
	
	setTimeout("cycleQuotes(1);", 7000);
	
	setInterval("scroll();", speed);
}
/* -------------------------------------------------
                             end custom functions */





/* UI Candy
------------------------------------------------- */
$(document).ready(function(){
	
	/* links */
	$('a[rel="external"]').attr("target","_blank");
	$('a[rel="print"]').click(function() {window.print(); return false;});
	$('a[rel="close"]').click(function() {window.close(); return false;});
	$('a[rel="send"]').click(function() {$("form#send").submit(); return false;});
});
/* -------------------------------------------------
                                     end UI Candy */






