
function isaPosNum(s) {
	return (parseInt(s) >= 0)  }

function valcheck(item, min, max, fname) {
	var retval = 0
	if ( !isaPosNum(item.value))
		alert("Positive numbers in "+fname+" field only please")
	else if (parseInt(item.value) < min )
		alert("Enter " + fname + " greater than " + min)
	else if (parseInt(item.value) > max )
		alert("Enter " + fname + " less than " + max)
	else
		retval = item.value
	return retval  }



function recalculate(f) {
	document.jsfrm.pp.value= eval(f.cp.value)				<!-- xfer previous on-air pts to bottom -->
	document.jsfrm.ns.value=eval(eval(f.ct.value)+eval(f.or.value)*2+eval(f.ow.value)*2+eval(f.ok.value)) <!-- seals collected  -->
	document.jsfrm.po.value=eval(f.oc.value)				<!-- xfer old points collected to bottom -->
	document.jsfrm.hn.value=eval(f.nh.value)				<!-- xfer new points collected to bottom -->
	document.jsfrm.pt.value=eval(eval(f.po.value)+eval(f.hn.value))	<!-- calc sum of old and new pts -->
	document.jsfrm.sl.value = eval(f.sp.value)				<!-- xfer spl to bottom -->
	var a=0;
	var b=0;
	var c=0;
	var banked=0;
	var d=0;
	var e=0;
	var x=0;
	var y = 0;
	var z=0;
	y=eval(f.nh.value)+eval(f.ob.value)			<!-- Add collected and banked points -->

	if(y>0)
		{
		if (f.po.value>4999)
			{
			c=Math.floor(y/500);
			}
		else
			{
<!-- Line 46 -->
			if(f.po.value>1999)
				{
				x=(eval(document.f.po.value)-2000);			<!-- how much over -->
				y=eval(f.nh.value)+eval(f.ob.value)+eval(f.po.value); <!-- total value of upgrade -->
				if (y>5000)					<!-- will it jump ranges? -->
					{
					y=eval(f.nh.value)+eval(f.ob.value)
					z=3000-x;				<!-- find how much over -->
					b=Math.floor(z/300);
					y=(eval(f.nh.value)+eval(f.ob.value)-(300*b))
					c=Math.floor(y/500);
					}
				else
					{
					y=eval(f.nh.value)+eval(f.ob.value);
					b=Math.floor(y/300);
					}
				} 
			else	
				{
<!-- line 67 -->
				if(f.po.value>1499)
					{
					x=(eval(f.po.value)-1500);		<!-- how much over -->
					y=eval(f.nh.value)+eval(f.ob.value)+eval(f.po.value);
					if (y > 4999)
						{
						y=eval(f.nh.value)+eval(f.ob.value)
						z=500-x;
						a=Math.floor(z/100);
						y=(eval(f.nh.value)+eval(f.ob.value)-((100*a)+(3000)));
						b=10;
						c=Math.floor(y/500);
						}
					else
						{
						 if( y > 1999)
							{
							y=eval(f.nh.value)+eval(f.ob.value)
							z=500-x;
							a=Math.floor(z/100);
							y=(eval(f.nh.value)+eval(f.ob.value)-((100*a)+(300*b)));
							b=Math.floor(y/300);
<!--  line 90 -->
							}
						else
							{
							y=eval(f.nh.value)+eval(f.ob.value)
							a=Math.floor(y/100);
							}
						}
					}
				else <!-- po < 1500 -->
					{

					<!-- Seals go here -->
					
					}
				}
			}
		}

	y=eval(f.nh.value)+eval(f.ob.value)			<!-- Add collected and banked points -->
	banked=(y-((100*a)+(300*b)+(500*c)))
	document.jsfrm.kb.value=banked;			
	document.jsfrm.tp.value = a+b+c;				<!-- number of points earned  -->
	document.jsfrm.ep.value=eval(f.tp.value)
	document.jsfrm.tu.value=eval(eval(f.ns.value) +		<!-- calculate ug pts -->
			eval(f.sl.value) +
			eval(f.tp.value)) ;
	document.jsfrm.nv.value=eval(eval(f.tu.value) +		<!-- calculate new pts -->
			eval(f.pp.value)) 

}

<!-- Here down OK -->

<!-- This sets todays date in the field of the form -->
  var timerID = null
  var timerRunning = false


  function MakeArray(size) 
<!-- line 90 -->
  {
  this.length = size;
  for(var i = 1; i <= size; i++)
  {
  this[i] = "";
  }
  return this;
  }

  function stopclock (){
  if(timerRunning)
  clearTimeout(timerID);
  timerRunning = false

  }

  function showtime ()
 {
<!-- line 100 -->
  var now = new Date();
  year = new String(now.getYear())
  yearLen = year.length
  year = year.split("")
  year = year[yearLen - 2] + year[yearLen - 1]
  var month = now.getMonth() + 1;
  var date = now.getDate();

  var timeValue = "";
  timeValue += ((month < 10) ? " 0" : " ") + month + "-";
  timeValue += date + "-" + year + " ";

  document.jsfrm.fd.value = timeValue;
  timerID = setTimeout("showtime()",1000);
  timerRunning = true
  }




  function startclock () 
 {
stopclock();
showtime() 
 }

