// JavaScript Document
/*
***************************************************
* Snippet Name : Add HTML Control by JavaScript Dynamically * 
* Scripted By : Shashidhar Kumar * 
* Website : http://www.shashionline.in * 
* Email : shashi@shashionline.in * 
* License : GPL (General Public License) * 
***************************************************
*/
var arrInput = new Array(0);
  var arrInputValue = new Array(0);

function addInput() {
  arrInput.push(arrInput.length);
  arrInputValue.push("");
  display();
}

function display() {
  document.getElementById('parah').innerHTML="";
  for (intI=0;intI<arrInput.length;intI++) {
    document.getElementById('parah').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]);
  }
}

function saveValue(intId,strValue) {
  arrInputValue[intId]=strValue;
}  

function createInput(id,value) {
  return "<input type='text' name='sort_sec "+ id +"' id='sort_sec "+ id +"' size='1' class='blk_txt' maxlength='2'>&nbsp;<input class='blk_txt' type='text' name='info_sec "+ id +"' id='info_sec "+ id +"' size='30'><a href='javascript:deleteInput()'><img src='images/minus.jpg' border='0' /></a><br>";
}

function deleteInput() 
{
  if (arrInput.length > 0) 
  { 
     arrInput.pop(); 
     arrInputValue.pop();
  }
  display(); 
}

function deleteInput1() 
{
  alert("You should enter atleast one Section.");
}

