function compareProducts() {
 	var df = document.ProductCompareForm;
 	var str = df.ProdCompareList.value;
 	if(str!='') {
		document.location.href='Products-Compare.cfm?reports='+str;
	} else {
		alert('You first need to select some reports to compare!\n\n To do this, select the checkbox next to the reports you wish to compare and press this button again.');
	}
}

function createProdList(fld) {
	var df = document.ProductCompareForm;
	var str = df.ProdCompareList.value;
	
	if(str!='') {
		if(str.indexOf(',')>0) {
			var myArray = str.split(',');
		} else {
			var myArray = new Array;
			myArray[0] = str;
		}
	} else {
		var myArray = new Array;
	}
	
	if(fld.checked) {
		// add value to the list
		if(myArray.indexOf(fld.value)<0) {
			myArray.append(fld.value);
		}
	} else {
		// remove the value from the list
		if(myArray.indexOf(fld.value)>0) {
			myArray.splice(myArray.indexOf(fld.value),1);
		}
	}
	
	myArray.sort();
	df.ProdCompareList.value='';
	for(i=0;i<myArray.length;i++) {
		df.ProdCompareList.value+=myArray[i];
		if(i<(myArray.length)-1) {
			df.ProdCompareList.value+=',';
		}
	}
}