<!--
function showPage(obj, suffix, postThis){
//-- Navigation for the FIRST/NEXT/PREVIOUS/LAST page functionality of a selected list of records.
//-- This script uses buttons and $_REQUEST.
//--
//-- Using this script preserves all the fields needed by a $_REQUEST which would be lost using the Dreamweaver call URL with $_REQUEST method.
//--
//-- This func calls this page with the parameters POSTed for the First/Last/Next/Previous page operation.
//-- The show pictures tick box is also interrogated to see if it needs to be included in the URL parameters.
//--
//-- Note. 	Dreamweaver creates a set of 'standard' variables to handle the next/previous etc page functionality.
//--       	The first part of the variable name is specified by Dreamweaver, the suffux is programmer specified.
//-- 		Eg   pageNum   (pageNum_ = Dreamweaver, Recordset1 = programmer).
//-- To make this script transportable a suffix variable is used to identify the programmer defines part of the variable name.
//--
//-- Two hidden objects are required:
//-- Eg  <input name="pageNum" type="hidden" value="<?php echo($pageNum); ?>">
//--     <input name="totalRows" type="hidden" value="<?php echo($totalRows_cheque); ?>">	

//alert('function showPage postThis='+postThis+"  suffix="+suffix);
	
	if(suffix.length >0){
		suffix = '_'+suffix;
	}

	var page_num = 'pageNum' + suffix;
	var page_num2 = 'pageNum';
	
	var total_rows = 'totalRows' + suffix;
	var total_rows2 = 'totalRows';
	
	//-- A drop down list that lets the user select the required page (as opposed to FIRST/LAST/NEXT/PREV)
	var pagesObj = MM_findObj('pages');

	var pageNumObj = MM_findObj(page_num);
	var pageNum2Obj = MM_findObj(page_num2);
	if(!pageNumObj){
		if(!pageNum2Obj){
			alert("Error... The hidden field '" + page_num + "' does not exist in your form.");
		}else{
			pageNumObj = pageNum2Obj;
			page_num = page_num2;
		}
	}
	
	var totalRowsObj = MM_findObj(total_rows);
	var totalRows2Obj = MM_findObj(total_rows2);
	if(!totalRowsObj){
		if(!totalRows2Obj){
			alert("Error... The hidden field '" + total_rows + "' does not exist in your form.");
		}else{
			totalRowsObj = totalRows2Obj;
			total_rows = total_rows2;
		}
	}	

	var hiddenObj = MM_findObj('MM_formUsage');
	if(!hiddenObj){
		alert("Error... The hidden field 'MM_formUsage' does not exist in your form.");
	}
	
	if(postThis.length == 0){
		alert("ERROR in button_page_navigation.js 'postThis' is blank.");
	}else{
		var p_array1=postThis.split("?");
		var p_array2=p_array1[1].split("&");
		
		if(p_array2.length>0){
			if(p_array2[0].indexOf(page_num) != -1) {
				var pageNum_array = p_array2[0].split('=');		
				pageNumObj.value = pageNum_array[1];
				if(pagesObj){
					pagesObj.value =  pageNum_array[1];
				}
			}
		}
	
		if(p_array2.length>1){
			if(p_array2[1].indexOf(page_num) != -1) {
				var pageNum_array = p_array2[1].split('=');
				pageNumObj.value = pageNum_array[1];
				if(pagesObj){
					pagesObj.value =  pageNum_array[1];
				}
			}
		}
	
		if(p_array2.length>0){
			if(p_array2[0].indexOf(total_rows) != -1) {
				var totalRows_array = p_array2[0].split('=');
				totalRowsObj.value = totalRows_array[1];
			}
		}
	
		if(p_array2.length>1){
			if(p_array2[1].indexOf(total_rows) != -1) {
				var totalRows_array = p_array2[1].split('=')
				totalRowsObj.value = totalRows_array[1];
			}
		}
	}
//alert('function showPage OUT');	

	hiddenObj.value = 'view';
	obj.form.submit();

}

//-->