// Declare branding variable
        var logoImage="<img src=\"/ca/img/img/mm-popup-cibc-logo.gif\" alt=\"CIBC\" width=\"75\" height=\"68\" border=\"0\">";
		var topBarImage="<img src=\"/ca/img/img/visa-selector-pg-title-en.gif\" alt=\"Choose a CIBC VISA Card\"  border=\"0\">";
		var leftImage="<img src=\"/ca/img/visa-ftrs/tool/visa-selector-img.jpg\" border=\"0\">";
		var labelImage="<img src=\"/ca/img/visa-ftrs/tool/visa-selector-hdr-en.gif\" alt=\"Not sure which CIBC VISA Card is right for you? Let us help.\">";


		var nextStepsArray = new Array();
		nextStepsArray[0] = {img:"<img src=\"/ca/img/visa-ftrs/tool/visa-selector-visitbranch-en.gif\" alt=\"Visit a branch\" border=\"0\">", url:"javascript:top.newApplyWindow('http://cibc.com/marketing/locators/BranchLocatorSearchEn.cibc');"};	
		  
		  
		  var errorMessageArray = new Array();
		  errorMessageArray['PrimaryGoal'] = "Please indicate which feature you are more interested in.";   
		  errorMessageArray['SecondaryGoal'] = "Please indicate which additional feature you are most interested in.";   
		  errorMessageArray['AnnualHouseholdIncome'] = "Please indicate the range of your household income.";  		  		  

	   	function moveNextPage()
		{		   
		    var validationStatus=true;
									
			if(! radioButtonChecking('primaryGoal'))
			{
			    frames['formFrame'].document.getElementById('errPrimaryGoalSection').className = "conditionalContentVisible";  			
				validationStatus=false;
			}
			else
			{
			    frames['formFrame'].document.getElementById('errPrimaryGoalSection').className = "conditionalContentHidden";			  			  			
			}

			if(! radioButtonChecking('secondaryGoal'))
			{
			    frames['formFrame'].document.getElementById('errSecondaryGoalSection').className = "conditionalContentVisible";  			
				validationStatus=false;
			}
			else
			{
			   
			    frames['formFrame'].document.getElementById('errSecondaryGoalSection').className = "conditionalContentHidden";			  			  			
			}
			
			if(! radioButtonChecking('annualHouseholdIncome'))
			{
			    frames['formFrame'].document.getElementById('errAnnualHouseholdIncomeSection').className = "conditionalContentVisible";  			
				validationStatus=false;
			}
			else
			{
			    frames['formFrame'].document.getElementById('errAnnualHouseholdIncomeSection').className = "conditionalContentHidden";			  			  			
			}			
		   			
			if(validationStatus)
			{
			  radioButtonSaving('primaryGoal');		
			  radioButtonSaving('secondaryGoal');				
			  radioButtonSaving('annualHouseholdIncome');		
			  if(returnRadioButtonValue('annualHouseholdIncome')=="lessThan15K")
			  {
				  frames['formFrame'].document.location.href="unqualified.html";			  		  	 			  
			  }
			  else
			  {			
				  recommendation();
				  var product1 = frames["submitFrame"].document.forms[0].prodID1.value;
				  var product2 = frames["submitFrame"].document.forms[0].prodID2.value;
				  var product3 = frames["submitFrame"].document.forms[0].prodID3.value;				
				  var totalProducts = frames["submitFrame"].document.forms[0].prodNum.value;
				  
			     var newUrl="results.html?"
				 newUrl = newUrl +product1;
				 if(totalProducts>=2)
				 {
				   newUrl = newUrl + ";" + product2;				 
				 }
				 if(totalProducts>=3)
				 {
				   newUrl = newUrl + ";" + product3;								 
				 }					    				  	
				  frames['formFrame'].document.location.href=newUrl;			  		  	  
			  }	  
			}			   	
		}
		

function startOver()
{
      parent.frames['submitFrame'].document.forms[0].requestPopulatePageNumber.value=0;
      parent.frames['formFrame'].document.location="form-purpose.html";		
}


function populatePageRequest(pageNumber)
{
	  frames['submitFrame'].document.forms[0].requestPopulatePageNumber.value=pageNumber;
		 
	  switch (pageNumber)
	  {		
		case 1:
		{
		  frames['formFrame'].location.href="form-purpose.html";
		  break;
		}
 
	 }	
}

					