var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
//alert(message);
return false;
}
}

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all)
	{
		if (e.which==2||e.which==3)
		{
		alert(message);
		return false;
		}
	}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
}

function show_products(path)
{
	var sFeatures, h, w, win, i
	h = window.screen.availHeight 
	w = window.screen.availWidth 
	sFeatures = "height=" + h*.55 + ",width=" + w*.60 + ",screenY=" + (h*.30) + ",screenX=" + (w*.33) + ",top=" + (h*.30) + ",left=" + (w*.33) + ",resizable=yes,scrollbars = yes"
	win = window.open(path,"products",sFeatures)
}  


function ValidateForm(theForm)
	{
	var i;
	
	    for (i = 0; i < theForm.length; i++)
	    {
			if (theForm[i].type == "text")
			{
			if (theForm[i].value != "")	return true;
			}
	    }
		alert("You must enter a quantity for at least one item.");
		return false;
	
	}


function isInteger(theField, emptyOK, theMessage)
	{
	  if (theField.value == "")
	  {
		if (emptyOK)
		{
			return(true);
		}
		{
			alert(theMessage);
			theField.focus();
			theField.select();
		  return (false);
		}
	  }

	    var i;
	    var s = theField.value;
	    for (i = 0; i < s.length; i++)
	    {
	        var c = s.charAt(i);
	        if (!((c >= "0") && (c <= "9")))
	        {
				alert(theMessage);
				theField.focus();
				theField.select();
	            return (false);
	        }
	    }
	  if (s > 0)
	  {
	  return (true);
	  }
	  {
		alert(theMessage);
		theField.focus();
		theField.select();
		return (false);
	  }
	}
 
 
function popup()
{

var winModalWindow;


 	winModalWindow = window.open('http://www.ebay.com','PopUp','scrollbars=yes,dependent=yes,alwaysRaised=yes,Width=300,Height=400' );

 if (winModalWindow.focus)
  
  {
	window.top.captureEvents (Event.CLICK|Event.FOCUS)
	window.top.onclick=IgnoreEvents
	window.top.onfocus=HandleFocus 
	winModalWindow.focus();
  }
  
  return false;

}


function isNumeric(theField, emptyOK, theMessage)
{
  if (theField.value == "")
  {
	if (emptyOK)
	{
		return(true);
	}
	{
		alert(theMessage);
		theField.focus();
		theField.select();
	  return (false);
	}
  }
  
  var checkOK = "0123456789.";
  var checkStr = theField.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (allValid)
  { return(true) }
  {
	alert(theMessage);
	theField.focus();
	theField.select();
    return (false);
  }
}

function isEmpty(theField,theMessage)
{
if (theField.value == "")
	{	
	alert(theMessage);
	theField.focus();
	theField.select();
	return(true);
	}
	{
	return(false);
	}
}

function isInteger(theField, emptyOK, theMessage)
	{
	  if (theField.value == "")
	  {
		if (emptyOK)
		{
			return(true);
		}
		{
			alert(theMessage);
			theField.focus();
			theField.select();
		  return (false);
		}
	  }

	    var i;
	    var s = theField.value;
	    for (i = 0; i < s.length; i++)
	    {
	        var c = s.charAt(i);
	        if (!((c >= "0") && (c <= "9")))
	        {
				alert(theMessage);
				theField.focus();
				theField.select();
	            return (false);
	        }
	    }
	  if (s > 0)
	  {
	  return (true);
	  }
	  {
		alert(theMessage);
		theField.focus();
		theField.select();
		return (false);
	  }
	}
	
	function ValidateForm(theForm)
	{
	var i;
	
	    for (i = 0; i < theForm.length; i++)
	    {
			if (theForm[i].type == "text")
			{
			if (theForm[i].value != "")	return true;
			}
	    }
		alert("You must enter a quantity for at least one item.");
		return false;
	
	}

	
	function ValidateForm(theForm)
	{
	var i;
	
	    for (i = 0; i < theForm.length; i++)
	    {
			if (theForm[i].type == "text")
			{
			if (theForm[i].value != "")	return true;
			}
	    }
		alert("You must enter a quantity for at least one item.");
		return false;
	
	}




function getTipUrl(url)
{
var pstrURL,PreView;
pstrURL='';				
PreView=window.open(url,"Preview","toolbar=0,location=0,directories=0,status=0,menubar=No,copyhistory=0,scrollbars=1,width=400,height=300");
}

function generateFile(filename)
{
var newWin;
newWin=window.open('http://www.performancepeddler.com/' + filename, 'channelFile', 'dependent=yes, width=600, height=300,scrollbars=yes, screenX=400, screenY=300, titlebar=yes');
}