var guestRoomPnts = 0;
	var cateringPnts = 0;
	var totalPnts = 0;
	var trVal1, trVal2, trVal3, trVal4, trVal5, trVal6, trVal7, trVal8, trVal9; 
	
	function writeVal(id,str) {
	var o = window.document.getElementById('bonus'+id.toString());
	  if (document.layers) {
	    with(o.document) {
	    open();
	    writeln('<span id="bonus'+id+'" class="bonusUp">'+str+'</span>');
	    close();
	    }
	  } else {
	  o.innerHTML = str;
	  }
	}
	
	function calcPoints() {
	  var o = window.document.getElementById('divCalc1');
	  var m = (o.where[0].checked) ? [250,50,50,50,100,100,250] : [250,250,100,50,50,50,100];
	  var t = 0;
	  var a = false;
	  for(var i=1; i<8; i++) {
	    var v = o['tr'+i].value;
		if(v && v < 10) {
		  if(!a) {
		    alert('Must have a minimum of 10 rooms per night to earn bonus points');
			a = true;
		  }
		} else if(isNaN(v)) {
		  alert("Please enter only numeric values.");
		} else {
		  var p = v * m[i-1];
		  t = t + p;
		  writeVal((i-1),p);			  
		}
	  }
      guestRoomPnts = t;
	  if(guestRoomPnts > 50000){
	    guestRoomPnts = 50000;
		alert("The program you entered has exceeded the maximum points you can earn in conjunction with a single meeting or event.  If this program actualized, you would receive the maximum limit of 50,000 bonus points." );
	  }
	  totalPnts = (guestRoomPnts) + (cateringPnts);
	  writeVal(7,guestRoomPnts);
	  writeVal(11,totalPnts);
	}
	
	function cateringPoints() {
	var o = window.document.getElementById('divCalc1');
	trVal8 = (o.tr8.value) * 1;
	trVal9 = (o.tr9.value) * 2;

	cateringPnts = (trVal8) + (trVal9);
	totalPnts = (guestRoomPnts) + (cateringPnts);
		
	var chkNum1 = isNaN(totalPnts);
		if(chkNum1==true){
		alert("Please enter only numeric values.");
		} else {		
		writeVal(8,trVal8);	
		writeVal(9,trVal9);	
		writeVal(10,cateringPnts);
		writeVal(11,totalPnts);
		}
	}