add:  oldSort = oldSort + ""; 
context: function updateSort(form, oldSort, newSort, elementName){	var e, i, oldSortValue;		//Loop through elements to retrieve the oldSort Value from the hidden fields, and to set the oldSortValue = the newSort value	for(i=0; i<form.elements.length; i++) {		e = form.elements[i];		if ((e.name == oldSort) && (e.type == "hidden")) {			oldSortValue = e.value;			e.value = newSort;		}	}		//This is done so JavaScript will treat these variables as numbers, and not strings	oldSortValue = (oldSortValue - 0);	newSort = (newSort - 0);		if ((newSort > oldSortValue)) {		for(i=0; i<form.elements.length; i++) {			e = form.elements[i];			if (e.type == "text") {				if (e.name != elementName) {					e.value = (e.value - 0);					if ((e.value > oldSortValue) && (e.value <= newSort)) {						//this variable stores the hidden field, which contains the oldSortValue for this reserve item						var k = form.elements[i-1];						//decrement the current SortValue						e.value = (e.value - 1);						//update the oldSort value stored in the hidden field						k.value = e.value;					} 				} 			}		}	} else if ((newSort < oldSortValue)) {		for(i=0; i<form.elements.length; i++) {			e = form.elements[i];			if (e.type == "text") {				if (e.name != elementName) {					e.value = (e.value - 0);					if ((e.value < oldSortValue) && (e.value >= newSort)) {						//this variable stores the hidden field, which contains the oldSortValue for this reserve item						var k = form.elements[i-1];						//increment the current SortValue 						//(the addition is performed as minus a negative value b/c JavaScript treats the '+' operator as string concatenation)						e.value = (e.value - -1);						//update the oldSort value stored in the hidden field						k.value = e.value;					}				} 			}		}	}}
meta: 9882	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9882/8f059b145bef2c56384f1d59661b207fa2c13dbb/jsFunctions.js/clean/secure/javascript/jsFunctions.js