//CHEVY CHASE LOAN SELECTOR
        //This function determines the appropriate loan type for a user 
        //depending on their responses to a series of questions. 
        //The questions are:
        //
        // purpose:	What is the purpose of your loan?
        // frequency: 	How frequently do you want to access the funds?
        // state:	What state do you live in?
        // home:	Do you own a home?
        //
        //The possible loan types are :
        //	1.	Home Equity Loan (HELN)

        //	2.	Home Equity Line of Credit (HELOC)
        //	3.	Personal Loan - Auto (PLAUTO)
        //	4.	Personal Unsecured Loan (PULN)
        //	5.	Personal Line of Credit (PLOC)
        //	6.	Personal Loan - RV (PLRV)
        //
        //The possible static pages are:
        //	 1.HELN
        //	 2.HELN_PULN
        //	 3.HELOC
        //	 4.HELOC_PLOC
        //	 5.PULN
        //	 6.PLOC
        //	 7.HELN_PLAUTO
        //	 8.HELN_PLAUTO
        //	 9.HELN_PLBOAT
        //	10.HELN_PLRV
        //	11.SORRY

        function validate()
        {
	        //Validate that each question is answered.
	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "")
		        {
		        alert ("Please Select a Purpose for your Loan");
		        document.formName.purpose.focus();
		        return false;
    		        }
    	        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "")
		        {
		        alert ("Please Select a Frequency for Accessing Funds");
		        document.formName.frequency.focus();
		        return false;
    		        }
    	        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "")
		        {
		        alert ("Please Indicate If you Own a Home");
		        document.formName.home.focus();
		        return false;
    		        }
    	        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "")
		        {
		        alert ("Please Select the State you Live in");
		        document.formName.state.focus();
		        return false;
    		        }
            	
    	        determineLoan();
        		
        }

        function determineLoan()
        {
            	
    	        //Check for known "sorry.html" redirects
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "DC" && document.questionForm.state[document.questionForm.state.selectedIndex].value == "2" && document.questionForm.home[document.questionForm.home.selectedIndex].value =="N" ) 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "HI" && document.questionForm.home[document.questionForm.home.selectedIndex].value =="N" ) 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "AUTO" && document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" ) 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "RV" && document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" ) 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "BOAT" && document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" ) 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "OD" && document.questionForm.state[document.questionForm.state.selectedIndex].value == "1" ) 
    	        {
        	        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "OD" && document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" && document.questionForm.state[document.questionForm.state.selectedIndex].value == "2") 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1" && document.questionForm.home[document.questionForm.home.selectedIndex].value == "N") 
    	        {
    		        location.href = "results/sorry.html"	
    	        }
    	        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "3")
    	        {
    		        location.href = "results/sorry.html"	
    	        }
               	   	
    	        //Determine loan type
    	        if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "DC" )
	        {	
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
			        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1" || document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {	if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
					        {
					        location.href = "results/heln.html"
					        }
			        }		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
			        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1" || document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
					        {
					        location.href = "results/heloc.html"
					        }
			        }
		        }
        		
	        }	
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "HI")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
			        }	
        		
		        }
        		
        		
        	
        		
        		
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "ED")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc_ploc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/ploc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/puln.html"
				        }
        				
			        }	
        		
		        }
        	
        	
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "AUTO")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_plauto.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/plauto.html"
				        }
        				
			        }	
        		
		        }
        	
        	
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "RV")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_plrv.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/plrv.html"
				        }
        				
			        }	
        		
		        }
        	
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "BOAT")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_plboat.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/plboat.html"
				        }
        				
			        }	
        		
		        }
        	
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "WED")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc_ploc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/ploc.html"
				        }
        				
			        }	
        		
		        }
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "VACA")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc_ploc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/ploc.html"
				        }
        				
			        }	
        		
		        }
        	
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "MAJPUR")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc_ploc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/ploc.html"
				        }
        				
			        }	
        		
		        }
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "OD")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
			        location.href = "results/ploc.html"
			        }	
        		
		        }
        	
	        }
	        else if (document.questionForm.purpose[document.questionForm.purpose.selectedIndex].value == "OT")
	        {
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heln_puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "1")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "Y" )
				        {
				        location.href = "results/heloc_ploc.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "LS" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/puln.html"
				        }
        				
			        }	
        		
		        }
        		
		        if (document.questionForm.frequency[document.questionForm.frequency.selectedIndex].value == "AN" )
		        {
		        if (document.questionForm.state[document.questionForm.state.selectedIndex].value == "2")
			        {
				        if (document.questionForm.home[document.questionForm.home.selectedIndex].value == "N" )
				        {
				        location.href = "results/ploc.html"
				        }
        				
			        }	
        		
		        }
        	
	        }
	        else
	        {
	        location.href="results/sorry.html"
	        }
         }  
