 row_no=6; 
	sub3='subcontentc3';
	sub4='subcontentc4';
	sub5='subcontentc5';
	sub6='subcontentc6';
    function addRow(tbl,row){ 
        //so that user can only add 4 rows 
        if(row_no<=10){    
        
            if(row_no==6)var textbox='<p align="center" /><input type="text" style="font-size: 10px" size="7" id="txtC3Age" name="txtC3Age">';
            if(row_no==7)var textbox='<p align="center" /><input type="text" style="font-size: 10px" size="7" id="txtC4Age" name="txtC4Age">';
            if(row_no==8)var textbox='<p align="center" /><input type="text" style="font-size: 10px" size="7" id="txtC5Age" name="txtC5Age">';
            if(row_no==9)var textbox='<p align="center" /><input type="text" style="font-size: 10px" size="7" id="txtC6Age" name="txtC6Age">';


          
          
          
        //for suitable label to the row 
        if(row_no==6) text='<p align="right" /><font face="verdana" size="1">Child'; 
        if(row_no==7) text='<p align="right" /><font face="verdana" size="1">Child';
        if(row_no==8) text='<p align="right" /><font face="verdana" size="1">Child'; 
        if(row_no==9) text='<p align="right" /><font face="verdana" size="1">Child'; 

        if(row_no==6) text1='<p align="center" /><select id="cmbC3Gender" style="font-size: 10px" name="cmbC3Gender"><option value="1" selected>M</option><option value="2">F</option></select>';
		if(row_no==7) text1='<p align="center" /><select id="cmbC4Gender" style="font-size: 10px" name="cmbC4Gender"><option value="1" selected>M</option><option value="2">F</option></select>';
		if(row_no==8) text1='<p align="center" /><select id="cmbC5Gender" style="font-size: 10px" name="cmbC5Gender"><option value="1" selected>M</option><option value="2">F</option></select>';
		if(row_no==9) text1='<p align="center" /><select id="cmbC6Gender" style="font-size: 10px" name="cmbC6Gender"><option value="1" selected>M</option><option value="2">F</option></select>';
		
		

        var tbl = document.getElementById(tbl);//to identify the table in which the row will get insert 
        var rowIndex = document.getElementById(row).value;//to identify the row after which the row will be inserted 
        try { 
            var newRow = tbl.insertRow(row_no);//creation of new row
             var newCell = newRow.insertCell(0);//first cell in the row 
             var newCell = newRow.insertCell(1);//2nd cell in the row 
            newCell.innerHTML = text;//insertion of the 'text' variable in 2md cell
                       var newCell = newRow.insertCell(2);//34d  cell in the row 
            newCell.innerHTML = text1;//insertion of the 'text' variable in 3rd cell
             var newCell = newRow.insertCell(3);//4th cell in the row 
            newCell.innerHTML = textbox;//insertion of the text box 4th
            var newCell = newRow.insertCell(4);//5th cell in the row 
            var newCell = newRow.insertCell(5);//6 cell in the row 
            var newCell = newRow.insertCell(6);//7 cell in the row 
            row_no++; 
        } catch (ex) { 
            alert(ex); //if exception occurs 
        } 
            
    } 
    if(row_no>9)//if the row contain 4 textbox, the add button will disapper 
    { 
        document.getElementById("add").style.display="none"; 
    }                        
} 
function removeRow(tbl,num) 
{ 
    var table = document.getElementById(tbl);//adentification of table 
    try { 
        row_no--; 
        table.deleteRow(num);//deletion of the clicked row 
    } catch (ex) { 
        alert(ex); 
    } 
    
    if(row_no<=9)//if row is less than 14 then the button will again appear to add row 
    { 
            document.getElementById("add").style.display="block"; 
    }    
} 
