function best_rate () { return get_rate("best", 0); } function get_rate ( type, index ) { // Best possible rate if ( type == "best" ) { return "6.49%"; // New car rates } else if ( type == "new" ) { // 24-36 months if ( index == 0 ) { return "--"; // 37-60 months } else if ( index == 1 ) { return "--"; // anything else } else { return "--"; } // Company car or leased car rates } else if ( type == "company" || type == "lease" ) { // 24-36 months if ( index == 0 ) { return "--"; // 37-60 months } else if ( index == 1 ) { return "--"; // anything else } else { return "--"; } } else { return "--"; } }