function NextListingSet() {

		totalListings = document.AForm.txtTotalListings.value;
		thisPgNum = document.AForm.txtThisPgNum.value;
		nxPgNum = (thisPgNum-0) + 1;
		noListingsDisplayed = (thisPgNum-0) * 10;
		noListingsRemain = (totalListings-0) - noListingsDisplayed;
		aSEOString = document.AForm.txtS.value;
		state = document.AForm.txtState.value;		
		country = document.AForm.txtCountry.value;
				
		//alert("totalListings :  " + totalListings + ", thisPgNum :  " + thisPgNum + ", nxPgNum :  " + nxPgNum + ", noListingsDisplayed :  " + noListingsDisplayed + ", noListingsRemain :  " + noListingsRemain + ", aSEOString :  " + aSEOString + ", state :  " + state + ", country :  " + country);
		//need to see if US brokers or not!!!
		
		if (noListingsRemain > 0){
			if ((thisPgNum-0) == 0){
				nxPgNum = 2;
				if (country != "Canada") {
					window.location.href="brokers.asp?state=" + state + "&s=" + aSEOString + "&pg=" + nxPgNum;
				}
				else{
					//alert("CANADA");
					window.location.href="brokers.asp?state=" + state + "&country=Canada&s=" + aSEOString + "&pg=" + nxPgNum;
				}
			}
			else{
				nxPgNum = (thisPgNum-0) + 1;
				if (country != "Canada") {
					window.location.href="brokers.asp?state=" + state + "&s=" + aSEOString + "&pg=" + nxPgNum;
				}
				else{
					window.location.href="brokers.asp?state=" + state + "&country=Canada&s=" + aSEOString + "&pg=" + nxPgNum;
				}
			}
		}
		else{
			alert("There are no more brokers.");
		}
}	
			
function PrevListingSet(){
		thisPgNum = document.AForm.txtThisPgNum.value;
		prevPgNum = (thisPgNum-0) - 1;
		
		aSEOString = document.AForm.txtS.value;
		state = document.AForm.txtState.value;
		country = document.AForm.txtCountry.value;
				
		if (thisPgNum > 1){
			if (country != "Canada") {
				window.location.href="brokers.asp?state=" + state + "&s=" + aSEOString + "&pg=" + prevPgNum;
			}
			else{
				window.location.href="brokers.asp?state=" + state + "&country=Canada&s=" + "&s=" + aSEOString + "&pg=" + prevPgNum;
			}
		}
		else{
			alert("There are no more brokers.");
		}
}

<!-- hide from old browsers
function getdate() {
 var mydate = new Date();
 var dayofweek = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
 var months = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
 var myYear = mydate.getYear();
 if (myYear < 1000) myYear += 1900;
 //document.write(mydate.getMonth()+1,".",mydate.getDate(),".",mydate.getFullYear());
 //document.write(dayofweek[mydate.getDay()] + ", " + mydate.getDate() + " " + months[mydate.getMonth()] + " "  + myYear);
 document.write(dayofweek[mydate.getDay()] + ", " + months[mydate.getMonth()] + " " + mydate.getDate() + ", "  + myYear);
 }
//-->

<!-- Hide script from older browsers
	
function jumpPage(newLoc) 
{  newPage = newLoc.options[newLoc.selectedIndex].value
if (newPage != "") 
	{  window.location.href = newPage  }
}

// End hiding script from older browsers -->