function checkInt(dt) {
	for(i=0;i<dt.length;i++){
		t=dt.charAt(i);		
		if(t<"0" || t>="9"){alert("Not a valied number");return false;}
	
	}
	return true;
}

<!-- Create arrays -->
var lampArray = new Array("('25','25','true','true')",
"('40','40')",
"('60','60')",
"('100','100')",
"('200','200')");
//"('Other')");

var cfanArray = new Array("('42 in','50','true','true')",
"('48 in','60')",
"('52 in','70')");
//"('Other')");

var tfanArray = new Array("('40','40','true','true')");
//"('Other')");

var eironArray = new Array("('550','550','true','true')",
"('750','750')",
"('1000','1000')");
//"('Other')");

var geyserArray = new Array("('2000','2000','true','true')",
"('3000','3000')",
"('6000','6000')");
//"('Other')");

var sheaterArray = new Array("('1000','1000','true','true')",
"('1200','1200')",
"('1500','1500')");
//"('Other')");

var mixerArray = new Array("('50','50','true','true')",
"('200','200')");
//"('Other')");

var washingArray = new Array("('200','200','true','true')",
"('Other')");

var acArray = new Array("('1Ton','1400','true','true')",
"('1.5Ton','1800')");
//"('Other')");

var rfArray = new Array("('165 lts','150','true','true')",
"('260 lts','200')");
//"('Other')");
var computerArray = new Array("('200','200','true','true')")
//"('Other')");

var tvArray = new Array("('150','150','true','true')");
//"('Other')");

var radioArray = new Array("('50','50','true','true')");
//"('Other')");

var pumpArray = new Array("('550','550','true','true')",
"('750','750')",
"('1000','1000')",
"('2000','2000')",
"('3000','3000')",
"('6000','6000')");
//"('Other')");

//var OtherArray = new Array("('Select','','true','true')",
//"('Other')");

<!-- Populate Combo value -->
function populateWatt(inForm,selected) {
	getWatt(document.form1.app,document.form1.app.options[document.form1.app.selectedIndex].text);
	var selectedArray = eval(selected + "Array");
	
	while (selectedArray.length < inForm.watt.options.length) {
		
		inForm.watt.options[(inForm.watt.options.length - 1)] = null;
	}
	for (var i=0; i < selectedArray.length; i++) {
		eval("inForm.watt.options[i]=" + "new Option" + selectedArray[i]);
		//alert(inForm.country.options[i].value);
	}
	if (inForm.app.options[0].value == '') {
		inForm.app.options[0]= null;
		if ( navigator.appName == 'Netscape') {
			if (parseInt(navigator.appVersion) < 4) {
				window.history.go(0);
			}
			else {   	
				if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
					window.history.go(0);
        		}
        	}
    	}
    	//else {alert(document.form1.watt.options[2].value);}
	}
}

<!-- Prompt for Watt -->
/*
function getWatt(inForm,selected) {
	//if (selected == 'Other') {		
	//	newValue = "";
		if (inForm==document.form1.watt) {
			while (newValue == "" || !checkInt(newValue)){
			
			newValue=prompt ("Please enter a value.", "");
			}
		}
		else {
			while (newValue == ""){
			//if(!checkInt(newValue)) alert("Integer Please");
			newValue=prompt ("Please enter a value.", "");
			}
		}
		if (newValue != null) {
			inForm.options[(inForm.options.length-1)]=new Option(newValue,newValue,true,true);
			inForm.options[inForm.options.length]=new Option('Other','Other');
		}
	}

}
*/

function getWatt(inForm,selected) {
	if (selected == 'Other') {		
		newValue = "";
		if (inForm==document.form1.watt) {
			while (newValue == "" || !checkInt(newValue)){
			
			newValue=prompt ("Please enter a value.", "");
			}
		}
		else {
			while (newValue == ""){
			if(!checkInt(newValue)) alert("Integer Please");
			newValue=prompt ("Please enter a value.", "");
			}
		}
		
		if (newValue != null) {
			inForm.options[(inForm.options.length-1)]=new Option(newValue,newValue,true,true);
			inForm.options[inForm.options.length]=new Option('Other','Other');
		}
	}

}
function isInteger(x) {
var bol;
	for(i=0;i<x.length;i++) {
		if(i>=0 & i<=9) bol=true;
		else bol=false;
	}
	return bol;
}

<!-- Calculate Units -->
var app = "Select";
var hrs;
var watt;
var unit;
var tot=0;


function calculate() {
	app = document.form1.app.options[document.form1.app.selectedIndex].text;
	thrs = document.form1.hrs.options[document.form1.hrs.selectedIndex].value;
	watt = document.form1.watt.options[document.form1.watt.selectedIndex].value;
	no=document.form1.no.options[document.form1.no.selectedIndex].value;
	unit = ((watt/1000)*thrs*30*no);
	if (document.form1.app.value=="rf") {
		
		unit *= 0.51;
	}
	
	if(document.form1.app.value=="ac"){
		
		unit *= 0.625;
	}
	
	//unit=Math.round(unit);
	unit=Math.round(unit*100)/100;
	document.form1.units.value=unit;
}


var rowcount=1;
function chkResult() {
	if(rowcount>25) {alert("25 rows allowed \n Please Refresh and start again"); return;}
	cel0=app+" @ "+no;
	if(cel0 == "Select") { alert("Select an Appliance"); return;}
	cel1=watt;
	cel2=thrs;
	cel3=unit;

	tot += unit;
	tot = Math.round(tot * 100)/100;
	document.form1.total.value=tot;
	document.form1.bitotal.value=tot*2;
	
	for(i=0;i<4;i++){
		eval("document.all.cell" + rowcount + i +".innerText=" + "cel" + i);
	}
	rowcount++;
	
	
}

