function showTable()
{
		// Variable
		var v = 0; var r_vrb = document.getElementsByName("r_vrb"); for (var i=0; i<r_vrb.length;i++) { if (r_vrb[i].checked) { v = i; break; } }
		var p_vrb = "";
		switch (v)
		{
				case 0: p_vrb = document.dom.l_vrb_pop.options[document.dom.l_vrb_pop.selectedIndex].value; break; // demographics
				case 1: p_vrb = document.dom.l_vrb_spam.options[document.dom.l_vrb_spam.selectedIndex].value; break; // ag statistics
		}

		// Display
		var d = 0; var r_dsp = document.getElementsByName("r_dsp"); for (var i=0; i<r_dsp.length;i++) { if (r_dsp[i].checked) { d = i; break; } }
		var p_dsp = 0; switch (d) { case 0: p_dsp = "nme"; break; case 1: p_dsp = "cde"; break; case 2: p_dsp = "bth"; break; }

		// Where
		var w = 0; var r_whr = document.getElementsByName("r_whr"); for (var i=0; i<r_whr.length;i++) { if (r_whr[i].checked) { w = i; break; } }
		var p_cnt = "0", p_cir = "0", p_rgn = "0", p_aez = "0"; p_mkt = "0"; 
		switch (w)
		{
				case 0:
						p_cnt = document.dom.l_cnt.options[document.dom.l_cnt.selectedIndex].value;
						break;
				case 1:
						p_cir = document.dom.l_cir.options[document.dom.l_cir.selectedIndex].value;
						break;
				case 2:
						p_rgn = 1;
						break;
				/*
				case 3:
						p_aez = document.dom.l_aez.options[document.dom.l_aez.selectedIndex].value;
						break;
				case 4:
						p_mkt = document.dom.l_mkt.options[document.dom.l_mkt.selectedIndex].value;
						break;
				*/
		}
		
		// AEZ
		p_aez = document.dom.l_aez.options[document.dom.l_aez.selectedIndex].value;
		
		// MKT
		p_mkt = document.dom.l_mkt.options[document.dom.l_mkt.selectedIndex].value;

		// URL
		var responseUrl = "http://"+document.URL.split('/')[2]+"/lab/index.php/hcdomain/table/"+p_vrb+"/"+p_dsp+"/"+p_cnt+"/"+p_cir+"/"+p_rgn+"/"+p_aez+"/"+p_mkt;
		$("#info").load(responseUrl);
}
function openTable(tableUrl)
{
		window.location = tableUrl;
}
function getAllocID(doubleX, doubleY)
{
		var col = Math.round( ( ( 180.00 + parseFloat(doubleX) ) / 0.0833334 ) + 1.00 );
		var row = Math.round( ( ( 90.00 - parseFloat(doubleY) ) / 0.0833334 ) + 1.00 );
		if (col<10) col = "000" + col.toString();
			else if (col<100) col = "00" + col.toString();
			else if (col<1000) col = "0" + col.toString();
		if (row<10) row = "000" + row.toString();
			else if (row<100) row = "00" + row.toString();
			else if (row<1000) row = "0" + row.toString();
		return allocID = row.toString() + col.toString();
}
function showDomainTable(allocID)
{
		var responseUrl = "http://"+document.URL.split('/')[2]+"/lab/index.php/hcdomain/domain/"+allocID;
    $("#info").load(responseUrl);
}
function checkWhereVrb(s)
{
		switch(s)
		{
			case 1:
				document.dom.l_vrb_pop.disabled = false;
				document.dom.l_vrb_spam.disabled = true;
				break;
			case 2:
				document.dom.l_vrb_pop.disabled = true;
				document.dom.l_vrb_spam.disabled = false;
				break;
		}
}
function checkWhereWhr(s)
{
		switch(s)
		{
			case 1:
				document.dom.l_cnt.disabled = false;
				document.dom.l_cir.disabled = true;
				//document.dom.l_aez.disabled = true;
				//document.dom.l_mkt.disabled = true;
				break;
			case 2:
				document.dom.l_cnt.disabled = true;
				document.dom.l_cir.disabled = false;
				//document.dom.l_aez.disabled = true;
				//document.dom.l_mkt.disabled = true;
				break;
			case 3:
				document.dom.l_cnt.disabled = true;
				document.dom.l_cir.disabled = true;
				//document.dom.l_aez.disabled = true;
				//document.dom.l_mkt.disabled = true;
				break;
			case 4:
				document.dom.l_cnt.disabled = true;
				document.dom.l_cir.disabled = true;
				//document.dom.l_aez.disabled = false;
				//document.dom.l_mkt.disabled = true;
				break;
			case 5:
				document.dom.l_cnt.disabled = true;
				document.dom.l_cir.disabled = true;
				//document.dom.l_aez.disabled = true;
				//document.dom.l_mkt.disabled = false;
				break;
		}
}