// JavaScript Document

/*
      __ __    __    _____  _____  _  _     __
  // |  -  |  /  \  |     ||_  __|| |_| |  /  \
 //  |     | /    \ |    <   | |  |  _  | /    \
//   |_|v|_|/__||__\|__|\_\  |_|  |_| |_|/__||__\
 __   __  __   __  ____   __  ___  _____  _______
|  |_|  ||  |_|  |/   _\ |  |/  / |     ||       |
|       ||       ||  |   |     /  |    = |       |
|   _   ||       ||  |_  |     \  |    = |      <
|__| |__| \_____/  \___/ |__|\__\ |_____||__|\___\

 *****    WOMEN'S GRAVITY MOUNTAIN BIKING *******
 
 Code copyright 2009 Martha Hucker Dot Com and Rita Langley. 



$(document).ready(function(){

	$("#riderpicker").autocomplete(riders);
	
	$(".ac_even ac_over, .ac_odd ac_over").click(function(){
		alert ("stuff!");
		linkmaker();						   
	});

 });*/

function linkmaker() {
	alert ("link makin!");
}


// Nav bar color changes - changes the background of each nav menu item to a lighter color.

function nav_on(navid) {
	switch (navid) {
	case "nav1":
	document.getElementById(navid).style.backgroundColor = '#ff4242';
	break;
	case "nav2":
	document.getElementById(navid).style.backgroundColor = '#7ce4ff';
	break;
	case "nav3":
	document.getElementById(navid).style.backgroundColor = '#fdb280';
	break;
	case "nav4":
	document.getElementById(navid).style.backgroundColor = '#999';
	break;
	case "nav5":
	document.getElementById(navid).style.backgroundColor = '#F6F';
	break;
	}
	
}

function nav_off(navid) {
	switch (navid) {
	case "nav1":
	document.getElementById(navid).style.backgroundColor = '#F00';
	break;
	case "nav2":
	document.getElementById(navid).style.backgroundColor = '#3CF';
	break;
	case "nav3":
	document.getElementById(navid).style.backgroundColor = '#F63';
	break;
	case "nav4":
	document.getElementById(navid).style.backgroundColor = '#666';
	break;
	case "nav5":
	document.getElementById(navid).style.backgroundColor = '#F3C';
	break;
	}
}

// This changes between the three feature images in the features div. *************************************************************************

function featuretimer(stopgo)
{
	if (stopgo == "go") {
		$("#featurebg1").fadeIn(500);
		document.getElementById("feature1link").style.color = "#FFF";
		featuretime = setTimeout("feature1()", 4000);
	}
	
	if (stopgo == "stop") {
		clearTimeout(featuretime);
	}

}

function feature1() {
	$("#featurebg1").fadeOut(500);
	document.getElementById("feature1link").style.color = "#DDD";
	featuretime = setTimeout("feature2()", 500);
	
}

function feature2() {
	$("#featurebg2").fadeIn(500);	
	document.getElementById("feature2link").style.color = "#FFF";
	featuretime =  setTimeout("feature3()", 4000);
}

function feature3() {
	$("#featurebg2").fadeOut(500);
	document.getElementById("feature2link").style.color = "#DDD";
	featuretime = setTimeout("feature4()", 500);
	
}

function feature4() {
	$("#featurebg3").fadeIn(500);
	document.getElementById("feature3link").style.color = "#FFF";
	featuretime = setTimeout("feature5()", 4000);
}

function feature5() {
	$("#featurebg3").fadeOut(500);
	document.getElementById("feature3link").style.color = "#DDD";
	featuretime = setTimeout("featuretimer('go')", 500);
	
}

// ************************************************************************************************************************************************************************************

// Feature arrows on/off function

function featureOff(id) {
	switch (id) {
	case "feature1":
	featuretime = setTimeout("feature1()", 2000);
	$("#featurebutt1").hide();
	document.getElementById("feature1link").style.color = "#DDD";
	break;
	case "feature2":
	featuretime = setTimeout("feature3()", 2000);
	$("#featurebutt2").hide();
	document.getElementById("feature2link").style.color = "#DDD";
	break;
	case "feature3":
	featuretime = setTimeout("feature5()", 2000);
	$("#featurebutt3").hide();
	document.getElementById("feature3link").style.color = "#DDD";
	break;
	}
	
}

function featureOn(id) {
	featuretimer('stop');
	$(".featurebg, .gobutton").hide();
	switch (id) {
	case "feature1":
	$("#featurebg1, #featurebutt1").show();	
	document.getElementById("feature1link").style.color = "#FFF";
	break;
	case "feature2":
	$("#featurebg2, #featurebutt2").show();	
	document.getElementById("feature2link").style.color = "#FFF";
	break;
	case "feature3":
	$("#featurebg3, #featurebutt3").show();	
	document.getElementById("feature3link").style.color = "#FFF";
	break;
	}
}

// This shows or hides the features box. Called from the header, passed a string of either 'hide' or 'show'

function showhidebigfeatures($showhide) {
	switch ($showhide) {
		case "show":
		$('#minifeatures').hide();
		$("#features, #arrows, #mediabox, #contactbar").fadeIn(500);
		//$("#features, #arrows, #mediabox, #contactbar").fadeIn(500);
		break;
		case "hide":
		$('#minifeatures').fadeIn(500);
		$("#features, #arrows, #mediabox, #contactbar").hide();
		break;
	}
}

function showlogin() {
	$('#logbox').fadeIn(500);	
}


	


