function ShowEduTask3(id)
{
    TaskId = id;
    MakeDataRequest(Handler3, 3);
}

function Handler3(data)
{
    var oAnswersDiv = ShowContent(data, ButtonHandler3);
	oAnswersDiv.id = 'EduVariantDiv';

	var contSpan= document.createElement('span');
	contSpan.id = "contSpan";
	
	var strCon = data.getAttribute("content");
	
	strCon = strCon.replace(/<V>(.*?)<\/V>/ig,'<span class="variantClass">$1</span>');
	strCon = strCon.replace(/<Word>(.*?)<\/Word>/ig,'<span class="wordClass">$1</span>');
	strCon = strCon.replace(/<W>(.*?)<\/W>/ig,'<span class="wordClass">$1</span>');
	strCon = strCon.replace(/<L.*?size="(.*?)".*?\/>/gi, '<input type="text" size="$1" />');
	strCon = strCon.replace(/<L\/>/gi, '<input type="text" size="1"/>');
	
	
	contSpan.innerHTML=strCon;

	
	for (var i =0 ; i< contSpan.childNodes.length; i++)
	{
		if (contSpan.childNodes[i].nodeName == "SPAN")
		{
		checkL (contSpan.childNodes[i]);
		}
		oAnswersDiv.appendChild(contSpan);

	}

}




function ButtonHandler3()
{
	var sAnswers = "";
	var oContentDiv = document.getElementById('EduVariantDiv');
	var inputs = oContentDiv.getElementsByTagName('input');

           for (var i = 0 ; i < inputs.length; i++)
	{

	sAnswers += inputs[i].value;
 	sAnswers += "|";

	if (i == inputs.length - 1 && sAnswers.length != 0) 
	{						
	sAnswers = sAnswers.substr(0, sAnswers.length - 1);
	}

         }   

 	alert(sAnswers);
	SendReply(sAnswers);
}



	function checkL (child)
	{
	var  childObj = child;

		for (var i =0 ; i< childObj.childNodes.length; i++)
		{
			if (childObj.childNodes[i].nodeName == "SPAN") 
			checkL (childObj.childNodes[i]);
			
			if (childObj.childNodes[i].nodeName == "INPUT") 
				{
				var txtSize = childObj.childNodes[i].getAttribute('size');
				var pan= document.createElement('span');
				pan.id = "pan";
				var oTextbox = document.createElement('input'); 
				oTextbox.type = 'text'; 
				oTextbox.name = 'mytxtbox';
					if (txtSize==1)
					oTextbox.className = 'pix';
				oTextbox.size = txtSize;
				oTextbox.maxLength = txtSize;
			pan.appendChild(oTextbox);
			childObj.replaceChild(pan,childObj.childNodes[i]); 
			}
		}
	}