
function listCC()
{
	for (var code in countryCodes)
	{
		if (code == "0") continue;
		document.write("<option value=\"" + code + "\">" + code +  "</option>");
	}		
}

function selectCC(divid, id, value)
{
	var selectlist = document.getElementById(id);
	for (i = 0; i < selectlist.options.length; i++)
		if (selectlist.options[i].value == value) {selectlist.selectedIndex = i; break;}

	buildSampleMtgNotice();
	document.getElementById(divid).style.visibility="hidden";	
}


function showCCtable(divid, id)
{
	var phoneSpecs = new Array();
	var sharedCountries = new Array();
	var sortedCC = new Array();
	
	for (var code in countryCodes)
	{
		if (code == "0") continue;
		if (sharedCountryCodes[code]) {
			sharedCountries = sharedCountryCodes[code].split(";");
			for (var c = 0; c < sharedCountries.length; c++) {
				sortedCC.push(sharedCountries[c] + ";" + code);
			}
		} else {
			phoneSpecs = countryCodes[code].split(";");
			sortedCC.push(phoneSpecs[0] + ";" + code);
		}
	}
	sortedCC.sort();
	
	for (var x = 0; x < sortedCC.length; x++)
	{
		var entry = sortedCC[x];
		phoneSpecs = entry.split(";");
		
		var line = '<tr><td>' +
		           '<a class=\"PageLink\" href=\"javascript:selectCC(\'' + divid + '\'' +
				   ', \'' + id + '\'' +
		           ', \'' + phoneSpecs[1] + '\')\">'+ 
		           phoneSpecs[0] + '</a>' +
				   '</td>' +
				   '<td align="right">' +
				   '<a class=\"PageLink\" href=\"javascript:selectCC(\'' + divid + '\'' +
				   ', \'' + id + '\'' +
				   ', \'' + phoneSpecs[1] + '\')\">'+ 
				   phoneSpecs[1] + '</a>' +
				   '</td>\n</tr>';
		document.write(line);
	}
}
