
function prepopAllSurnames(formName){
for(var row=1;row<=5;row++){
eval('document.'+formName+'.additionalClaimantLastName'+row).readOnly = true;
prepopSurname(formName,row);
}
}

function prepopSurname(formName, row){
if(eval('document.'+formName+'.additionalClaimantTitle'+row).value != ""){
eval('document.'+formName+'.additionalClaimantFirstName'+row).readOnly = false;
eval('document.'+formName+'.additionalClaimantLastName'+row).value = eval('document.'+formName+'.principalClaimantLastName').value;
found = false;
for(var ctr=0;ctr<=flightSellingMandatoryFields.length;ctr++){
if(flightSellingMandatoryFields[ctr] && flightSellingMandatoryFields[ctr][0]=="additionalClaimantFirstName"+row){
flightSellingMandatoryFields[ctr][3] = "";
found = true;
break;
}
}
if (!found){
flightSellingMandatoryFields[flightSellingMandatoryFields.length] = new Array("additionalClaimantFirstName"+row,"","additionalClaimant"+row+"Lbl","","","");
}
fsLabelLookup["additionalClaimantFirstName"+row] = "additionalClaimant"+row+"Lbl";
}
else{
eval('document.'+formName+'.additionalClaimantFirstName'+row).readOnly = true;
eval('document.'+formName+'.additionalClaimantFirstName'+row).value = "";
eval('document.'+formName+'.additionalClaimantLastName'+row).value = "";
for(var ctr=0;ctr<=flightSellingMandatoryFields.length;ctr++){
if(flightSellingMandatoryFields[ctr] && flightSellingMandatoryFields[ctr][0]=="additionalClaimantFirstName"+row){

flightSellingMandatoryFields[ctr][3] = "DELETED";
delete fsLabelLookup["additionalClaimantFirstName"+row];
break;
}
}
}
}
function setAdditionalClaimantName(formName, row){
eval('document.'+formName+'.additionalClaimant'+row).value = eval('document.'+formName+'.additionalClaimantFirstName'+row).value;
}
function optionDay(defaultLabel, selectedValue){
document.write("<option value=''>",defaultLabel,"</option>");
selected="";
for (var ctr=1;ctr <= 31;ctr++){
if (selectedValue && selectedValue != ""){
if (selectedValue == ctr){
selected = " selected";
}
else{
selected="";
}
}
document.write("<option value='",ctr,"'",selected,">",ctr,"</option>");
}
}
function optionMonth(refMonth, defaultLabel, selectedValue){
document.write("<option value=''>",defaultLabel,"</option>");
selected="";
for (var ctr=1;ctr <= refMonth.length; ctr++){
if (selectedValue && selectedValue != ""){
if (selectedValue == ctr){
selected = " selected";
}
else{
selected="";
}
}
document.write("<option value='",ctr,"'",selected,">",refMonth[ctr-1],"</option>");
}
}
function optionYear(start, end, defaultLabel, selectedValue){
document.write("<option value=''>",defaultLabel,"</option>");
selected="";
for (var ctr=start;ctr <= end; ctr++){
if (selectedValue && selectedValue != ""){
if (selectedValue == ctr){
selected = " selected";
}
else{
selected="";
}
}
document.write("<option value='",ctr,"'",selected,">",ctr,"</option>");
}
}
function optionTitle(refMonth, defaultLabel, selectedValue){
document.write("<option value=''>",defaultLabel,"</option>");
selected="";
for (var ctr=0;ctr < refMonth.length; ctr++){
if (selectedValue && selectedValue != ""){
if (selectedValue == refMonth[ctr]){
selected = " selected";
}
else{
selected="";
}
}
document.write("<option value='",refMonth[ctr],"'",selected,">",refMonth[ctr],"</option>");
}
}

