﻿//************************************************************************
//RepeaterPager.cs
function __PagerGotoPage(page){
	var element = __PagerGetCurrentPage();
	if (element) {
		element.value = page;
		document.forms[0].submit();
	}
}

function __PagerSetSelectedValue(str){
	var element = __PagerGetSelectedValue();
	if (element) {
		element.value = str;
		document.forms[0].submit();
	}
}

function __PagerFirst(){
	__PagerGotoPage(1);
}

function __PagerPrior(){
	var p = __PagerGetCurrentPage();
	__PagerGotoPage((parseInt(p.value)-1));
}

function __PagerNext(){
	var p = __PagerGetCurrentPage();    
	__PagerGotoPage((parseInt(p.value)+1));
}

function __PagerLast(){
	var p = __PagerGetPageCount();    
	__PagerGotoPage(parseInt(p.value));
}

function __PagerGetCurrentPage(){
	var element = document.forms[0]['__CURRENTPAGE'];
	return element;
}

function __PagerGetPageCount(){
	var element = document.forms[0]['__PAGECOUNT'];
	return element;
}
		
function __PagerGetSelectedValue(){
	var element = document.forms[0]['__PAGERSELECTEDVALUE'];
	return element;
}

function __TabMenu(page){
	var element = __TabMenuGetSelectedValue();
	if (element) {
		element.value = page;
		document.forms[0].submit();
	}
}

function __TabMenuGetSelectedValue(){
	var element = document.forms[0]['__TABID'];
	return element;
}
		
		
//************************************************************************
// SearchBy.cs        
function SearchBy(lstField, lstOperator, txtText)
{
	var element = document.forms[0]['__SEARCHBYFIELD'];
	element.value = lstField.value;
	element = document.forms[0]['__SEARCHBYOPERATOR'];
	element.value = lstOperator.value;
	element = document.forms[0]['__SEARCHBYTEXT'];
	element.value = txtText.value;
	element = document.forms[0]['__SEARCHBYCLICK'];
	element.value = "1";
	
	document.forms[0].submit();
}
	 
