
function prevLinks(event, currIndex, maxLinks, formName){
	var which;
	which = "";

	// find first_index
	firstIndex = currIndex - maxLinks;
	if(firstIndex < 0) firstIndex = 0;

	for(cntId = firstIndex; cntId < currIndex; cntId++){
		which += "<table class='menuTable' cellspacing='0'><tr><td class='menuText'><a href=\"javascript: submitNavigationForm(" + cntId + ", '" + formName + "')\">" + ( ( cntId == 0 ) ? "Start" : "Page " + ( cntId + 1 ) ) + "</a></td></tr></table>";
	}
	
	showMenu(event, which);
}

function nextLinks(event, maxRows, currIndex, maxLinks, totalRows, formName){
	var which;
	which = "";

	for(cntId = currIndex + 1; ( cntId < ( maxLinks + currIndex + 1 ) && ( cntId * maxRows ) < totalRows ); cntId++){
		which += "<table class='menuTable' cellspacing='0'><tr><td class='menuText'><a href=\"javascript: submitNavigationForm(" + cntId + ", '" + formName + "')\">" + ( ( ( totalRows - ( cntId * maxRows ) ) < maxRows ) ? "End" : "Page " + ( cntId + 1 ) ) + "</a></td></tr></table>";
	}

	showMenu(event, which);
}

function submitNavigationForm(currIndex, formName){
	// Here just two things needs to be done. Set the currInd variable and submit form
	var strForm = "document." + formName;
	eval(strForm).currIndex.value = currIndex;
	eval(strForm).submit();
}

function submitNavigationFormNew(maxFrontRows, formName){	
	// Here just two things needs to be done. Set the currInd variable and submit form
	var strForm = "document." + formName;
	eval(strForm).currIndex.value = 0;
	eval(strForm).maxFrontRows.value = maxFrontRows;	
	eval(strForm).submit();
}