//script for compare functionality
// - 4/16/05 - Cy Huckaba - Springbox
			
function doCount(el){
	var count = 0;
	var cBoxes = document.aspnetForm.elements['chkOpn'];
	for (var i=0;i < cBoxes.length;i++){
		if (cBoxes[i].checked) {
			count++;
		}
	}
	if (count > 5) {
		alert('You may compare up to five items at a time.\n\nThe last selection will be ignored.');
		el.checked = false;
	}
}

function doMotherboardCompare(){
	var count = 0;
	var url = "MotherboardSideBySide.aspx?";
	var strVars = "";
	var cBoxes = document.aspnetForm.elements['chkOpn'];
	for (var i=0;i < cBoxes.length;i++){
		if (cBoxes[i].checked) {
			count++;
			if (strVars != "") {
				strVars = strVars + "&";	
			}
			
			strVars = strVars + "id=" + cBoxes[i].value;
		}
	}
	
	if (count > 1) {
		//alert(url + strVars);
		window.location = url + strVars;
	} else {
		alert('You have not selected more than one motherboard to compare.\n\nPlease select up to five motherboards to use this feature.');
	}
	
	//return false;
}

function doVideoCardCompare(){
	var count = 0;
	var url = "VideoCardSideBySide.aspx?";
	var strVars = "";
	var cBoxes = document.aspnetForm.elements['chkOpn'];
	for (var i=0;i < cBoxes.length;i++){
		if (cBoxes[i].checked) {
			count++;
			if (strVars != "") {
				strVars = strVars + "&";	
			}
			
			strVars = strVars + "id=" + cBoxes[i].value;
		}
	}
	
	if (count > 1) {
		//alert(url + strVars);
		window.location = url + strVars;
	} else {
		alert('You have not selected more than one video card to compare.\n\nPlease select up to five video cards to use this feature.');
	}
	
	//return false;
}