<script language="Javascript">
function pop(url, width, height)
{
    var left = (screen.width - width) / 2;
    var top = 20;
    window.open(url, '_blank', 'width='+width+',height='+height+',top='+top+',left='+left+',toolbar=0,menubar=0,location=0,status=0,scrollbars=yes,resizable=1');
}

function termsAlert(choice, url) {
	if (choice=="practitioners") {
		if (document.getElementById('pract_disclaimer').checked==true) {
			location.href=url+'?r=true';
		}
		else {
			alert('You must agree to the terms & conditions');
		}
	}
	else if (choice=='presenters') {
		if (document.getElementById('pres_disclaimer').checked==true) {
			location.href=url+'?r=true';
		}
		else {
			alert('You must agree to the terms & conditions');
		}
	}
}

function selectArea(prov_id) {
	if (document.getElementById('area['+prov_id+']').checked) { 
		var check_the_box = false;
	} 
	else { 
		var check_the_box = true;
	}
	document.getElementById('area['+prov_id+']').checked=check_the_box; 
}

function selectAll(country) {
	if (document.getElementById('select_all_'+country).innerHTML=='Select all') {
		check_the_box = true;
		document.getElementById('select_all_'+country).innerHTML='Deselect all'
	}
	else{
		check_the_box = false;
		document.getElementById('select_all_'+country).innerHTML='Select all'
	}
	if (country=="CAN") {
		<?
		$query = mysql_query("SELECT prov_id FROM ProvList WHERE country='CAN'");
		while($row = mysql_fetch_row($query))
    	{
    	    $prov_id = $row[0];
    	    echo 'document.getElementById(\'area['.$prov_id.']\').checked=check_the_box;';
    	}
		?>
	}
	else {
		<?
		$query = mysql_query("SELECT prov_id FROM ProvList WHERE country='USA'");
		while($row = mysql_fetch_row($query))
    	{
    	    $prov_id = $row[0];
    	    echo 'document.getElementById(\'area['.$prov_id.']\').checked=check_the_box;';
    	}
		?>
	}
}
</script>