var choices = null;

var cChoices = 38;

function initChoices()
{
choices = new Array(38);

choices[ 0]='X_X_XXX____X__X__XXXX_ onyx244';
choices[ 1]='X_X_XXXX___X__X__XXXX_ onyx324';
choices[ 2]='X_X_XXXX___X__X__XXXXX onyx2480';
choices[ 3]='X_X_XXXXX__X__X__XXXXX onyx3280';
choices[ 4]='X_X_XXXXX__X__X__XXXXX onyx4080';
choices[ 5]='X_X_XXXXX__X__X__XXXXX onyx4880';
choices[ 6]='XXX_X_____X____X_X____ 402vlz3';
choices[ 7]='XXX_X_____X____X_X____ 802vlz3';
choices[ 8]='XXX_X_____X____X_XX___ 1202vlz3';
choices[ 9]='XXX_X_____X____X_XX___ 1402vlz3';
choices[10]='XXX_XX____X___X__XXX__ 1642vlz3';
choices[11]='XXX_XXX___X___X__XXXX_ 1604vlz3';
choices[12]='X_X_XX___X_____XX_XX__ cfx12mkii';
choices[13]='X_X_XX___X_____XX_XX__ cfx16mkii';
choices[14]='X_X_XXX__X_____XX_XX__ cfx20mkii';
choices[15]='X__X_X___X______X_X___ ppm608';
choices[16]='X__X_X___X______X_X___ ppm1008';
choices[17]='X__X_X___X______X__XX_ ppm1012';
choices[18]='XXX_X____X_____XX_X___ profx8';
choices[19]='XXX_X____X_____XX_X___ profx12';
choices[20]='XXX_X______XX____XX___ onyxi820';
choices[21]='XXX_X______XX____XX___ onyxi1220';
choices[22]='XXX_XX_____XX____XXX__ onyxi1620';
choices[23]='XXX_XXX____XX_X__XXXX_ onyxi1640';
choices[24]='X_X_XXXX_X___X__X_XXXX tt24';
choices[25]='XX__XXXXXX__XXX_X_XXXX dxb';

}

function DOM(n)
{
	return document.getElementById(n);
}

function showMatches()
{
	if ( choices == null )
	{
		initChoices();
	}

	for ( var i = 0 ; i < cChoices ; i++ )
	{
		var nm = "ch_" + choices[i].substring( 23, 255 );
		var o = DOM(nm);
		if ( o == null )
		{
			//alert(nm);
			continue;
		}

		var c = "";
		for ( var n = 1 ; n <= 6 ; n++ )
			c += choices[i].substr( DOM("opt"+n).value, 1 );
		//alert(c);
		o.className = (c == 'XXXXXX') ? "rotate_prod" : "rotate_off";
		
	}
}

// JavaScript Document

//<![CDATA[

function DOM(n) 
{
	if (document.all) return(document.all[n]);
	if (document.getElementById) return(document.getElementById(n));
	return(null);
}


function toggleDisplay( n ) 
{
	var o = DOM(n);

	if ( o == null )
		return;

	o.style.display = (o.style.display == '') ? "none" :  "";
}

function hide( n ) {
	var o = DOM(n);

	if ( o == null )
	{
		alert(n);
		return;
	}

	if ( o.style.display == "" )
		o.style.display = "none";
}

function show( n ) {
	var o = DOM(n);

	if ( o == null )
	{
		alert(n);
		return;
	}

	if ( o.style.display == "none" )
		o.style.display = "";
}

function showpanel( n ) {

	hide("panel_default");

	hide('panel_onyxi820');
	hide('panel_onyxi1220');
	hide('panel_onyxi1620');
	hide('panel_onyxi1640');
	hide('panel_onyx244');
	hide('panel_onyx324');
	hide('panel_onyx2480');
	hide('panel_onyx3280');
	hide('panel_onyx4080');
	hide('panel_onyx4880');
	hide('panel_402vlz3');
	hide('panel_802vlz3');
	hide('panel_1202vlz3');
	hide('panel_1402vlz3');
	hide('panel_1642vlz3');
	hide('panel_1604vlz3');
	hide('panel_cfx12mkii');
	hide('panel_cfx16mkii');
	hide('panel_cfx20mkii');
	hide('panel_ppm608');
	hide('panel_ppm1008');
	hide('panel_ppm1012');
	hide('panel_profx8');
	hide('panel_profx12');
	hide('panel_tt24');
	hide('panel_x200');

	show( n );
}

function output_diag_table() {
	
	if ( choices == null )
	{
		initChoices();
	}
	
	
desc = new Array(27);


desc[1] = "Type Recording";
desc[2] = "Type Live - unpowered";
desc[3] = "Type Live - powered";
desc[4] = "Mic In 1+";
desc[5] = "Mic In 7+";
desc[6] = "Mic In 13+";
desc[7] = "Mic In 21+";
desc[8] = "Mic In 31+";
desc[9] = "Preamp Type: Mackie";
desc[10] = "Preamp Type: XDR";
desc[11] = "Preamp Type: Premium Onyx";
desc[12] = "Direct Outs: Yes, FireWire";
desc[13] = "Direct Outs: Yes, Digital";
desc[14] = "Direct Outs: Yes, Analog";
desc[15] = "Direct Outs: No Direct Outs";
desc[16] = "FX: Yes";
desc[17] = "FX: No";
desc[18] = "Aux Sends: 2+";
desc[19] = "Aux Sends: 4+";
desc[20] = "Aux Sends: 6+";
desc[21] = "Aux Sends: 8+";

	var i, d;
	
	document.write( '<table border=1><tr><td>&nbsp;</td>' );
	for ( i = 1 ; i <= 21 ; i++ )
	{
		document.write( '<td>' + i + ': ' + desc[i] + '</td>' );
	}
	document.write( '</tr><tr>\r\n' );

	
	for ( var i = 0 ; i < cChoices ; i++ )
	{
		var nm = choices[i].substring( 22, 255 );
		
		document.write ( '<tr><td>' + i + ': ' + nm + '</td>' );
		
		for ( d = 1 ; d <= 21 ; d++ )
		{
			document.write( '<td>' + choices[i].substr( d, 1 ) + '</td>\r\n' );
		}
		document.write( '</tr>\r\n' );		
	}
	document.write( '</table>\r\n' );
}

//]]>
