

function ShowNextRow(ParentName, ObjName, RowCount, RowName)
{

    //hfExonTotal
    var hfExonTotal = $get(ParentName + "_hfExonTotal");
    var TotalRows = hfExonTotal.value;
    //EEtest4$hfExonTotal
    //EEtest4_exonloc1_trExon
    if(TotalRows > RowCount)
    {
        var aRow = $get(ParentName + ObjName + ((RowCount * 1) + 1) + RowName);
        aRow.style.display = 'block';
    }
    else
    {
        __doPostBack(ParentName + "$lbtnAddRows",'');  
    }
    
}

function HideEmptyLocations(ParentID, RowName, RowCount, AllowRows, tbCheck)
{
//EEtest4$exonloc1$tbExonStart
//EEtest4_exonloc1_trExon1
    var i = 1;
    var CheckRows = 0;
    
    for (i=1; i < RowCount; i++)
    {
        
        var aTextbox = $get(ParentID + i + tbCheck);
        if(aTextbox.value == '')
        {
            if(CheckRows < AllowRows)
            {
                CheckRows = CheckRows + 1;
            }
            else
            {
                var aRow = $get(ParentID + i + RowName);
                aRow.style.display = 'none';
            }
        }
        else
        {
            aTextbox.style.display = 'block';
        }
    }
}

function SortLocations(RowName, RowCount, AllowRows, tbCheck)
{
    var i = 1;
    var CheckRows = 0;
    
    for (i=1; i < RowCount; i++)
    {
        
        var aTextbox = $get(tbCheck + i);
        if(aTextbox.value == '')
        {
            if(CheckRows < AllowRows)
            {
                CheckRows = CheckRows + 1;
            }
            else
            {
                var aRow = $get(RowName + i);
                aRow.style.display = 'none';
            }
        }
        else
        {
            aTextbox.style.display = 'block';
        }
    }
}

function CreateNewRows(RowName, RowCount, AllowRows, tbCheck)
{

}

//function RemoveLocation(RemoveButton)
//{
//    var ParentElement = RemoveButton.id.substring(0, RemoveButton.id.indexOf('_'));
//    var Location = replace(RemoveButton.id, '_btRemove','_Locations');    
//    var tbStartPosition = replace(RemoveButton.id, '_btRemove','_tbStartPosition');
//    var tbEndPosition = replace(RemoveButton.id, '_btRemove','_tbEndPosition'); 
//       
//    $get(tbStartPosition).value = '';
//    $get(tbEndPosition).value = ''; 
//    DisableTextbox(tbStartPosition, false);
//    DisableTextbox(tbEndPosition, false);   
//    $get(Location).style.display = "none";     
//}



//  End -->

