function validate(chk,lnk,message){
	if (chk.checked == 1)
	{
		javascript:window.location=lnk;
	}
	else
	{
		alert(message);
	}
}

// cycle through the elements of a page and ensure that at least one checkbox is checked
function EnsureOneCheckboxSelected()
{
	var result = false;

	for (i=0; i<document.forms[0].elements.length; i++)
	{
		if (document.forms[0].elements[i].type == "checkbox" && document.forms[0].elements[i].checked == true)
		{
			result = true;
			break;
		}
	}						

	if (result == false)
	{
		alert("You have not selected any checkboxes, please select at least one option and fill in the required information before submitting this form.");
	    return false;
	}
	else
	{
    	return EkControlFmValidate(this);	
	}
}

function HKEnsureOneCheckboxSelected()
{
	var result = false;

	for (i=0; i<document.forms[0].elements.length; i++)
	{
		if (document.forms[0].elements[i].type == "checkbox" && document.forms[0].elements[i].checked == true)
		{
			result = true;
			break;
		}
	}						

	if (result == false)
	{
	    // for the Chinese website, we have to use this workaround (HACK!), to get it to display the Chinese
	    // correctly, creating the text in a DIV in memory and then read it out. Normal procedure does not
	    // work
	    var tempDiv = document.createElement('div');
        tempDiv.innerHTML = "&#24517;&#38656;&#22635;&#23531;&#25152;&#38656;&#36039;&#26009;&#21450;&#36984;&#25799;&#20854;&#20013;&#19968;&#38917;";

        alert(tempDiv.innerHTML);
	
	    return false;
	}
	else
	{
    	return EkControlFmValidate(this);	
	}
}