/* browser sniffer*/
var ns4 = (document.layers);
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

/* quick access menu */

function setvisible(id, makevisible) {
	if(ns4){
		if (! makevisible)
			document.layers[id].style.visibility = "hidden";
		else
			document.layers[id].visibility = "show";
	}
	else if(ie4){
		if (! makevisible)
			document.all[id].style.visibility = "hidden";
		else
			document.all[id].style.visibility = "visible";
	}
	else if(ie5 || ns6){
		if (! makevisible)
			document.getElementById(id).style.visibility = "hidden";
		else
			document.getElementById(id).style.visibility = "visible";
	}

}

function mbgetobject(id) {
	if(ns4){
		return document.layers[id];
	}
	else if(ie4){
		return document.all[id];
	}
	else if(ie5 || ns6){
		return document.getElementById(id);
	}
}


function showPaint(id) {
	if(ns4){
		document.layers[currentPaint].style.visibility = "hidden";
		document.layers[id].visibility = "show";
	}
	else if(ie4){
		document.all[currentPaint].style.visibility = "hidden";
		document.all[id].style.visibility = "visible";
	}
	else if(ie5 || ns6){
		document.getElementById(currentPaint).style.visibility = "hidden";
		document.getElementById(id).style.visibility = "visible";
	}
	previousPaint=id
}

function defaultPaint() {
	if(ns4){
		document.layers[previousPaint].style.visibility = "hidden";
		document.layers[currentPaint].visibility = "show";
	}
	else if(ie4){
		document.all[previousPaint].style.visibility = "hidden";
		document.all[currentPaint].style.visibility = "visible";
	}
	else if(ie5 || ns6){
		document.getElementById(previousPaint).style.visibility = "hidden";
		document.getElementById(currentPaint).style.visibility = "visible";
	}
}

function setPaint() {
	currentPaint = previousPaint;
}

function showUpholstery(id) {
	if(ns4){
		document.layers[currentUpholstery].style.visibility = "hidden";
		document.layers[id].visibility = "show";
	}
	else if(ie4){
		document.all[currentUpholstery].style.visibility = "hidden";
		document.all[id].style.visibility = "visible";
	}
	else if(ie5 || ns6){
		document.getElementById(currentUpholstery).style.visibility = "hidden";
		document.getElementById(id).style.visibility = "visible";
	}
	previousUpholstery=id
}

function defaultUpholstery() {
	if(ns4){
		document.layers[previousUpholstery].style.visibility = "hidden";
		document.layers[currentUpholstery].visibility = "show";
	}
	else if(ie4){
		document.all[previousUpholstery].style.visibility = "hidden";
		document.all[currentUpholstery].style.visibility = "visible";
	}
	else if(ie5 || ns6){
		document.getElementById(previousUpholstery).style.visibility = "hidden";
		document.getElementById(currentUpholstery).style.visibility = "visible";
	}
}




/* configurator tabs */
function rollTab(theTab, theStatus)
{
 var theHRef="document.getElementsByTagName('a')[";
 var theStyle="].style.color";
 var Nr1 = (theTab * 2) -2;
 var Nr2 = Nr1 + 1;
  if(theStatus=='on') {
   eval(theHRef + Nr1 + theStyle +"='#ff6600'");
   eval(theHRef + Nr2 + theStyle +"='#ff6600'");
  } else {
   eval(theHRef + Nr1 + theStyle +"='#333333'");
   eval(theHRef + Nr2 + theStyle +"='#333333'");
  }
}

var dohidenav = false;
var thetarget = "TopNav0";
function secondaryNavShow (which)
{
	dohidenav = false;
	if (defaultTopNav!="TopNav0")
	{
		setvisible(defaultTopNav, false);
		mbgetobject(defaultTopNav+"Control").className=topnavcurrentoff;
	}
	
	
	if (thetarget != "TopNav0" && thetarget != defaultTopNav)
		mbgetobject(thetarget+"Control").className='topNav';
	if (which != "TopNav0" && which != defaultTopNav)
		mbgetobject(which+"Control").className='topNavOn';
	if (which == defaultTopNav && defaultTopNav!="TopNav0")
	{
		mbgetobject(defaultTopNav+"Control").className=topnavcurrenton;
	}
		
		
	setvisible(thetarget, false)
	
	setvisible(which, true)
}

//hide show secondary nav

function level2TopNavMouseOut (which)
{
	which.className='topNav2';
	//mbgetobject(defaultLevel2TopNav).className='topNavOn2';
}

function level2TopNavMouseOver (which)
{
	//mbgetobject(defaultLevel2TopNav).className='topNav2';
	which.className='topNavOn2';
}

function secondaryNavHide (which)
{
	
	dohidenav = true;
	thetarget = which;
	mytimer=setTimeout("doSecondaryNavHide();",1500);
	count=count+1;
}

var count = 0;
function doSecondaryNavHide()
{
	if (dohidenav)
	{
		if (thetarget != "TopNav0")
			mbgetobject(thetarget+"Control").className='topNav';
		if (defaultTopNav != "TopNav0")	
			mbgetobject(defaultTopNav+"Control").className=topnavcurrenton;
		setvisible(thetarget, false);
		if (defaultTopNav!="TopNav0")
		{
			setvisible(defaultTopNav, true);
		}
	}
}

/* -----------------------[ motivation library - show hide divs ]-------------------------------*/

var currentDiv = ''

function showDiv(id){
	
			var defaultdiv = document.getElementById('case0');
			defaultdiv.style.display = 'none';
				
			if(document.all && !document.getElementById) {
				x = document.all[id]
			}else{
				x = document.getElementById(id)
			}
					
			//show div
			if(currentDiv == '')
			{
				currentDiv = x;
			}
			else
			{
				//swap div
				currentDiv.style.display = 'none';
				currentDiv = x;
			}
						
			x.style.display = 'block';
		}


/* quizs */


function total(){
	var totalScore = 0
	
	// get the dropdown by name
	var dropDown1 = document.getElementById("dropDown1")
	// convert the dropdown value and convert it to an integer
	var dropDown1Value = parseInt(dropDown1.options[dropDown1.selectedIndex].text)
	var dropDown2 = document.getElementById("dropDown2")
	var dropDown2Value = parseInt(dropDown2.options[dropDown2.selectedIndex].text)
	var dropDown3 = document.getElementById("dropDown3")
	var dropDown3Value = parseInt(dropDown3.options[dropDown3.selectedIndex].text)
	var dropDown4 = document.getElementById("dropDown4")
	var dropDown4Value = parseInt(dropDown4.options[dropDown4.selectedIndex].text)
	var dropDown5 = document.getElementById("dropDown5")
	var dropDown5Value = parseInt(dropDown5.options[dropDown5.selectedIndex].text)
	var dropDown6 = document.getElementById("dropDown6")
	var dropDown6Value = parseInt(dropDown6.options[dropDown6.selectedIndex].text)
	var dropDown7 = document.getElementById("dropDown7")
	var dropDown7Value = parseInt(dropDown7.options[dropDown7.selectedIndex].text)
	var dropDown8 = document.getElementById("dropDown8")
	var dropDown8Value = parseInt(dropDown8.options[dropDown8.selectedIndex].text)
	var dropDown9 = document.getElementById("dropDown9")
	var dropDown9Value = parseInt(dropDown9.options[dropDown9.selectedIndex].text)
	var dropDown10 = document.getElementById("dropDown10")
	var dropDown10Value = parseInt(dropDown10.options[dropDown10.selectedIndex].text)
		
	// total the dropdown results
	totalScore = dropDown1Value + dropDown2Value  + dropDown3Value + dropDown4Value + dropDown5Value + dropDown6Value + dropDown7Value + dropDown8Value + dropDown9Value + dropDown10Value

	// write the total to the text field
	document.getElementById("score").value = totalScore
	
	//get the quiz form name
	var formId = document.forms[3].id 
	
	
	//focus
	if (formId == "quiz1"){
		if (totalScore < 70 ){
		document.getElementById("evaluation").value = "Your Life is still a blur."		
		}
		
		else if  (totalScore >= 70 && totalScore <= 84 ){
			document.getElementById("evaluation").value = "You're almost there - you just need a little more vision and concentration."
		}
			
		else if (totalScore > 84 ) {
			document.getElementById("evaluation").value = "Congratulations. You're already Focused."		
			
		}		
	}
	
	// expect more
	if (formId == "quiz2"){
		if (totalScore < 70 ){
		document.getElementById("evaluation").value = "You need to turn around your attitude towards your future."		
		}
		
		else if  (totalScore >= 70 && totalScore <= 84 ){
			document.getElementById("evaluation").value = "You're already positive, you just need to kick it up a notch."
		}
			
		else if (totalScore > 84 ) {
			document.getElementById("evaluation").value = "Congratulations. You're already a Tough-Minded Optimist."		
			
		}		
	}
	
	// be you
	if (formId == "quiz3"){
		if (totalScore < 70 ){
			document.getElementById("evaluation").value = "You're trying to be what you're not."		
			}
			
			else if  (totalScore >= 70 && totalScore <= 84 ){
				document.getElementById("evaluation").value = "You're 'Almost You', you just need a little more confidence and courage."
			}
				
			else if (totalScore > 84 ) {
				document.getElementById("evaluation").value = "Congratulations. You're already 'Being You.'"		
				
			}				
	}
	
	// play full out
	if (formId == "quiz4"){
		if (totalScore < 70 ){
			document.getElementById("evaluation").value = "You're trying to be what you're not."		
			}
			
			else if  (totalScore >= 70 && totalScore <= 84 ){
				document.getElementById("evaluation").value = "You're 'Almost You', you just need a little more confidence and courage."
			}
				
			else if (totalScore > 84 ) {
				document.getElementById("evaluation").value = "Congratulations. You're already 'Being You.'"		
				
			}				
	}
	
	// Make World-Class Friends
	if (formId == "quiz5"){
		if (totalScore < 70 ){
			document.getElementById("evaluation").value = "You've got a lot of relationship building to do."		
			}
			
			else if  (totalScore >= 70 && totalScore <= 84 ){
				document.getElementById("evaluation").value = "You're a good friend, now you need to become World-Class."
			}
				
			else if (totalScore > 84 ) {
				document.getElementById("evaluation").value = "Congratulations. You're already a World-Class Friend."		
				
			}				
	}
	
	// Learn and Let Go
	if (formId == "quiz6"){
		if (totalScore < 70 ){
			document.getElementById("evaluation").value = "You're missing out on all the inspiration around you."		
			}
			
			else if  (totalScore >= 70 && totalScore <= 84 ){
				document.getElementById("evaluation").value = "You're learning but you can absorb so much more."
			}
				
			else if (totalScore > 84 ) {
				document.getElementById("evaluation").value = "Congratulations. You're a True Student."		
				
			}				
	}
	
	if (formId == "quiz7"){
		if (totalScore < 70 ){
			document.getElementById("evaluation").value = "This Life-Tool will make a major difference to your life."		
			}
			
			else if  (totalScore >= 70 && totalScore <= 84 ){
				document.getElementById("evaluation").value = "You're on the cusp of becoming an Adaptive Navigator - you just need to refine your skills."
			}
				
			else if (totalScore > 84 ) {
				document.getElementById("evaluation").value = "Congratulations! You're already a Champion Adaptive Navigator."		
				
			}				
	}
	

	
	
	
}
				
////////////////////// submit paypal forms \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
/* issues passing the form name as an arguement in mac firefox */
																																				
function submit_KOTF_option_1() {	
	document.KOTF_option_1.submit();
	return false;	
}

function submit_KOTF_option_2() {	
	document.KOTF_option_2.submit();
	return false;	
}

function submit_KOTF_option_3() {	
	document.KOTF_option_3.submit();
	return false;	
}

function submit_PTP_form() {	
	document.PTP_form.submit();
	return false;	
}

function submit_onFire_option1() {	
	document.onFire_option1.submit();
	return false;	
}

function submit_onFire_option2() {	
	document.onFire_option2.submit();
	return false;	
}

function submit_onFire_option3() {	
	document.onFire_option3.submit();
	return false;	
}

function submit_LFTB_form() {	
	document.LFTB_form.submit();
	return false;	
}

function submit_complete_MLP_form() {	
	document.complete_MLP_form.submit();
	return false;	
}

function submit_checkOutForm() {	
	document.checkOutForm.submit();
	return false;	
}

function submit_viewCartForm() {	
	document.viewCartForm.submit();
	return false;	
}
					
	
function submit_conference_call() {	
	document.conferenceCallForm.submit();
	return false;	
}


function submit_season3() {	
	document.season3Form.submit();
	document.season3Form.target="_blank";
	return false;	
}


function submit_oneLife_1() {	
	document.OneLife_option_1.submit();
	return false;	
}

function submit_oneLife_2() {	
	document.OneLife_option_2.submit();
	return false;	
}

function submit_oneLife_3() {	
	document.OneLife_option_3.submit();
	return false;	
}

function submit_oneLife_complete() {	
	document.OneLife_complete.submit();
	return false;	
}

function submit_ConStrat_1() {	
	document.ConStrat_option_1.submit();
	return false;	
}
	
	
																			
																			
