/* This function is to record any clicks (referrals) on Partners and Dealerships
 * the Sundowner website
 */
function recordClick(agent, id) {
	var url = '/referrals/record/' + agent + '/' + id;
	new Ajax.Request(url, {
		method: "get"
	});
}
/* This function generates a select list of states from a given country
 * Used in: Dealer Search
 */
function getStateList(name, id, country_id) {
	var url = '/states/stateList/' + name + '/' + id + '/' + country_id;
	new Ajax.Updater('state', url, {
		asynchronous: true,
		method: 'get'
	});
}
/* This function generates a select list of zip codes > city names from a given
 * state.
 * Used in: Events > add
 */
function getCityList(model, state_id) {
	var url = '/zip_codes/cityList/' + model + '/' + state_id;
	new Ajax.Updater('city', url, {
		asynchronous: true,
		method: 'get'
	});
}

