function ProductOptions(chosen) {
var selbox = document.AQContact.Product;
 
selbox.options.length = 0;
if (chosen == "Select a Product Line") {
  	selbox.options[selbox.options.length] = new Option('Select a Product Line First','Select a Product Line First'); 
}

//Edit produtc list here. First locate the product line, then add the product to it.
//Be sure to add it in correct format. Also, be sure to add it in correct sorting order.

if (chosen == "BVRP") {
	selbox.options[selbox.options.length] = new Option('Select a Product','Select a Product');
	selbox.options[selbox.options.length] = new Option('Classic PhoneTools ','Classic PhoneTools ');
	selbox.options[selbox.options.length] = new Option('Connection Manager ','Connection Manager ');
	selbox.options[selbox.options.length] = new Option('Digital Video Duplicator','Digital Video Duplicator');
	selbox.options[selbox.options.length] = new Option('DVD2Pod / TransferMyDVD ','DVD2Pod / TransferMyDVD ');
	selbox.options[selbox.options.length] = new Option('eXPert PDF ','eXPert PDF ');
	selbox.options[selbox.options.length] = new Option('FaxTools','FaxTools');
	selbox.options[selbox.options.length] = new Option('FaxTools eXPert','FaxTools eXPert');
	selbox.options[selbox.options.length] = new Option('FaxTools eXPert Network ','FaxTools eXPert Network ');
	selbox.options[selbox.options.length] = new Option('GPRS Manager ','GPRS Manager ');
	selbox.options[selbox.options.length] = new Option('Mobile Phone Suite','Mobile Phone Suite');
	selbox.options[selbox.options.length] = new Option('Modem-on-Hold ','Modem-on-Hold ');
	selbox.options[selbox.options.length] = new Option('Netwaiting ','Netwaiting ');
	selbox.options[selbox.options.length] = new Option('PhoneTools eXPert ','PhoneTools eXPert ');
	selbox.options[selbox.options.length] = new Option('Pocket Connection Manager ','Pocket Connection Manager ');
	selbox.options[selbox.options.length] = new Option('Pocket PhoneTools ','Pocket PhoneTools ');
	selbox.options[selbox.options.length] = new Option('Pocket Theme Manager ','Pocket Theme Manager ');
	selbox.options[selbox.options.length] = new Option('Ringtone Media Studio','Ringtone Media Studio');
	selbox.options[selbox.options.length] = new Option('SendPhotos','SendPhotos');
}
if (chosen == "MySoftware") {
	selbox.options[selbox.options.length] = new Option('Select a Product','Select a Product');
	selbox.options[selbox.options.length] = new Option('Bookkeeper','Bookkeeper');
	selbox.options[selbox.options.length] = new Option('Business Cards ','Business Cards ');
	selbox.options[selbox.options.length] = new Option('Check Designer','Check Designer');
	selbox.options[selbox.options.length] = new Option('Check Launch','Check Launch');
	selbox.options[selbox.options.length] = new Option('CheckSoft Premier ','CheckSoft Premier ');
	selbox.options[selbox.options.length] = new Option('Database Professional','Database Professional');
	selbox.options[selbox.options.length] = new Option('Design & Print, Business Edition ','Design & Print, Business Edition ');
	selbox.options[selbox.options.length] = new Option('Driver Genius ','Driver Genius ');
	selbox.options[selbox.options.length] = new Option('DVD2Pod / TransferMyDVD ','DVD2Pod / TransferMyDVD ');
	selbox.options[selbox.options.length] = new Option('Holiday Creativity Kit ','Holiday Creativity Kit ');
	selbox.options[selbox.options.length] = new Option('iExtend ','iExtend ');
	selbox.options[selbox.options.length] = new Option('iGadget / TransferMyMusic ','iGadget / TransferMyMusic ');
	selbox.options[selbox.options.length] = new Option('Invoice & Estimates ','Invoice & Estimates ');
	selbox.options[selbox.options.length] = new Option('iPocketBible ','iPocketBible ');
	selbox.options[selbox.options.length] = new Option('Label Designer ','Label Designer ');
	selbox.options[selbox.options.length] = new Option('Label Maker','Label Maker');
	selbox.options[selbox.options.length] = new Option('MailList & Address Book ','MailList & Address Book ');
	selbox.options[selbox.options.length] = new Option('MailList Deluxe','MailList Deluxe');
	selbox.options[selbox.options.length] = new Option('Memeo AutoBackup ','Memeo AutoBackup ');
	selbox.options[selbox.options.length] = new Option('MindGenius Business ','MindGenius Business ');
	selbox.options[selbox.options.length] = new Option('MyAttorney Home & Business ','MyAttorney Home & Business ');
	selbox.options[selbox.options.length] = new Option('MyCheckBook','MyCheckBook');
	selbox.options[selbox.options.length] = new Option('MyDatabase','MyDatabase');
	selbox.options[selbox.options.length] = new Option('MyInvoices & Estimates Deluxe','MyInvoices & Estimates Deluxe');
	selbox.options[selbox.options.length] = new Option('MyLabel Designer ','MyLabel Designer ');
	selbox.options[selbox.options.length] = new Option('MyLabels','MyLabels');
	selbox.options[selbox.options.length] = new Option('MyLabels Premium','MyLabels Premium');
	selbox.options[selbox.options.length] = new Option('MyLogo Maker ','MyLogo Maker ');
	selbox.options[selbox.options.length] = new Option('MyMailList & Address Book','MyMailList & Address Book');
	selbox.options[selbox.options.length] = new Option('MyMailList Deluxe','MyMailList Deluxe');
	selbox.options[selbox.options.length] = new Option('MyPDF Maker ','MyPDF Maker ');
	selbox.options[selbox.options.length] = new Option('MyPostageRateSaver','MyPostageRateSaver');
	selbox.options[selbox.options.length] = new Option('MyProfessional BusinessCards','MyProfessional BusinessCards');
	selbox.options[selbox.options.length] = new Option('MyUltimateOrganizer ','MyUltimateOrganizer ');
	selbox.options[selbox.options.length] = new Option('Photo Finale ','Photo Finale ');
	selbox.options[selbox.options.length] = new Option('RadioTracker ','RadioTracker ');
	selbox.options[selbox.options.length] = new Option('Sales and Inventory Manager ','Sales and Inventory Manager ');
	selbox.options[selbox.options.length] = new Option('Small Business Pro ','Small Business Pro ');
	selbox.options[selbox.options.length] = new Option('Smart Business Pack','Smart Business Pack');
	selbox.options[selbox.options.length] = new Option('Smart Office Pack ','Smart Office Pack ');
	selbox.options[selbox.options.length] = new Option('Type Artist ','Type Artist ');
	selbox.options[selbox.options.length] = new Option('Web Eyes ','Web Eyes ');
	selbox.options[selbox.options.length] = new Option('WebPod Studio ','WebPod Studio ');
	selbox.options[selbox.options.length] = new Option('WillCreator Deluxe ','WillCreator Deluxe ');
}
if (chosen == "VCom") {
	selbox.options[selbox.options.length] = new Option('Select a Product','Select a Product');
	selbox.options[selbox.options.length] = new Option('AutoSave','AutoSave');
	selbox.options[selbox.options.length] = new Option('BIOS Pre-Processor ','BIOS Pre-Processor ');
	selbox.options[selbox.options.length] = new Option('CD Anywhere ','CD Anywhere ');
	selbox.options[selbox.options.length] = new Option('Copy Commander','Copy Commander');
	selbox.options[selbox.options.length] = new Option('Copy Commander Pro','Copy Commander Pro');
	selbox.options[selbox.options.length] = new Option('DiskCopy & Clean ','DiskCopy & Clean ');
	selbox.options[selbox.options.length] = new Option('DriveWorks ','DriveWorks ');
	selbox.options[selbox.options.length] = new Option('DVD PhotoPlay ','DVD PhotoPlay ');
	selbox.options[selbox.options.length] = new Option('Final Bid ','Final Bid ');
	selbox.options[selbox.options.length] = new Option('Fix-It Utilities','Fix-It Utilities');
	selbox.options[selbox.options.length] = new Option('Fix-It Utilities Professional','Fix-It Utilities Professional');
	selbox.options[selbox.options.length] = new Option('Media Easy ','Media Easy ');
	selbox.options[selbox.options.length] = new Option('Other Ixla Products ','Other Ixla Products ');
	selbox.options[selbox.options.length] = new Option('Other non-VCOM Products ','Other non-VCOM Products ');
	selbox.options[selbox.options.length] = new Option('Other Ontrack Products ','Other Ontrack Products ');
	selbox.options[selbox.options.length] = new Option('Other VCOM Products ','Other VCOM Products ');
	selbox.options[selbox.options.length] = new Option('Partition Commander','Partition Commander');
	selbox.options[selbox.options.length] = new Option('Partition Commander Pro','Partition Commander Pro');
	selbox.options[selbox.options.length] = new Option('PC Upgrade Commander ','PC Upgrade Commander ');
	selbox.options[selbox.options.length] = new Option('PerfectImage Professional ','PerfectImage Professional ');
	selbox.options[selbox.options.length] = new Option('PowerDesk Pro','PowerDesk Pro');
	selbox.options[selbox.options.length] = new Option('Recovery Commander','Recovery Commander');
	selbox.options[selbox.options.length] = new Option('SecurErase ','SecurErase ');
	selbox.options[selbox.options.length] = new Option('Sourcer System Commander','Sourcer System Commander');
	selbox.options[selbox.options.length] = new Option('System Commander','System Commander');
	selbox.options[selbox.options.length] = new Option('SystemSuite','SystemSuite');
	selbox.options[selbox.options.length] = new Option('Web Easy ','Web Easy ');
	selbox.options[selbox.options.length] = new Option('Web Easy Professional','Web Easy Professional');
	selbox.options[selbox.options.length] = new Option('Windows Source ','Windows Source ');

}
}

//DO NO EDIT BELLOW THIS LINE, THESE CODES ARE FOR CLIENT SIDE VALIDATION
//-------------------------------------------------------------------------------

//these functions are for Validating form fields
function validateFormOnSubmit(theForm) {
var reason = "";

  reason += validateEmail(theForm.EmailFrom);
  reason += validateFirstName(theForm.FirstName);
  reason += validateLastName(theForm.LastName);
  reason += validatePhone(theForm.Tel);
  reason += validateProductLine(theForm.ProductLine);
  reason += validateProduct(theForm.Product);
  reason += validateVersion(theForm.Version);
  reason += validateSubject(theForm.Subject);
  reason += validateDescription(theForm.Description);
      
  if (reason != "") {
    alert("Some fields need correction:\n\n" + reason);
    return false;
  }

  return true;
}

function validateVersion(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = ". You did not enter a version. You can find this, by clicking on Help, then About in the application.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateProductLine(fld) {
    var error = "";
 
    if (fld.value == "Select a Product Line") {
        fld.style.background = 'Yellow'; 
        error = ". You did not select a Product Line.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateProduct(fld) {
    var error = "";
 
    if (fld.value == "Select a Product") {
        fld.style.background = 'Yellow'; 
        error = ". You did not select a Product.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateFirstName(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = ". You did not enter a First Name.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateLastName(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = ". You did not enter a Last Name.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateSubject(fld) {
    var error = "";
 
    if (fld.value == "Select a Subject") {
        fld.style.background = 'Yellow'; 
        error = ". You did not select a Subject.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

function validateDescription(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = ". You did not enter a Description.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}

//this will validate the email field
function trim(s)
{
  return s.replace(/^\s+|\s+$/, '');
}

function validateEmail(fld) {
    var error="";
    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
   
    if (fld.value == "") {
        fld.style.background = 'Yellow';
        error = ". You did not enter an email address.\n";
    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
        fld.style.background = 'Yellow';
        error = ". Please enter a valid email address.\n";
    } else if (fld.value.match(illegalChars)) {
        fld.style.background = 'Yellow';
        error = ". The email address contains invalid characters.\n";
    } else {
        fld.style.background = 'White';
    }
    return error;
}

function validatePhone(fld) {
    var error = "";
    var stripped = fld.value.replace(/[\(\)\.\-\ ]/g, '');    

   if (fld.value == "") {
        error = ". You did not enter a phone number.\n";
        fld.style.background = 'Yellow';
    } else if (isNaN(parseInt(stripped))) {
        error = ". The phone number contains invalid characters.\n";
        fld.style.background = 'Yellow';
    } else if ((stripped.length < 10)) {
        error = ". Your phone number is too short. Make sure to include your area code.\n";
        fld.style.background = 'Yellow';
    } else {
        fld.style.background = 'White';
    }
	return error;
}