var arrInput = new Array(0);
  var arrInputValue = new Array(0);
cloneindex = 1;
var listTpl = null;
var counter = 1;
$().ready(function() {
				   
        listTpl = $("#template").clone().html();
		
});
function addInput() {
  arrInput.push(arrInput.length);
  arrInputValue.push("");
  display();
}

function display() {
 	document.getElementById('parah').innerHTML=""; 
    document.getElementById('parah').innerHTML+=createInput();  
}


function createInput() {
  if(cloneindex == 8){
	   HideMaintButton();
   }
   var newsection = "<br><br><br>"+listTpl;
   newsection = newsection.replace(/1/g, cloneindex+1);
   
   $("#template").append(newsection);
   cloneindex++;  	
}

function HideMaintButton(){
	$(document).ready(function(){
	$("#second_list").hide();
		//event.preventDefault();
		$("#second_list").show('fast');
		$("#add_maint").hide('fast');
	});	
}