/** Javascript for enhancing the triumph splash page
   NOTE: the including document must define the following variables:
        BIKE_IMAGE string, url to current bike splash image
        FORM_NAME string, name of country selector form
*/

/* Opera 7 doesn't do transparent flash wmode */
var ua = navigator.userAgent.toLowerCase();
var opera7 = ua.indexOf("opera 7") != -1 ? true:false;

function initCountrySelectorList() {
    if (document.getElementById) {
        var list = document.getElementById("countrySelectorList");
        if (list) {
            /* get all the links in the list 
               and add an onclick function to them
            */
            links = list.getElementsByTagName("a");
            for (var l in links) {
                links[l].onclick = function() {
                    document.forms[FORM_NAME].triumphcountry.value = this.attributes.href.nodeValue;
                    submitForm();
                    return false;
                };
            }
        }
    }
}

function submitForm() {
    document.forms[FORM_NAME].submit();
}

