
//nextPage is used by the google map display pages to show the next block of listings
function nextPage(pageNum)
{
	var theLocation = new String(document.location)
	var varCheck = theLocation.indexOf("?");
	var placeholder = theLocation.indexOf("currentPage=");
	if(varCheck == -1)//there were no URL vars, so append currentpage and load new url
	{
		document.location = document.location+"?currentPage="+pageNum;
	}
	else if(placeholder != -1)//there was already a currentPage var , get rid of it and reload w/ new page num.
	{
		var tmpLocation = theLocation.slice(0,placeholder);
		document.location = tmpLocation+"currentPage="+pageNum;
	}
	else
	{
		document.location = document.location+"&currentPage="+pageNum;
	}
}
//******************************************************
var googleWindow = 0;

function popGoogleMap(cat)
{
	var left = 10;
	var top = 10;
	var width = 1024;
	var height = 760;

  if(googleWindow)
  {
    if(!googleWindow.closed) googleWindow.close();
  }

  googleWindow = open('googleMap.cfm?searchCategory='+cat, 'googleWindow', 'toolbar=1,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,copyhistory=0,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

//****************************//

/***********************/
// google pop up window
var theWindow2 = 0;
function popListingDetails(id,cat)
{
  if(theWindow2)
  {
    if(!theWindow2.closed) theWindow2.close();
  }
  //we need to determine which category we are dealing w/.  hikes, paddles, birding are all unique, the rest we can render dynamically
  if(cat == 'farmersmarkets')
  {
	  theWindow2 = open('marketPop.cfm?id='+id, 'theWindow2', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=yes,copyhistory=yes,width=800,height=500,left=10,top=10,screenX=10,screenY=10');
  }
  else
  {
	  theWindow2 = open('farmPop.cfm?id='+id, 'theWindow2', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=yes,copyhistory=yes,width=800,height=500,left=10,top=10,screenX=10,screenY=10');
  }
}


function popGoogleListing(cat,id)
{
	var left = 10;
	var top = 10;
	var width = 1024;
	var height = 760;

  if(googleWindow)
  {
    if(!googleWindow.closed) googleWindow.close();
  }
var theURL = 'googleMap.cfm?searchCategory='+cat+'&theIDList='+id;
  googleWindow = open(theURL, 'googleWindow', 'toolbar=1,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,copyhistory=0,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}
