
//	anlysHtmlTableCells.js		2006
//
//	2009-01-15	- replaced the double-quote problem with the html equiv &quot;	
//

var globalPrefixSuffixSeparatorCharacter	=	'';
var globalErrorSoundHandle			=	'';
var globalErrorPhonemeTagArray			=	new Array();
var globalSpeakingCountTag			=	'';
var globalFreqTag				=	'';
var globalNotesTag				=	'';

function createGlobalVariables
		(	paramErrorSoundHandle			// 01
		,	paramPreSufSepChar			// 02
		,	paramErrorPhoneme_1_tag			// 03
		,	paramErrorPhoneme_2_tag			// 04
		,	paramErrorPhoneme_3_tag			// 05
		,	paramErrorPhoneme_4_tag			// 06
		,	paramSpeakingCountTag			// 07
		,	paramFreqTag				// 08
		,	paramNotesTag				// 09
		)
{
	globalErrorSoundHandle			=	paramErrorSoundHandle	;
	globalPrefixSuffixSeparatorCharacter	=	paramPreSufSepChar	;
	globalErrorPhonemeTagArray[0]		=	paramErrorPhoneme_1_tag	;
	globalErrorPhonemeTagArray[1]		=	paramErrorPhoneme_2_tag	;
	globalErrorPhonemeTagArray[2]		=	paramErrorPhoneme_3_tag	;
	globalErrorPhonemeTagArray[3]		=	paramErrorPhoneme_4_tag	;
	globalSpeakingCountTag			=	paramSpeakingCountTag	;
	globalFreqTag				=	paramFreqTag	;
	globalNotesTag				=	paramNotesTag	;
};

function htmlLabelAndRowNbr(paramColor, paramRowNumber)
{

    var deBug	= 0;

    var outPut	= '';	// variable to store all the output

    outPut	+=	'<td class="classRowNbr" bgcolor='
		+	'"'						// double quote
		+	paramColor
		+	'"'						// double quote
		+	'>'
		+	paramRowNumber
		+	'</td>'						// end of table cell
		;

    if  ( deBug == 0 )	{
	    document.write (outPut);
	    // return (outPut);
    } else {

	    while (outPut.indexOf("<") > -1 )
		outPut = outPut.replace("<", "&lt;");
	    while (outPut.indexOf(">") > -1 )
		outPut = outPut.replace(">", "&gt;");
	    document.write ('<pre>' + outPut + '</pre>' );
    };

};

function htmlErrorSounds
	//		(	paramTagPrefix		2007-06-07
	(	paramFormName			//	01	2007-06-07
	,	paramAnlysDetailAutoIncrement	//	02	2007-06-07
	,	paramRowNbr			//	param 03
	,	paramErrorSound1		//	param 04
	,	paramErrorSound2		//	param 05
	,	paramErrorSound3		//	param 06
	,	paramErrorSound4		//	param 07
	)
{
    var deBug	= 0;
    var errorSoundArray		=new Array(paramErrorSound1, paramErrorSound2, paramErrorSound3, paramErrorSound4);

    var outPut	= '';	// variable to store all the output


    for ( var x=0; x<errorSoundArray.length; x++ )
    {
	    var	errorVariableName	=	''
					//							+	'ErrorPhoneme'
					//							+	( x + 1 )		// one higher..
					+	globalErrorPhonemeTagArray[x]
					+	'_'
					+	paramAnlysDetailAutoIncrement
					//+	'_'
					//+	paramRowNbr
					;
									// 2007-06-07

		
									// 2007-06-07
	    var onclick_dropdown_command
				=	'initPhonemeGrid'
				+	'('					// open paren
				+	"'"					// single quote
				+	paramFormName
				+	"'"					// single quote
				+	','					// comma
				+	"'"					// single quote
				+	errorVariableName
				+	"'"					// single quote
				+	')'					// close paren
				+	';'					// semicolon
				+	'return overlay'
				+	'('					// open paren
				+	'this'
				+	','					// comma
				+	"'"					// single quote
				+	'myPhonemeGrid'				// grid name
				+	"'"					// single quote
				+	','					// comma

				+	"'"					// single quote
				+	'left'					// horizontal 
				+	"'"					// single quote
				+	','					// comma

				+	"'"					// single quote
				+	'top'					// vertical 
				+	"'"					// single quote
				+	','					// comma

				+	"'"					// single quote
				+	'-20'					// horizontal offset
				+	"'"					// single quote
				+	','					// comma

				+	"'"					// single quote
				+	'-200'					// vertical offset 
				+	"'"					// single quote

				+	')'					// close paren
				+	';'					// semicolon
				;



	    outPut	+=	''						// blank first one
			+	'<td>'						// start of table cell
			;

	    outPut	+=	''						// blank first one
			+	'<input type="hidden" name='
			+	'"'						// double quote
			+	errorVariableName
			+	'"'						// double quote
			+	' value='
			+	'"'						// double quote
			+	errorSoundArray[x]
			+	'"'						// double quote
			+	'>'						// close tag
			;

	    outPut	+=	''						// blank first one
			+	'<'						// start tag
			+	'div '						// start span
			+	' class='
			+	'"'						// double quote
			+	'phonemeDisplayOnlyClassDiv'
			+	'"'						// double quote
			+	' name='
			+	'"'						// double quote
			+	errorVariableName
			+	'"'						// double quote
			+	'>'						// close image tag
			+	errorSoundArray[x]
			+	'</div>'
			;

	    outPut	+=	''						// blank first one
			+	'</td>'						// end of table cell
			;

     };
			

    if  ( deBug == 0 )	{
	    document.write (outPut);
	    // return (outPut);
    } else {

	    while (outPut.indexOf("<") > -1 )
		outPut = outPut.replace("<", "&lt;");
	    while (outPut.indexOf(">") > -1 )
		outPut = outPut.replace(">", "&gt;");
	    document.write ('<pre>' + outPut + '</pre>' );
    };
};

function htmlCountValues
	(	paramFormName			//	param 01	2007-06-08
	,	paramAnlysDetailAutoIncrement	//	param 02	2007-06-08
	,	paramRowNbr			//	param 03	2007-06-07 
						//	removed on 2007-06-13 ,	paramTag
	,	paramWordCount			//	param 04
	,	paramSentenceCount		//	param 05
	,	paramReadingCount		//	param 06
	,	paramSpeakingCount		//	param 07
	,	paramErrorFrequency		//	param 08
	,	paramErrorNotes			//	param 09
	,	paramWordTooltipInfo		//	param 10
	,	paramSentenceTooltipInfo	//	param 11
	,	paramReadingTooltipInfo		//	param 12
	)
{
    var deBug	= 0;

    var outPut	= '';	// variable to store all the output

    var wzTooltipParms
		=	''
		+	',	BALLOON		,	true			'
		+	',	ABOVE		,	true			'
		+	',	OFFSETX		,	-95			'
		+	',	WIDTH		,	100			'
		+	",	TEXTALIGN	,	'justify' "
		+	',	FADEIN		,	800			'
		+	',	FADEOUT		,	800			'
		+	',	PADDING		,	8			'
		;

    var errorSpeakingCountVarName
		=	''
		//				+	'ErrorSpeakingCount'
		+	globalSpeakingCountTag
		+	'_'
		+	paramAnlysDetailAutoIncrement
		//+	'_'
		//+	paramRowNbr
		;

    var errorFreqVarName
		=	''
		+	globalFreqTag			//	'ErrorFrequency'
		+	'_'
		+	paramAnlysDetailAutoIncrement
		//+	'_'
		//+	paramRowNbr
		;

    var errorNotesVarName
		=	''
		+	globalNotesTag			//	'ErrorNotes'
		+	'_'
		+	paramAnlysDetailAutoIncrement
		//+	'_'
		//+	paramRowNbr
		;

    var onclick_incr_speaking_count_command
		=	''
		+	'incrSpeakingCount'
		+	'('
		+	"'"
		+	paramFormName
		+	"'"
		+	','
		+	"'"
		+	errorSpeakingCountVarName
		+	"'"
		+	')'
		+	';'
		;

    var onClick_msgCount_dropdown_command
		=	''
		+	'initSpeakingCount'
		+	'('
		+	"'"
		+	errorSpeakingCountVarName
		+	"'"
		+	')'
		+	';'
		+	'return overlay'
		+	'('
		+	'this'
		+	','
		+	"'"
		+	'mySpeakingCount'
		+	"'"
		+	')'
		+	';'
		;

			/****************************************
    var	speaking_count_move_data_to_array
		=	''
		+	'moveSpeakingCountToArray'
		+	'('
		+	"'"
		+	paramFormName
		+	"'"
		+	','
		+	"'"
		+	errorSpeakingCountVarName
		+	"'"
		+	')'
		+	';'
		;
    
    var	frequency_command_move_data_to_array
		=	''
		+	'moveFrequencyToArray'
		+	'('
		+	"'"
		+	paramFormName
		+	"'"
		+	','
		+	"'"
		+	errorFreqVarName
		+	"'"
		+	')'
		+	';'
		;

    var	onChange_command_move_error_notes_to_array
		=	''
		+	'moveErrorNotesToArray'
		+	'('
		+	"'"
		+	paramFormName
		+	"'"
		+	','
		+	"'"
		+	errorNotesVarName
		+	"'"
		+	')'
		+	';'
		;
			******************************************/


    var onClick_msgFreq_dropdown_command
		=	''
		+	'initErrorFrequency'
		+	'('
		+	"'"
		+	errorFreqVarName
		+	"'"
		+	')'
		+	';'
		+	'return overlay'
		+	'('
		+	'this'
		+	','
		+	"'"
		+	'myErrorFrequency'
		+	"'"
		+	')'
		+	';'
		;


		//	word count cell

    if  ( paramWordCount > 0 )	{
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'<span'					// start span
			+	' onMouseOver='				// 
			+	'"'					// onmouseover double quote open
			+	'Tip'					// walter zorn tooltip function
			+	'('					// open parenthesis
			+	"'"					// single quote
			+	paramWordTooltipInfo
			+	"'"					// single quote
			+	wzTooltipParms
			+	')'					// close parenthesis
			+	';'					// jscript semicolon
			+	'"'					// onmouseover double quote close
			+	' class="hoverInfo"'
			+	'>'					// close span tag
			+	paramWordCount
			+	'</span>'				// end span
			+	'</td>'					// tne table cell
			;
    } else {
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'--'
			+	'</td>'					// tne table cell
			;
    };


		// sentence count cell

    if  ( paramSentenceCount > 0 )	{
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'<span'					// start span
			+	' onMouseOver='				// 
			+	'"'					// onmouseover double quote open
			+	'Tip'					// walter zorn tooltip function
			+	'('					// open parenthesis
			+	"'"					// single quote
			+	paramSentenceTooltipInfo
			+	"'"					// single quote
			+	wzTooltipParms
			+	')'					// close parenthesis
			+	';'					// jscript semicolon
			+	'"'					// onmouseover double quote close
			+	' class="hoverInfo"'
			+	'>'					// close span tag
			+	paramSentenceCount
			+	'</span>'				// end span
			+	'</td>'					// tne table cell
			;
    } else {
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'--'
			+	'</td>'					// tne table cell
			;
    };



		// reading count cell
    if  ( paramReadingCount > 0 )	{
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'<span'
			+	' onMouseOver='				// 
			+	'"'					// onmouseover double quote open
			+	'Tip'					// walter zorn tooltip function
			+	'('					// open parenthesis
			+	"'"					// single quote
			+	paramReadingTooltipInfo
			+	"'"					// single quote
			+	wzTooltipParms
			+	')'					// close parenthesis
			+	';'					// jscript semicolon
			+	'"'					// onmouseover double quote close
			+	' class="hoverInfo"'
			+	'>'					// close span tag
			+	paramReadingCount
			+	'</span>'				// end span
			+	'</td>'					// tne table cell
			;
    } else {
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'--'
			+	'</td>'					// tne table cell
			;
    };



	// speaking count cell

    if  ( paramSpeakingCount > 0 )	{
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell

			+	'<input type="hidden"'			// hidden var
			+	' name='
			+	'"'					// double quote
			+	errorSpeakingCountVarName
			+	'"'					// double quote
			+	' value='
			+	'"'					// double quote
			+	paramSpeakingCount
			+	'"'					// double quote
			+	'>'					// close span tag

			+	'<span '				// start span 
			+	' class="speakingCountDisplay"'
			+	'>'					// close span tag
			+	paramSpeakingCount
			+	'</span>'				// end span
			+	'</td>'					// tne table cell
			;

    } else {
	    outPut	+=	''					// blank first one
			+	'<td>'					// start table cell
			+	'--'
			+	'</td>'					// tne table cell
			;
    };

		// frequency cell

    outPut	+=	''					// blank first one
		+	'<td>'					// start table cell
		+	'<input type="text"'			// start input field tag

		+	' onClick='
		+	'"'					// double quote
		+	onClick_msgFreq_dropdown_command
		+	'"'					// double quote

		+	' class='
		+	'"'					// double quote
		+	'class_drop_down_freq'			// css class name
		+	'"'					// double quote
		+	' name='
		+	'"'					// double quote
		+	errorFreqVarName	// 2007-06-08
		+	'"'					// double quote
		+	' value='
		+	'"'					// double quote
		+	paramErrorFrequency
		+	'"'					// double quote
		+	' readonly="readonly"'			// readonly switch
		+	'>'					// close input field tag
		+	'</td>'					// tne table cell
		;

		// notes text field cell

    outPut	+=	''					// blank first one
		+	'<td>'					// start table cell
		+	'<input type="text"'			// start input field tag
		+	' name='
		+	'"'					// double quote
		+	errorNotesVarName	// 2007-06-08
		+	'"'					// double quote
		+	' value='
		+	'"'					// double quote
									//				+	paramErrorNotes
		+	paramErrorNotes.replace(/\"/g, '&quot;' )	// replace backspace-doublequote with the html equiv 2009-01-15
		+	'"'					// double quote
		//						+	'readonly="readonly"'			// readonly flag
		+	'>'					// close input field tag
		+	'</td>'					// tne table cell
		;


    if  ( deBug == 0 )	{
	    document.write (outPut);
	    // return (outPut);
    } else {

	    while (outPut.indexOf("<") > -1 )
		outPut = outPut.replace("<", "&lt;");
	    while (outPut.indexOf(">") > -1 )
		outPut = outPut.replace(">", "&gt;");
	    document.write ('<pre>' + outPut + '</pre>' );
    };

};

