
function setLocationID(name,value){
	name.form['location[id]'].value = value.id.split('_')[1];
}
function setLocation2ID(name,value){
alert('This shouldn\'t be used anymore (setLocation2ID)')
	document.forms[0]['location[id]'].value = value.id.split('_')[1];
}
function setLocation3ID(name,value){
alert('This shouldn\'t be used anymore (setLocation3ID)')
	setHasLocationID(name,value);
}
function setLocation4ID(name,value){
alert('This shouldn\'t be used anymore (setLocation4ID)')
	setHasLocationID(name,value);
}

function setRecommendationLocationID(name,value){
	setHasLocationID(name,value,'recommendation');
}

function setRecommendationRequestLocationID(name,value){
	setHasLocationID(name,value,'recommendation_request');
}

function setUserLocationID(name,value){
	setHasLocationID(name,value,'user');
}

function setHasLocationID(name,value,field_prefix){
	var hidden_field_prefix = field_prefix == null ? name.name.split('[')[0] : field_prefix;
	name.form[hidden_field_prefix+'[location_id]'].value = value.id.split('_')[1];
}
