NextPathArray = { firstQuestion : "soleRouteOne-pane",  soleRouteOne : "soleRouteTwo-pane", soleRouteTwo : "soleRouteThree-pane", soleRouteThree :"soleRouteFour-pane", 
	soleRouteFour : "soleRouteResults_two-pane",  jointRouteOne : "jointRouteTwo-pane", jointRouteTwo : "jointRouteThree-pane", jointRouteThree :"jointRouteResults_one-pane", 
	out_of_work:"no", will:"no" };


FlagArray = { LumpSum : 1, RegularSaver : 0 };

var stack = new Array();
var ToggleSwitch=1;



function backButton() {

	previousFrame = stack.pop();
	ScrollSection(previousFrame, 'scroller', 'home-pane');

}


function homeButton() {

		ScrollSection('home-pane', 'scroller', 'home-pane');

}




////////////////////////////////// Code that controls the Co-op elements 'banners' and 'footer'
/*
var orig_footer_top;

function OnFinish(obj) {
	banner_object = document.getElementById('banners');
	banner_object.style.display = 'block';

	footer_object = document.getElementById('footer');
	footer_object.style.top=orig_footer_top +'px';
}


function toggleButton() {



	if (ToggleSwitch) {
		banner_object = document.getElementById('banners');
		banner_object.style.display = 'none';
		
		footer_object = document.getElementById('footer');
		orig_footer_top=parseInt(footer_object.style.top);
		newval=orig_footer_top+202;
		//document.title='Down' + orig_footer_top ;
		footer_object.style.top=newval +'px';
		
		ScrollSection('home-pane', 'scroller', 'home-pane');
		//Effect.BlindDown('scroller'); 
		ToggleSwitch=0;
		//return false;
		document.images["toggleImage"].src='/cfscombi/img/close_btn.gif'; //close
	} else {
// close window
		//Effect.BlindUp('scroller',   { 
        //                  afterFinish: OnFinish
        //                 }); 

		banner_object = document.getElementById('banners');
		banner_object.style.display = 'block';
	
		footer_object = document.getElementById('footer');
		footer_object.style.top=orig_footer_top +'px';
	
		ToggleSwitch=1;
		//return false;
		document.images["toggleImage"].src='/cfscombi/img/btn.gif'; //open
	}

}

*/

/////////////////////////////////////////////// FirstQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathFirstQuestion(button) {

	//alert ('checked=' + children.checked);

	if(button.value != "") {
		NextPathArray["firstQuestion"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextFirstQuestion() {


	stack.push("firstQuestion-pane");
	ScrollSection(NextPathArray["firstQuestion"], 'scroller', 'home-pane');

}



/////////////////////////////////////////////// SoleRouteOne FUNCTIONALITY /////////////////////////////////////////////////////////////


function setFlagSoleRouteOne(flag) {

	if (flag.value=="LumpSum") {
		FlagArray["LumpSum"]=1;
	} else {
		FlagArray["LumpSum"]=0;
	}

	if (flag.value=="RegularSaver") {
		FlagArray["RegularSaver"]=1;
	} else {
		FlagArray["RegularSaver"]=0;
	}
//document.title='lumpsum=' + FlagArray["LumpSum"] ;
}



function nextSoleRouteOne() {

	stack.push("soleRouteOne-pane");
	ScrollSection("soleRouteTwo-pane", 'scroller', 'home-pane');
}




/////////////////////////////////////////////// SoleRouteTwo FUNCTIONALITY /////////////////////////////////////////////////////////////

function setPathSoleRouteTwo(button) {

	//alert ('checked=' + children.checked);

	if(button.value != "") {
		NextPathArray["soleRouteTwo"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}



function nextSoleRouteTwo() {

	//alert (NextPathArray["soleRouteTwo"]);

	stack.push("soleRouteTwo-pane");
	if (NextPathArray["soleRouteTwo"]=="soleRouteThree-pane") {

		if (FlagArray["RegularSaver"]) {
		//alert ('reg saver');
		// RegularSaver true 
			ScrollSection("soleRouteResults_two-pane", 'scroller', 'home-pane');  // just go to smart saver results pane
		} else {
		
			if (FlagArray["LumpSum"]) {
			//alert ('lump sum');
			// lumpsum true 
				ScrollSection(NextPathArray["soleRouteTwo"], 'scroller', 'home-pane');  // just go to soleRouteThree-pane
			} else {
				ScrollSection("soleRouteFour-pane", 'scroller', 'home-pane'); // if not lumpsum then go to pane four
			}
		}
	} else {
		// the other two paths are simpler and we just go to their respective paths
		ScrollSection(NextPathArray["soleRouteTwo"], 'scroller', 'home-pane');  
	}
}





/////////////////////////////////////////////// soleRouteThree FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathSoleRouteThree(button) {

	//alert ('checked=' + children.checked);

	if(button.value != "") {
		NextPathArray["soleRouteThree"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextSoleRouteThree() {

	stack.push("soleRouteThree-pane");
	//alert (NextPathArray["soleRouteThree"]);
	ScrollSection(NextPathArray["soleRouteThree"], 'scroller', 'home-pane');

}


/////////////////////////////////////////////// soleRouteFour FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathSoleRouteFour(button) {

	//alert ('checked=' + children.checked);

	if(button.value != "") {
		NextPathArray["soleRouteFour"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextSoleRouteFour() {

	stack.push("soleRouteFour-pane");
	ScrollSection(NextPathArray["soleRouteFour"], 'scroller', 'home-pane');

}




/////////////////////////////////////////////// jointRouteOne FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathJointRouteOne(button) {


	if(button.value != "") {
		NextPathArray["jointRouteOne"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextJointRouteOne() {

	stack.push("jointRouteOne-pane");
	ScrollSection(NextPathArray["jointRouteOne"], 'scroller', 'home-pane');

}



/////////////////////////////////////////////// jointRouteTwo FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathJointRouteTwo(button) {

	if(button.value != "") {
		NextPathArray["jointRouteTwo"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextJointRouteTwo() {

	stack.push("jointRouteTwo-pane");
	ScrollSection(NextPathArray["jointRouteTwo"], 'scroller', 'home-pane');

}




/////////////////////////////////////////////// jointRouteOne FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathJointRouteThree(button) {

	if(button.value != "") {
		NextPathArray["jointRouteThree"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextJointRouteThree() {

	stack.push("jointRouteThree-pane");
	ScrollSection(NextPathArray["jointRouteThree"], 'scroller', 'home-pane');

}

