/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}


function checkAmount() {
      if ( document.getElementById('debtAmount') ) {
           if ( !document.getElementById('debtAmount').value.length )  {
                alert('Please enter an amount of debt');
                return false; 
           }
           if ( isNaN(document.getElementById('debtAmount').value) ) {
                alert('Please enter a valid number for amount of debt');
                return false;
           }

           var myFloat = parseFloat(document.getElementById('debtAmount').value);
           var myPageIndex = ''; 
           if ( myFloat <= 50 ) {
               myPageIndex = 0;
           } 
           else if( myFloat < 125 ) {
               myPageIndex = 50;
           } 
           else if( myFloat <= 300 ) {
               myPageIndex = 125;
           } 
           else if( myFloat <= 500 ) {
               myPageIndex = 300;
           } 
           else if( myFloat <= 600 ) {
               myPageIndex = 500;
           } 
           else if( myFloat <= 1000 ) {
               myPageIndex = 600;
           } 
           else if( myFloat <= 1500 ) {
               myPageIndex = 1000;
           } 
           else if( myFloat <= 3000 ) {
               myPageIndex = 1500;
           } 
           else if( myFloat <= 5000 ) {
               myPageIndex = 3000;
           } 
           else if( myFloat <= 15000 ) {
               myPageIndex = 5000;
           } 
           else if( myFloat <= 50000 ) {
               myPageIndex = 15000;
           } 
           else if( myFloat <= 100000 ) {
               myPageIndex = 50000;
           } 
           else if( myFloat <= 150000 ) {
               myPageIndex = 100000;
           } 
           else if( myFloat <= 200000 ) {
               myPageIndex = 150000;
           } 
           else if( myFloat <= 250000 ) {
               myPageIndex = 200000;
           } 
           else if( myFloat <= 300000 ) {
               myPageIndex = 250000;
           } 
           else if( myFloat > 300000 ) {
               myPageIndex = 30000050;
           } 
           if ( myPageIndex >= 0 ) {
              var nextPage = '/site/services/businesses/srvdebt/debtrecoverycalculator/debt_'+myPageIndex+'.html';
              document.location = nextPage;
           } 

      }
}

