NextPathArray = { FirstQuestion : "SecondQuestion-pane",  SecondQuestion : "FirstResult-pane", ThirdQuestion : "FifthResult-pane",
					FifthResult : "SixthResult-pane", SixthResult : "SeventhResult-pane" };


//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+222;
		//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
                         }); 
		ToggleSwitch=1;
		//return false;
		document.images["toggleImage"].src='/cfscombi/img/btn.gif'; //open
	}

}




/////////////////////////////////////////////// FirstQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathFirstQuestion(button) {

	//alert (button.value);

	if(button.value != "") {
		NextPathArray["FirstQuestion"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextFirstQuestion() {
	
	//alert('wow!');

	stack.push("FirstQuestion-pane");
	
	//alert ('val=' & NextPathArray["FirstQuestion"]);
	ScrollSection(NextPathArray["FirstQuestion"], 'scroller', 'home-pane');

}





/////////////////////////////////////////////// SecondQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathSecondQuestion(button) {

	//alert ('checked=' + children.checked);

	if(button.value != "") {
		NextPathArray["SecondQuestion"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextSecondQuestion() {


	stack.push("SecondQuestion-pane");
	ScrollSection(NextPathArray["SecondQuestion"], 'scroller', 'home-pane');

}






/////////////////////////////////////////////// ThirdQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////


function setPathThirdQuestion(button) {

	//alert ('checked=' + children.checked);

	if(button.value != "") {
		NextPathArray["ThirdQuestion"]=button.value;
		//document.title='radio selected=' + button.value ;
	} else {
		//ProgressArray["children"]=0;
	}
	//updateProgressBar(children);
}


function nextThirdQuestion() {


	stack.push("ThirdQuestion-pane");
	ScrollSection(NextPathArray["ThirdQuestion"], 'scroller', 'home-pane');

}




/////////////////////////////////////////////// FifthResult FUNCTIONALITY /////////////////////////////////////////////////////////////


function nextFifthResult() {


	stack.push("FifthResult-pane");
	ScrollSection(NextPathArray["FifthResult"], 'scroller', 'home-pane');

}




/////////////////////////////////////////////// SixthResult FUNCTIONALITY /////////////////////////////////////////////////////////////



function nextSixthResult() {


	stack.push("SixthResult-pane");
	ScrollSection(NextPathArray["SixthResult"], 'scroller', 'home-pane');

}







