// vc_id = "$Id: lib.js 9260 2006-06-09 00:14:53Z robert $"
// JavaScript Document
// Global Variables to find mouse XY
var IE = document.all?true:false
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

// Mouse Position vars
var tempX = 0
var tempY = 0

//previousNext
var firstListing = 1;
var lastListing = 10;

function getMouseXY(e) {

  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.documentElement.scrollLeft
    tempY = event.clientY + document.documentElement.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
  return true
}

function showPopUpValue (s,showHide) {
	//alert(document.body.scrollLeft);
	var popUpObj = document.getElementById('popUpHolder');
	var popUpTextObj = document.getElementById('popHolderText');
	if (showHide == 1) {
		popUpTextObj.innerHTML = s;
		popUpObj.style.display = 'block';
		tempX = tempX - 46;
		tempY = tempY - 50;
		popUpObj.style.left =  tempX + 'px';
		popUpObj.style.top =  tempY + 'px';
	} else {
		popUpTextObj.innerHTML = '';
		popUpObj.style.display = 'none';
	}
}

function voidURL () {
	return;
}

function previousNext (prevNext,totalListings) {
	//alert(firstListing + ',' + lastListing)
	if ((prevNext == 0) && (firstListing > 1) || (prevNext == 1) && (lastListing < totalListings)) {
		if (prevNext == 1) {
			firstListing = firstListing + 10;
			lastListing = lastListing + 10;
		} else {
			firstListing = firstListing - 10;
			lastListing = lastListing - 10;
		}
		for (i=1;i<=totalListings; i++) {
			if ((i >= firstListing) && (i <= lastListing)) {
				document.getElementById('listingSet' + i).style.display = 'block';
			} else {
				document.getElementById('listingSet' + i).style.display = 'none';
			}
		}
	}
}