﻿<!--

//max select
var maxSel=3;
//selected
var num=0;

window.onload=function()
    {
        num=document.getElementById( 'check_select' ).value;
    }
	
function doCheck(node){
	if(node.checked){
		//if not check the one, so select it.
		if(num>=maxSel){
			//if up to maxSel, then cancel what you select.
			node.checked=false;
			alert("Can select up to "+maxSel+" checkbox.");
		}else{
			//if not up to maxSel;
			num++;
		}
	}else{
		//if somebody have checked it, cancel it.
		if(num>=1) num--;
	}
}

// try catch；
function killErrors() {
return true;
}

window.onerror = killErrors;

//-->