// JavaScript Document


// Main httpRequest

var xmlHttp;
var xmlHttp2;
var xmlHttp3;

function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    }
}
function createXMLHttpRequest2() {
    if (window.ActiveXObject) {
        xmlHttp2 = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp2 = new XMLHttpRequest();
    }
}
function createXMLHttpRequest3() {
    if (window.ActiveXObject) {
        xmlHttp3 = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp3 = new XMLHttpRequest();
    }
}
function getRequestBody(oForm) {
    var aParams = new Array();
    
    for (var i=0 ; i < oForm.elements.length; i++) {
        var sParam = encodeURIComponent(oForm.elements[i].name);
        sParam += "=";
        sParam += encodeURIComponent(oForm.elements[i].value);
        aParams.push(sParam);
    } 
    
    return aParams.join("&");
}




//

function ClearChildNodes(parentId)
{
	var ParentObj = document.getElementById(parentId);
    while(ParentObj.childNodes.length > 0) {
              ParentObj.removeChild(ParentObj.childNodes[0]);
    }	
}



function CountChildNodes(parentId)
{
	var ParentObj = document.getElementById(parentId);
    return ParentObj.childNodes.length;
}



function AddRow(parentId)
{
	//ClearChildNodes(parentId);
	
	//alert(CountChildNodes(parentId));
	var ParentObj = document.getElementById(parentId);
	
      //ParentObj.appendChild(createRowMultipleCell(3,'Row'+(i+1)));
	  ParentObj.appendChild(createRowSingleCell('Row'+(CountChildNodes(parentId)+1)));
	
	
}

function createRowSingleCell(text)
{
	var row = document.createElement("tr");
	
		row.appendChild(createCellWithText(text));
	
	return row;
}

function createRowMultipleCell(numRow,text)
{
	var row = document.createElement("tr");
	for(i=0;i<=numRow-1;i++)
	{
		row.appendChild(createCellWithText(text));
	}
	return row;
}

function createCellWithText(text)
{
    var cell = document.createElement("td");
	cell.setAttribute("align", "center");
	//cell.style.background = "#ededed";
	cell.style.cursor = "pointer";
	cell.className = "txt_list_educt_de";
	cell.setAttribute("className", "text_11_black");
	cell.appendChild(document.createTextNode(text));
    return cell;
}

function createCellWithTextAndWidth(text,wid) 
{
    var cell = document.createElement("td");
	cell.setAttribute("width", wid);
	cell.setAttribute("align", "center");
	cell.style.background = "#CCCCCC";
	cell.appendChild(document.createTextNode(text));
    return cell;
}


function trim(str)
{
 return str.replace(/^\s+|\s+$/g, ''); 
}
