function PrevPage (intThisPage, intTotalPages) {
				var intGotoPage;
				if (intThisPage > 1) {
					intGotoPage = intThisPage - 1;
					GotoPage(intGotoPage);
				}
			}
			function NextPage (intThisPage, intTotalPages) {
				var intGotoPage;
				if (intThisPage < intTotalPages) {
					intGotoPage = intThisPage + 1;
					GotoPage(intGotoPage);
				}
			}
			function JumpPage (intTotalPages) {
				var intGotoPage;
				var txtPageNo = document.getElementById('txtGotoPageNo');
				if (txtPageNo) {
					if (IsNumeric(txtPageNo.value)) {
						intGotoPage = txtPageNo.value;
						if ((intGotoPage <= intTotalPages) && (intGotoPage > 0)) {
							GotoPage(intGotoPage);
						}
					}
				}
			}
			
			function SortList(sortBy){
				var strPageParam = sortBy;
				var thisPage = window.location.pathname;
				window.location=AppendQuerystring(thisPage,"stfld", strPageParam);
			}
			
			function GotoPage (intGotoPage) {
				var thisPageFound = document.getElementById("itP" + intGotoPage + "I1");
				var numPerPage = document.getElementById("hidNumPerPage").value;
				if (thisPageFound && numPerPage) {
				    for (i = 1; i < parseInt(numPerPage) + 1 ; i++) {       
						var itemThis = document.getElementById("itP" + intGotoPage + "I" + i);
						if (itemThis) {
							itemThis.style.display = "";
						}
				    } 
				    var pageNoTop = document.getElementById("pageNoTop");
					if (pageNoTop) {
					   var intLastPage = pageNoTop.innerText;
					   for (i = 1; i < parseInt(numPerPage) + 1 ; i++) {       
						  var itemThis = document.getElementById("itP" + intLastPage + "I" + i);
						  if (itemThis) {
						 	itemThis.style.display = "none";
					 	  }
					   } 
					   pageNoTop.innerText = intGotoPage;
					}
					 var pageNoBottom = document.getElementById("pageNoBottom");
					if (pageNoBottom) {
					 pageNoBottom.innerText = intGotoPage;
					}
				}else{
				    var strPageParam =  intGotoPage;
				    var thisPage = window.location.pathname;
				    window.location=AppendQuerystring(thisPage,"PageNo",strPageParam);
				}
			}
			
					
			function AppendQuerystring (strPage, strKey, strValue) {
				var strCurrent = window.location.href ;
				var strQueryStrings = window.location.search.substring(1);
				var strNew;
				var blnReplace = false;
				
				if (strQueryStrings) {
				    var strParams = strQueryStrings.split("&");
				    for (i = 0; i < strParams.length ; i++) {
				      if (strParams[i].indexOf(strKey) > -1) {
				         strParams[i] = strKey + "=" + strValue
				         blnReplace = true;
				      }
				    }
				    if (blnReplace) {
				        strQueryStrings=strParams[0];
				        for (i = 1; i < strParams.length ; i++) {
				           strQueryStrings = strQueryStrings + "&" + strParams[i];
				        }
				       strNew = strPage + "?" + strQueryStrings;
				    }else{
				        strQueryStrings=strParams[0];
				        for (i = 1; i < strParams.length ; i++) {
				           strQueryStrings = strQueryStrings + "&" + strParams[i];
				        }
				       strNew = strPage + "?" +  strQueryStrings + "&" + strKey + "=" + strValue;
				    }
				}else{
					strNew = strPage + "?" + strKey + "=" + strValue;
				}
				return strNew;
			}
			
			function IsNumeric(sText) {
				var ValidChars = "0123456789.";
				var IsNumber=true;
				var Char;
 
				for (i = 0; i < sText.length && IsNumber == true; i++) {
					Char = sText.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) {
						IsNumber = false;
					}
				}
				return IsNumber;
			}

			function locationChange() {
				var rLocal = document.getElementById('rLocLocal');
				var thisPage = window.location.pathname;
				if (rLocal) {
				    if (rLocal.checked) {
						window.location=AppendQuerystring(thisPage,"local", "1");
					}
				}
				var rLocAll = document.getElementById('rLocAll');
				if (rLocAll) {
				    if (rLocAll.checked) {
						window.location=AppendQuerystring(thisPage,"local", "0");
					}
				}
			}
			function checkLocation(){
			
				var rLocal = document.getElementById('rLocLocal');
				if (rLocal){
				  var strQueryStrings = window.location.search.substring(1);
				  document.getElementById('rLocAll').checked=true;
				  if (strQueryStrings) {
				      var strParams = strQueryStrings.split("&");
				      for (i = 0; i < strParams.length ; i++) {
				        if (strParams[i].indexOf("local=1") > -1) {
				            rLocal.checked=true;
					    document.getElementById('rLocAll').checked=false;
				
				        }
				      }
				  }
				}

		    }
		    
		       function SearchAuctions() { 
		           var strText;
		           var strInCat;
		           if (document.getElementById('txtSearchText')) { 
                       strText=document.getElementById('txtSearchText').value; 
                   }
                    if (document.getElementById('cbCategory')) { 
                       strInCat=document.getElementById('cbCategory').checked; 
                   }
                   var strQueryStrings = window.location.search.substring(1);
                 
            	   var strCat = '';
            	   if (strQueryStrings) {
            	      var strParams = strQueryStrings.split('&');
            	      for (i = 0; i < strParams.length ; i++) {
            	          if (strParams[i].indexOf('Cat1') > -1) {
            		         strCat = strParams[i];
            		      }
            		       if (strParams[i].indexOf('Cat2') > -1) {
            		         strCat = strParams[i];
            		      }
            		       if (strParams[i].indexOf('Cat3') > -1) {
            		         strCat = strParams[i];
            		      }
            		  }
                   }
                   var strTemp = 'AuctionList.aspx?SearchText='+ strText + '&InCat=' + strInCat + '&' + strCat  ;
                   window.location = strTemp; 
               }
            