function populateHiddenVars() {
	document.getElementById('sortingParams').value = Sortable.sequence('Sortable_list');
	return true;
}

function confirmDelete(myURL){
	if(confirm('Are you sure you want to delete this item from the database? This cannot be undone.')) location.href = myURL;
}

function handleResponse() {
	if(http.readyState == 4){

		var return_string = http.responseText;

		//window.alert(return_string);

		//if there's an error in the update
		if (return_string.substring(0,5) == 'error'){
			var broken_string = return_string.split("|");
			var id = broken_string[1];
			var old_value = broken_string[2];

			//display the display section, fill it with prior content
			document.getElementById(id+'_rg_display_section').innerHTML = old_value;
			document.getElementById(id+'_rg_display_section').style.display = '';
			//hide editing and saving sections
			document.getElementById(id+'_hv_editing_section').style.display = 'none';
			document.getElementById(id+'_hv_saving_section').style.display = 'none';
		}

		else{
			var broken_string = return_string.split("|");
			var id = broken_string[0];
			var replaceText = broken_string[1];

			//var replaceText = document.getElementById(return_string).value;
			//display the display section, fill it with new content
			if (replaceText != "{selectbox}"){
				document.getElementById(id+'_rg_display_section').innerHTML = replaceText;
			}
			else{
				var the_selectbox = document.getElementById(id);
				document.getElementById(id+'_rg_display_section').innerHTML = the_selectbox.options[the_selectbox.selectedIndex].text;
			}
			document.getElementById(id+'_rg_display_section').style.display = '';
			//hide editing and saving sections
			document.getElementById(id+'_hv_editing_section').style.display = 'none';
			document.getElementById(id+'_hv_saving_section').style.display = 'none';
		}
	}
}

function hover(obj){
    obj.className='class_hover';
}

function unHover(obj){
    obj.className = 'class_no_hover';
}