// Create New Attendee Rows
var nRowCur = 1;

function addNewClient()
{
var attendeeDiv = document.getElementById("addClients");

if (navigator.appName == "Netscape" || navigator.appName == "Mozilla")
{ 
    //Attendee Table
    var attendeeTable = document.createElement("table");
    attendeeTable.setAttribute('width', '500');
    attendeeTable.setAttribute('border', '0');
    attendeeTable.setAttribute('cellspacing', '0');
    attendeeTable.setAttribute('cellpadding', '0');
    attendeeTable.setAttribute('class', 'tlf');
    attendeeTable.setAttribute('style','margin-top:0px;');    

    //Attendee Row
    var attendeeTr = document.createElement("tr");
    attendeeTr.setAttribute('id', 'rowzz' + nRowCur);  

    //Remove Row Anchor
    var removeAnchor = document.createElement("a");
    removeAnchor.setAttribute("onclick","removeit('rowzz" + nRowCur + "');");
    removeAnchor.setAttribute("style","font-size:8px;margin:0 0 0 4px;");
    removeAnchor.appendChild(document.createTextNode('Remove'));
    removeAnchor.setAttribute("href","#");

    //Add First Name Input
    var fNameDiv = document.createElement("td");
    fNameDiv.setAttribute('style', 'width:125px;');
    fNameDiv.appendChild(document.createTextNode("First Name:"));
    fNameDiv.appendChild(removeAnchor);
    fNameDiv.appendChild(document.createElement('br'));
    var fNameInput = document.createElement('input');
    fNameInput.setAttribute('type', 'text');
    fNameInput.setAttribute('id', 'fnamez' + nRowCur);
    fNameInput.setAttribute('name', 'fnamez' + nRowCur);
    fNameInput.setAttribute('class', 'input');
    fNameInput.setAttribute('style', 'width:112px;');
    fNameDiv.appendChild(fNameInput);
    attendeeTr.appendChild(fNameDiv);
    
    //Add Last Name Input
    var lNameDiv = document.createElement("td");
    lNameDiv.setAttribute('style', 'width:125px;');
    lNameDiv.appendChild(document.createTextNode("Last Name:"));
    lNameDiv.appendChild(document.createElement('br'));
    var lNameInput = document.createElement('input');
    lNameInput.setAttribute('type', 'text');
    lNameInput.setAttribute('id', 'lnamez' + nRowCur);
    lNameInput.setAttribute('name', 'lnamez' + nRowCur);
    lNameInput.setAttribute('class', 'input');
    lNameInput.setAttribute('style', 'width:112px;');
    lNameDiv.appendChild(lNameInput);
    attendeeTr.appendChild(lNameDiv);
    
    //Add Email Input
    var emailDiv = document.createElement("td");
    emailDiv.setAttribute('style', 'width:125px;');
    emailDiv.appendChild(document.createTextNode("E-Mail Address:"));
    emailDiv.appendChild(document.createElement('br'));    
    var emailInput = document.createElement('input');
    emailInput.setAttribute('type', 'text');
    emailInput.setAttribute('id', 'emailz' + nRowCur);
    emailInput.setAttribute('name', 'emailz' + nRowCur);
    emailInput.setAttribute('class', 'input');
    emailInput.setAttribute('style', 'width:112px;');
    emailDiv.appendChild(emailInput);
    attendeeTr.appendChild(emailDiv);

    var jobDiv = document.createElement("td");
    jobDiv.setAttribute('style', 'width:125px;');
    jobDiv.appendChild(document.createTextNode("Job Function:"));
    jobDiv.appendChild(document.createElement('br'));
    jobSelect = document.createElement('select');
    jobSelect.setAttribute('id', 'jobfunc' + nRowCur);
    jobSelect.setAttribute('style', 'width:112px;');
    jobSelect.setAttribute('name', 'jobfunc' + nRowCur);    
        opt1 = document.createElement("option"); 
        opt1.setAttribute('selected', 'selected');
        opt1.value = ''; 
        opt1.appendChild(document.createTextNode('- -'));
    jobSelect.appendChild(opt1);
        opt2 = document.createElement("option"); 
        opt2.value = 'Attorney'; 
        opt2.appendChild(document.createTextNode('Attorney'));
    jobSelect.appendChild(opt2);
        opt3 = document.createElement("option"); 
        opt3.value = 'Paralegal'; 
        opt3.appendChild(document.createTextNode('Paralegal'));
    jobSelect.appendChild(opt3);
        opt4 = document.createElement("option"); 
        opt4.value = 'Combination'; 
        opt4.appendChild(document.createTextNode('Combination'));
    jobSelect.appendChild(opt4);
        opt5 = document.createElement("option"); 
        opt5.value = 'Other'; 
        opt5.appendChild(document.createTextNode('Other'));
    jobSelect.appendChild(opt5);
    jobDiv.appendChild(jobSelect);
    
    attendeeTr.appendChild(jobDiv);
    attendeeTable.appendChild(attendeeTr);    
    attendeeDiv.appendChild(attendeeTable);
    
}
else
{
    var sAddClient = new String();
    sAddClient = attendeeDiv.innerHTML;
    
    sAddClient += "<table id=\"addClients\" width=\"500\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"tlf\" style=\"margin-top:0px;\">"
    
    sAddClient += "<tr id=\"rowzz" + nRowCur + "\">"; 
    
    sAddClient += "<td style=\"width:125px;\">"    
	sAddClient += "First Name:<a href=\"#\" onclick=\"removeit('rowzz" + nRowCur + "');\" style=\"font-size:8px;margin:0 0 0 4px;\">Remove</a><br />";
	sAddClient += "<input id=\"fnamez" + nRowCur + "\" name=\"fnamez" + nRowCur + "\" type=\"text\" class=\"input\" style=\"width:112px;\" value=\"\" />"
	sAddClient += "</td>"
	
	sAddClient += "<td style=\"width:125px;\">"
	sAddClient += "Last Name:<br />";
	sAddClient += "<input id=\"lnamez" + nRowCur + "\" name=\"lnamez" + nRowCur + "\" type=\"text\" class=\"input\" style=\"width:112px;\" value=\"\" />"
	sAddClient += "</td>"
	
	sAddClient += "<td style=\"width:125px;\">"
	sAddClient += "E-Mail Address:<br />";
	sAddClient += "<input id=\"emailz" + nRowCur + "\" name=\"emailz" + nRowCur + "\" type=\"text\" class=\"input\" style=\"width:112px;\" value=\"\" />"
	sAddClient += "</td>"
	
	sAddClient += "<td style=\"width:125px;\">"
	sAddClient += "Job Function:<br />";
	sAddClient += "<select id=\"jobfunc" + nRowCur + "\" name=\"jobfunc" + nRowCur + "\" type=\"text\" style=\"width:112px;\"><option value=\"\" selected=\"selected\">- -</option><option value=\"Attorney\">Attorney</option><option value=\"Paralegal\">Paralegal</option><option value=\"Combination\">Combination</option><option value=\"Other\">Other</option></select>"
	sAddClient += "</td>"
	
	sAddClient += "</tr>";
    
    sAddClient += "</table>";
    
    attendeeDiv.innerHTML = sAddClient;
}
    nRowCur++;
    document.getElementById("nRows").value = nRowCur;
}

function removeit(elemId)
{
    var removeThis = document.getElementById(elemId);
    if(removeThis != null)
    {
        var myParent = removeThis.parentNode;
        myParent.removeChild(removeThis);
    }
}