<!-- //Begin

//****************************************************************
//
// Module:          scripts
//
// Description:     Contains the Javascripts for the order form processing
//
// Created by:      L. J. Keashly
//
// Creation Date:   April 27, 2002
//
// Copyright Notice: Copyright © 2002 Biotronics Research Corp., All Rights Reserved
//
// Modifications Date & Description:
//
//****************************************************************

//****************************************************************
//
// Function:     setCurrency
//
// Description:  This function is called when the type of currency 
//               button is pressed.
//
// Parameters:   none
//
// Returns:      
//
// Created by:   L. J. Keashly
//
// Creation Date: April 27, 2002
//
// Modifications Date & Description:
//              October 13, 2004 - changed prices from 220 USD and 349 Cnd to 
//                                 280 USD and 375 Cdn
//
//****************************************************************
function setCurrency(form) {
    if (form.currency[0].checked) {
        form.matrixtotal.value = "375.00";
        form.mtotcurrency.value = "Canadian";
        form.kittotal.value = "50.00";
        form.ktotcurrency.value = "Canadian";
    } else {
        form.matrixtotal.value = "280.00";
        form.mtotcurrency.value = "USD";
        form.kittotal.value = "31.25";
        form.ktotcurrency.value = "USD";
    }
    return true;
}

//****************************************************************
//
// Function:     switchProvinces
//
// Description:  This function is called when the country is changed.
//               It will display a list of valid provinces or states
//               or let the user enter their own for other countries.
//
// Parameters:   form
//
// Returns:      
//
// Created by:   L. J. Keashly
//
// Creation Date: April 27, 2002
//
// Modifications Date & Description:
//
//****************************************************************
function switchProvinces(form) {
    var provArray =  new Array(
    ('AB', 'Alberta'),
    ('BC', 'British Columbia'),
    ('LB', 'Labrador'),
    ('MB', 'Manitoba'),
    ('NB', 'New Brunswick'),
    ('NF', 'Newfoundland'),
    ('NS', 'Nova Scotia'),
    ('NT', 'Northwest Territories'),
    ('PE', 'Prince Edward Island'),
    ('ON', 'Ontario'),
    ('QC', 'Quebec'),
    ('SK', 'Saskatchewan'),
    ('YT', 'Yukon Territory'));

    var stateArray =  new Array(
    ('Alabama'),
    ('Alaska'),
    ('Arizona'),
    ('Arkansas'),
    ('Arkansas'),
    ('California'),
    ('Colorado'),
    ('Connecticut'),
    ('Delaware'),
    ('Columbia'),
    ('Florida'),
    ('Georgia'),
    ('Hawaii'),
    ('Idaho'),
    ('Illinois'),
    ('Indiana'),
    ('Iowa'),
    ('Kansas'),
    ('Kentucky'),
    ('Louisiana'),
    ('Maine'),
    ('Maryland'),
    ('Massachusetts'),
    ('Michigan'),
    ('Minnesota'),
    ('Mississippi'),
    ('Missouri'),
    ('Montana'),
    ('Nebraska'),
    ('Nevada'),
    ('New Hampshire'),
    ('New Jersey'),
    ('New Mexico'),
    ('New York'),
    ('North Carolina'),
    ('North Dakota'),
    ('Ohio'),
    ('Oklahoma'),
    ('Oregon'),
    ('Pennsylvania'),
    ('Rhode Island'),
    ('South Carolina'),
    ('South Dakota'),
    ('Tennessee'),
    ('Texas'),
    ('Utah'),
    ('Vermont'),
    ('Virginia'),
    ('Washington'),
    ('West Virginia'),
    ('Wisconsin'),
    ('Wyoming'));

    // Empty existing province/state items
    var length = form.province.options.length;
    for (i=0; i<length; i++) {
        form.province.options[0] = null;
    }

    if (form.country.options[form.country.selectedIndex].value == "US") {
        for (var i=0; i < stateArray.length; i++) {
            form.province.options[i] = new Option(stateArray[i]);

        }
    } else if (form.country.options[form.country.selectedIndex].value == "CA") {
        for (var i=0; i < provArray.length; i++) {
            form.province.options[i]= new Option(provArray[i]);
        }
    } else {
        var newprov = "";
        // Country other than Canada or US so have user enter province-state
        while (newprov == "") {
            newprov = prompt("Please enter your state or province.", "");
        }
        if (newprov != null) {
            form.province.options[0] = new Option(newprov);
        }
    }
    form.province.options[0].selected=true;
    if ( navigator.appName == 'Netscape') {
        if (parseInt(navigator.appVersion) < 4) {
            window.history.go(0);
        } else {   	
            if (navigator.platform == 'Win32' || navigator.platform == 'Win16') {
                window.history.go(0);
            }
        }
    }
}

// End -->