function calchex()
	{
	hex=new Array();
	hex1=new Array();
	hex2=new Array();
	hex3=new Array();
	
	features = "directories=no,location=no,menubar=no,status=no, resizable=yes";
	morefets = ",titlebar=yes,toolbar=yes,scrollbars=no";
	fetlist = features+morefets;
	links=window.open('','results',fetlist);
    offset="../myweb/lofting/x";
	hex=""; //
	hex1=""; // what will be
	hex2=""; // context hex
	hex3=""; // what is
	list="<x";
	
// process TEXT first = radio groups F, D, B (reverse order so filename is top to bottom ordered)

// -------------------------- RADIO F ------------------------

for(i=0;i<4;i++)
{
if (document.inside.RadioF[i].checked == true)
	{
	switch (document.inside.RadioF[i].value)
		{
			case "1" : {hex1 =offset+"1";  hex3 =offset+"1"; break;} // proactive
			case "3" : {hex1 =offset+"0";  hex3 =offset+"1"; break;} // pro to re
			case "2" : {hex1 =offset+"0";  hex3 =offset+"0"; break;} // reactive
			case "4" : {hex1 =offset+"1";  hex3 =offset+"0"; break;} // re to pro
		}
	list += document.inside.RadioF[i].value;
	break; // dont need to continue
	}
}

// ------------------------- RADIO D ---------------------------

for(i=0;i<4;i++)
{
if (document.inside.RadioD[i].checked == true)
	{
	switch (document.inside.RadioD[i].value)
		{
			case "1" : {hex1 += "1";  hex3 +="1"; break;} // is
			case "3" : {hex1 += "0";  hex3 +="1"; break;} // is to could
			case "2" : {hex1 += "0";  hex3 +="0"; break;} // could
			case "4" : {hex1 += "1";  hex3 +="0"; break;} // could to is
		}
	list += document.inside.RadioD[i].value;
	break; // dont need to continue
	}
}

// -------------------------- RADIO B --------------------------

for(i=0;i<4;i++)
{
if (document.inside.RadioB[i].checked == true)
	{
	switch (document.inside.RadioB[i].value)
		{
			case "1" : {hex1 += "1";  hex3 +="1"; break;} // facts
			case "3" : {hex1 += "0";  hex3 +="1"; break;} // facts to values
			case "2" : {hex1 += "0";  hex3 +="0"; break;} // values
			case "4" : {hex1 += "1";  hex3 +="0"; break;} // values to facts
		}
	list += document.inside.RadioB[i].value ;
	break; // dont need to continue
	}
}


hex = hex1; // save top trigram

// now process context lines 3, 2, 1 ( E, C, A)

// -------------------------RADIO E ---------------------
for(i=0;i<4;i++)
{
if (document.inside.RadioE[i].checked == true)
	{
	switch (document.inside.RadioE[i].value)
		{
			case "1" : {hex1 += "1"; hex2 = "1"; hex3 +="1";break;} // proactive
			case "3" : {hex1 += "0"; hex2 = "0"; hex3 +="1";break;} // pro to re
			case "2" : {hex1 += "0"; hex2 = "0"; hex3 +="0";break;} // reactive
			case "4" : {hex1 += "1"; hex2 = "1"; hex3 +="0";break;} // re to pro
		}
	list += document.inside.RadioE[i].value;
	break; // dont need to continue
	}
}

// ------------------------- RADIO C -------------------
for(i=0;i<4;i++)
{
if (document.inside.RadioC[i].checked == true)
	{
	switch (document.inside.RadioC[i].value)
		{
			case "1" : {hex1 += "1"; hex2 += "1"; hex3 +="1"; break;} // is
			case "3" : {hex1 += "0"; hex2 += "0"; hex3 +="1"; break;} // is to could
			case "2" : {hex1 += "0"; hex2 += "0"; hex3 +="0"; break;} // could
			case "4" : {hex1 += "1"; hex2 += "1"; hex3 +="0"; break;} // could to is
		}
	list += document.inside.RadioC[i].value;
	break; // dont need to continue
	}
}

// ------------------------ RADIO A -----------------------
for(i=0;i<4;i++)
{
if (document.inside.RadioA[i].checked == true)
	{
	switch (document.inside.RadioA[i].value)
		{
			case "1" : {hex1 += "1"; hex2 += "1"; hex3 +="1"; break;} // facts
			case "3" : {hex1 += "0"; hex2 += "0"; hex3 +="1"; break;} // facts to values
			case "2" : {hex1 += "0"; hex2 += "0"; hex3 +="0"; break;} // values
			case "4" : {hex1 += "1"; hex2 += "1"; hex3 +="0"; break;} // values to facts
		}
	list += document.inside.RadioA[i].value + ">" ;
	break; // dont need to continue
	}
}



// -------------------------- 
// now format and output

hex2+=hex; // swap tris

hex3 += ".html";
hex2 = hex3;
hex1 += ".html";
if (hex3 == hex1) 
	{
	hex1 = "../myweb/lofting/frameEdead.html"; 
	hex2 = hex1;
	}

links.document.write('<html><head><title>The Results Page - '+list+'</title></head>');
links.document.write('<frameset rows="170,*" cols="*" BORDERCOLOR="#ff0000">');
links.document.write('<frame src="../myweb/lofting/frameEhead.html">');
links.document.write('<frameset cols="*,50%" BORDERCOLOR="#ff0000">');
links.document.write('<frame src='+hex3+'>'); /* what is */
links.document.write('<frame src='+hex1+'>'); /* changing into if changing */
links.document.write('</frameset>');
links.document.writeln('</frameset></html> ');
return false;
}