var whitespace = " \t\n\r";
function isEmpty(s)
{
	return ((s == null) || (s.length == 0))
}

function isWhitespace(s)
{
	var i;
	if (isEmpty(s))
		return true;

	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (whitespace.indexOf(c) == -1)
			return false;
	}
	return true;
}

function dataValidate(theForm)
{
	if (theForm.pgNum.value == "")
	{
		alert("Please enter a valid Page Number Only.");
		theForm.pgNum.focus();
		theForm.pgNum.select();
		return (false);
	}

	var strField = new String(theForm.pgNum.value);
	if (isWhitespace(strField))
		return true;

	var i = 0;
	for (i = 0; i < strField.length; i++)
		if (strField.charAt(i) < '0' || strField.charAt(i) > '9')
		{
			alert("Page Number must be a valid numeric entry.  Please do not use any non-numeric symbols.");
			theForm.pgNum.focus();
			theForm.pgNum.select();
			return false;
		}

	return true;
}

function popupMod(page, width, height, resizable, scrollbars, status, toolbars){ 
	window.open(page,"popup","width="+width+",height="+height+","+resizable+","+scrollbars+","+status+","+toolbars)
}

function popup(page){ 
	window.open(page,"popup","width=625,height=350,resizable=yes,scrollbars=yes,status=no,toolbars=no")
}

function ask()
{
	var agree = confirm("Are you sure you want to completely remove ALL items from your cart?");
	if (agree)
		return true
	else
		return false;
}

	
function showPic (whichpic) {
 if (document.getElementById) {
  document.getElementById('placeholder')
  .src = whichpic.href;
  if (whichpic.title) {
   document.getElementById('desc')
  .childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById('desc')
  .childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}


function showPicFromLink (whichpic, whichplaceholder, whichdesc) {
 if (document.getElementById) {
  document.getElementById(whichplaceholder)
  .src = whichpic.href;
  if (whichpic.title) {
   document.getElementById(whichdesc)
  .childNodes[0].nodeValue = whichpic.title;
  } else {
   document.getElementById(whichdesc)
  .childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
  }
  return false;
 } else {
  return true;
 }
}


function PrintPage(){
   blnVersion = parseInt(navigator.appVersion)
   if (blnVersion >= 4) window.print()
}

