/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function chgDentist()
{
	var opts = $('#name').selectedOptions();
	var zip = opts[0].text.substr(-5);
	var id = opts[0].value;
	window.location = 'dentist/pid=' + id + '?zip=' + zip;
}

function stateChange()
{
/* Call the index.cfm page with the state as a parameter */

 var st = document.getElementById("st").value;
 var stmt = "index.php?st=" + st;
 window.location = stmt; 

 // Wanted to convert this to Ajax when time permits.
 // $.getJSON('/ajax/getDentistByState', {'state': $('#state').val()}, function(json) {
		// $('#name').removeOption(/./);

		// var options = {'0': 'Select By Dentist Name'};
		// for (var i = 0; i < json.length; i++) {
			// options[json[i].PracticeID] = json[i].LName + ', ' + json[i].FName + ' in ' + json[i].City + ', ' + json[i].Zip;
		// }

		// $('#name').addOption(options);
		// $('#name').selectOptions('0');
	// });
}
