
function loadProductList()
{
	// temp vars
	var tmpSel, tmpRA, field, modelnum, model, i;
	// search parameters
	var	capacity,
		accuracy,
		direction,
		bodystyle,
		construction,
		sealing,
		temperature,
		fatigue,
		amplified,
		sideload;
	// get requirements
	tmpSel = document.getElementById('capacity');
	tmpRA = tmpSel.options[tmpSel.selectedIndex].value.toString().split(',');
	capacity = {'UpperLimit':Number(tmpRA[0]),'Units':tmpRA[1]};
	tmpSel = document.getElementById('accuracy');
	if (tmpSel.options[tmpSel.selectedIndex].value.toString() != '') {
		accuracy = tmpSel.options[tmpSel.selectedIndex].value;
	}
	tmpSel = document.getElementById('direction');
	direction = tmpSel.options[tmpSel.selectedIndex].value;
	tmpSel = document.getElementById('bodystyle');
	if (tmpSel.options[tmpSel.selectedIndex].value.toString() != '') {
		bodystyle = tmpSel.options[tmpSel.selectedIndex].value;
	}
	tmpSel = document.getElementById('construction');
	if (tmpSel.options[tmpSel.selectedIndex].value.toString() != '') {
		construction = tmpSel.options[tmpSel.selectedIndex].value;
	}
	tmpSel = document.getElementById('sealing');
	if (tmpSel.options[tmpSel.selectedIndex].value.toString() != '') {
		tmpRA = tmpSel.options[tmpSel.selectedIndex].value.toString().split(',');
		sealing = {'Standard':tmpRA[0],'Spec':tmpRA[1]};
	}
	tmpSel = document.getElementById('temperature');
	if (tmpSel.options[tmpSel.selectedIndex].value.toString() != '') {
		temperature = tmpSel.options[tmpSel.selectedIndex].value;
	}
	fatigue = document.getElementById('fatigue').checked;
	amplified = document.getElementById('amplified').checked;
	sideload = document.getElementById('sideload').checked;
	// get results
	results = new Array();
	for (i=0; i<products.length; i++) {
		model = new Object();
		for (field in products[i]) { model[field] = products[i][field]; }
		if (model.CapacityUnits == 'g' && capacity.Units == 'lb') { continue; }
		if (model.CapacityUnits == capacity.Units &&
			Number(model.UpperCapacity) < capacity.UpperLimit) { continue; }
		if (Boolean(accuracy) && Number(model.Accuracy) > Number(accuracy)) { continue; }
		switch (model.LoadDirection) {
			case 'TC' :
				model.LoadDirection = 'Tension & Compression';
				break;
			case 'TO' :
				if (direction != 'TO') { continue; }
				model.LoadDirection = 'Tension Only';
				break;
			case 'CO' :
				if (direction != 'CO') { continue; }
				model.LoadDirection = 'Compression Only';
				break;
			default :
				continue;
		}
		if (Boolean(bodystyle) && model.Style != bodystyle) { continue; }
		if (Boolean(construction) && model.Construction != construction) { continue; }
		if (Boolean(sealing)) {
			tmpRA = model['EnvironmentalSealing'].split(' ');
			if (Number(tmpRA[1]) > Number(sealing['Spec'])) { continue; }
		}
		if (Boolean(temperature)) {
			tmpRA = temperature.split(',');
			if (model.OpTempUnits != tmpRA[0]) {
				if (tmpRA[0] == 'F') {
					tmpRA[1] = (tmpRA[1] - 32) * 5 / 9;
					tmpRA[2] = (tmpRA[2] - 32) * 5 / 9;
				} else {
					tmpRA[1] = tmpRA[1] * 1.8 + 32;
					tmpRA[2] = tmpRA[2] * 1.8 + 32;
				}
			}
			if (model.LowerOpTemp > tmpRA[1] || model.UpperOpTemp < tmpRA[2]) { continue; }
		}
		if (fatigue && model.FatigueRated == 'false') { continue; }
		if (amplified && model.Amplification == 'false') { continue; }
		if (sideload && model.SideLoadImmunity == 'false') { continue; }
		// Additional properties needed for compare chart
		model.Accuracy = model.Accuracy + '%';
		model.LoadRange = 'Up to ' + model.UpperCapacity + ' ' + model.CapacityUnits;
		model.Amplification = (model.Amplification == 'true' ? 'Amplified' : 'Unamplified');
		model.ElectricalTermination = (model.Style == 'Miniature' ? 'Cable' : 'Connector');
		model.OperatingTemperature = model.LowerOpTemp + '\u00B0 ' + model.OpTempUnits + ' to ' + model.UpperOpTemp + '\u00B0 ' + model.OpTempUnits;
		results[model.ModelNumber] = model;
	}
	displayProductList();
}

// Define overlib help texts
/*
var help_texts = {
		'capacity':{
			'text':'Select the maximum expected force that the load cell will be subjected to, including all vibration induced "spikes".',
			'caption':'Capacity',
			'hpos':LEFT
		},
		'accuracy':{
			'text':'',
			'caption':'Accuracy',
			'hpos':LEFT
		},
		'direction':{
			'text':'',
			'caption':'Load Direction',
			'hpos':LEFT
		},
		'construction':{
			'text':'',
			'caption':'Construction',
			'hpos':LEFT
		},
		'body':{
			'text':'',
			'caption':'Body Type',
			'hpos':LEFT
		},
		'sealing':{
			'text':'',
			'caption':'Environmental Sealing',
			'hpos':LEFT
		},
		'temperature':{
			'text':'',
			'caption':'Operating Temperature',
			'hpos':LEFT
		},
		'addReq':{
			'text':'Click on the option text for an explanation.',
			'caption':'Additional Requirements',
			'hpos':LEFT
		},
		'fatigue':{
			'text':'A fatigue rated load cell is specially designed to withstand millions of cycles while maintaining its integrity and accuracy.',
			'caption':'Fatigue Rating',
			'hpos':RIGHT
		},
		'amplified':{
			'text':'',
			'caption':'Amplification',
			'hpos':RIGHT
		},
		'sideload':{
			'text':'Side load resistant load cells ensure the integrity of the measurement.',
			'caption':'Side Loading',
			'hpos':RIGHT
		}
};
*/
var compareHeaders = {'ModelNumber':'Model','ApplicationNotes':'Typical Applications','Accuracy':'Accuracy','LoadRange':'Load Range','Amplification':'Amplification','Style':'Physical Configuration','ElectricalTermination':'Electrical Termination','OperatingTemperature':'Operating Temperature','Construction':'Construction','LoadDirection':'Load Direction'};