NextPathArray = { FirstQuestion : "SecondQuestion-pane",  SecondQuestion : "FourthQuestion-pane",  FourthQuestion : "FirstResult-pane",
					FifthQuestion : "FifthResult-pane"
};


//FlagArray = { Charity1 : 1, Member1 : 1, Charity2 : 1, Member2 : 1 };
FlagArray = { TwentyFive : 1, Member1 : 1,  Member2 : 1 };

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+242;
		//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 setFlagSecondQuestion(flag) {


	if (flag.value=="TwentyFiveYes") {
		FlagArray["TwentyFive"]=1;
	} else {
		FlagArray["TwentyFive"]=0;
	}

	if (flag.value=="TwentyFiveNo") {
		FlagArray["TwentyFive"]=0;
	} else {
		FlagArray["TwentyFive"]=1;
	}
//debstring='TwentyFive=' + FlagArray["TwentyFive"] ;
//alert(debstring);

}


function nextSecondQuestion() {


	stack.push("SecondQuestion-pane");
	ScrollSection(NextPathArray["SecondQuestion"], 'scroller', 'home-pane');

}





/////////////////////////////////////////////// ThirdQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////


/*
function setFlagThirdQuestion(flag) {

	if (flag.value=="CharityYes") {
		FlagArray["Charity2"]=1;
	} else {
		FlagArray["Charity2"]=0;
	}

	if (flag.value=="CharityNo") {
		FlagArray["Charity2"]=0;
	} else {
		FlagArray["Charity2"]=1;
	}
//document.title='lumpsum=' + FlagArray["LumpSum"] ;
}


function nextThirdQuestion() {


	stack.push("ThirdQuestion-pane");
	ScrollSection(NextPathArray["ThirdQuestion"], 'scroller', 'home-pane');

}

*/


/////////////////////////////////////////////// FourthQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////



function setFlagFourthQuestion(flag) {

	if (flag.value=="MemberYes") {
		FlagArray["Member1"]=1;
	} else {
		FlagArray["Member1"]=0;
	}

	if (flag.value=="MemberNo") {
		FlagArray["Member1"]=0;
	} else {
		FlagArray["Member1"]=1;
	}
//debstring='Member1=' + FlagArray["Member1"] ;
//alert(debstring);
}




function nextFourthQuestion() {

	//alert (NextPathArray["soleRouteTwo"]);

	stack.push("FourthQuestion-pane");
	if (FlagArray["Member1"]) {

		if (FlagArray["TwentyFive"]) {
		//alert ('reg saver');
		// RegularSaver true 
			ScrollSection("FirstResult-pane", 'scroller', 'home-pane');  
		} else {
		
			ScrollSection("ThirdResult-pane", 'scroller', 'home-pane');  
		}
	} else {
		
		if (FlagArray["TwentyFive"]) {
		//alert ('reg saver');
		// RegularSaver true 
			ScrollSection("SecondResult-pane", 'scroller', 'home-pane');  
		} else {
		
			ScrollSection("FourthResult-pane", 'scroller', 'home-pane');  
		}
				
	}



}







/////////////////////////////////////////////// FifthQuestion FUNCTIONALITY /////////////////////////////////////////////////////////////



function setFlagFifthQuestion(flag) {

	if (flag.value=="MemberYes") {
		FlagArray["Member2"]=1;
	} else {
		FlagArray["Member2"]=0;
	}

	if (flag.value=="MemberNo") {
		FlagArray["Member2"]=0;
	} else {
		FlagArray["Member2"]=1;
	}
//document.title='lumpsum=' + FlagArray["LumpSum"] ;
}




function nextFifthQuestion() {

	//alert (NextPathArray["soleRouteTwo"]);

	stack.push("FifthQuestion-pane");
	if (FlagArray["Member2"]) {

		ScrollSection("FifthResult-pane", 'scroller', 'home-pane');  
	} else {
		
		ScrollSection("SixthResult-pane", 'scroller', 'home-pane');  
				
	}



}





