function getCurrentRadioValue(obj) {
	for ( var i = 0; i < obj.length; i++)
		if (obj[i].checked)
			return obj[i].value;
}

var stRow = 0;
var enRow = 1;
var curRow = 0;
var totRow;// = 6;
window.onerror = function(msg, url, line) {
	var stRow = 0;
	var enRow = 1;
	var curRow = 0;
};
window.onload = function() {
	try {
		if (stRow != 0 || stRow == null) {
			stRow = 0;
			enRow = 1;
			curRow = 0;
		}
	} catch (e) {
		// alert(e);
	}
};

function Next(recipient_id) {
	try {

		document.getElementById("scrollContainer_" + recipient_id).style.display = "";
		if (curRow >= (totRow / 3))
			return;
		stRow = enRow;
		enRow += 3;
		curRow++;

		if (curRow > 1) {
			document.getElementById("previousButton_" + recipient_id).style.display = "";
		}

		if (enRow > totRow ) {
			document.getElementById("nextButton_" + recipient_id).style.display = "none";
		}

		for (i = 1; i <= totRow; i++) {
			var row = document.getElementById("row_" + i + "_" + recipient_id);
			if (row != null) {
				if (i >= stRow && i < enRow)
					row.style.display = "";
				else
					row.style.display = "none";
			}
		}
	} catch (e) {
		 alert(e);
	}
}

function Previous(recipient_id) {
	try {

		document.getElementById("scrollContainer_" + recipient_id).style.display = "";
		if (curRow <= 1)
			return;
		stRow -= 3;
		enRow -= 3;
		curRow--;

		document.getElementById("nextButton_" + recipient_id).style.display = "";

		if (curRow == 1) {
			document.getElementById("previousButton_" + recipient_id).style.display = "none";
		}

		for (i = 1; i <= totRow; i++) {
			var row = document.getElementById("row_" + i + "_" + recipient_id);
			if (row != null) {
				if (i >= stRow && i < enRow)
					row.style.display = "";
				else
					row.style.display = "none";
			}
		}
	} catch (e) {
		 alert(e);
	}
}