function AllPhoneSearchTwo(form, root_path) { this.append = 'mobile-phone-finder'; this.form = form; this.root_path = root_path; this.network_field = (this.form.network) ? this.form.network : ''; this.phone_field = this.form.phone; this.data = new Array(); this.data['SamsungE250'] = new Array(); this.data['SamsungE250'][this.data['SamsungE250'].length] = new Array('BT Mobile', '/samsung-mobile-phones/bt-mobile/samsung-e250.php'); this.data['SamsungF480Tocco'] = new Array(); this.data['SamsungF480Tocco'][this.data['SamsungF480Tocco'].length] = new Array('T Mobile', '/samsung-mobile-phones/t-mobile/samsung-f480-tocco.php'); this.data['SamsungG600'] = new Array(); this.data['SamsungG600'][this.data['SamsungG600'].length] = new Array('Show All', '/samsung-mobile-phones/all/samsung-g600.php?ttype=A&tarifftab=1'); this.data['SamsungG600'][this.data['SamsungG600'].length] = new Array('Orange', '/samsung-mobile-phones/orange/samsung-g600.php'); this.data['SamsungG600'][this.data['SamsungG600'].length] = new Array('T Mobile', '/samsung-mobile-phones/t-mobile/samsung-g600.php'); this.data['SamsungG600'][this.data['SamsungG600'].length] = new Array('BT Mobile', '/samsung-mobile-phones/bt-mobile/samsung-g600.php'); this.data['SamsungU600'] = new Array(); this.data['SamsungU600'][this.data['SamsungU600'].length] = new Array('Show All', '/samsung-mobile-phones/all/samsung-u600.php?ttype=A&tarifftab=1'); this.data['SamsungU600'][this.data['SamsungU600'].length] = new Array('Orange', '/samsung-mobile-phones/orange/samsung-u600.php'); this.data['SamsungU600'][this.data['SamsungU600'].length] = new Array('T Mobile', '/samsung-mobile-phones/t-mobile/samsung-u600.php'); this.data['SamsungU600'][this.data['SamsungU600'].length] = new Array('BT Mobile', '/samsung-mobile-phones/bt-mobile/samsung-u600.php'); this.data['SamsungU900Soul'] = new Array(); this.data['SamsungU900Soul'][this.data['SamsungU900Soul'].length] = new Array('T Mobile', '/samsung-mobile-phones/t-mobile/samsung-u900-soul.php'); this.handsets = new Array(); this.handsets[this.handsets.length] = new Array('Samsung E250', 'SamsungE250'); this.handsets[this.handsets.length] = new Array('Samsung F480 Tocco', 'SamsungF480Tocco'); this.handsets[this.handsets.length] = new Array('Samsung G600', 'SamsungG600'); this.handsets[this.handsets.length] = new Array('Samsung U600', 'SamsungU600'); this.handsets[this.handsets.length] = new Array('Samsung U900 Soul', 'SamsungU900Soul'); this.InitHandsets(); } AllPhoneSearchTwo.prototype.ChangeHandset = function(handset) { for (i = this.network_field.options.length; i >= 0; i--) { this.network_field.options[i] = null; } // Add the option to select the handset/network this.network_field.options[0] = new Option(((handset != "") ? "Now choose Network..." : "...then choose Network"), ""); // If a network is selected, add the options if (handset != "" && this.data[handset]) { // this.network_field.options[this.network_field.options.length] = new Option('all', 'all'); for (i = 0; i < this.data[handset].length; i++) { this.network_field.options[this.network_field.options.length] = new Option(this.data[handset][i][0], this.data[handset][i][1]); } if (this.previously_selected > 0) this.network_field.selectedIndex = this.previously_selected; if (this.phone_field != '') { this.phone_field.value = handset; } } } AllPhoneSearchTwo.prototype.ChangeNetwork = function(network) { var i; // Remove all the options out of the phone field for (i = this.phone_field.options.length; i >= 0; i--) { this.phone_field.options[i] = null; } // Add the option to select the handset/network this.phone_field.options[0] = new Option(((network != "") ? "Choose Handset first..." : "...then choose Network"), ""); // If a network is selected, add the options if (network != "" && this.data[network]) { for (i = 0; i < this.data[network].length; i++) { this.phone_field.options[this.phone_field.options.length] = new Option(this.data[network][i][0], this.data[network][i][1]); } if (this.previously_selected > 0) this.phone_field.selectedIndex = this.previously_selected; if (this.network_field != '') { this.network_field.value = Network; } } } AllPhoneSearchTwo.prototype.InitHandsets = function() { for (i = this.phone_field.options.length; i >= 0; i--) { this.phone_field.options[i] = null; } // Add the option to select the handset/network this.phone_field.options[0] = new Option("Choose Handset first...", ""); for (i = 0; i < this.handsets.length; i++) { this.phone_field.options[this.phone_field.options.length] = new Option(this.handsets[i][0], this.handsets[i][1]); } } AllPhoneSearchTwo.prototype.GoTo = function(url) { if (url != "") { document.location.href = url; } }