function changePrevData(data) {
	document.getElementById('comBox').innerHTML = '';
	var dup = document.getElementById('checkDup').value;
	if(dup == "0") {
		var val1 = document.getElementById('comResPrev').innerHTML;
		var val2 = document.getElementById('comRes').innerHTML;
		var newVal = val2 + val1;

		//Divcomment.Hide();
		document.getElementById('comResPrev').innerHTML = newVal;			
		Divcomment.ChangeContent('./include/rateRequest.php', data);
	
		document.getElementById('checkDup').value = 1;
	}
}

// Removes leading whitespaces
function LTrim( value ) {
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
}

// Removes ending whitespaces
function RTrim( value ) {
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
	return LTrim(RTrim(value));
}	