// JavaScript Document

/*


      88P                                                                          988
     88'    oooo                                   .o8   o8o                        '88
    o88     `88'                                   "88   `"'                         88o
    888      88   oo. .o.     .oooo.   .oooo.   .ooo88   ooo   ooo  ooo    .ooo.o    888
    88'      88   `88P"Y8b   d8' `"8  d8' `8b  d8' `88   `88   `88  `88   d8(  "8    '88
  o88        88    88   88   88       88   88  88   88    88    88   88   `"Y8b.       88o 
    88o      88    88   88   88   .8  88   88  88   88    88    88   88   o.  )8b     o88 
    888     o88o  o88o o88o  `Y8bdP'  `Y8bdP'  `Y8bd8P"  o88o   `V8V"VP'  8""88P'     888
    988                                                                               88P
     88.              C R E A T I V E   W E B   D E V E L O P M E N T                .88 
      88o                                                                           o88	


						Copyright 2010 Incodius - www.incodius.com 
*/

$(document).ready(function(){
	var featuretime = 0;
	//feature();
	featuretime = setTimeout(feature1, 2000);
});

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;
	}
}
