
function showHide(dropDownID) {
var dropDown = document.getElementById(dropDownID);
var value = dropDown.options[dropDown.selectedIndex].value;
for(var i=0; i < dropDown.options.length; i++) {
document.getElementById(dropDown.options[i].value).style.display = "none";
}
document.getElementById(value).style.display = "";
selectImages(value);
}
function showHideValue(dropDownID, value) {
var dropDown = document.getElementById(dropDownID);
for(var i=0; i < dropDown.options.length; i++) {
if(dropDown.options[i].value == value) {
dropDown.selectedIndex = i;
showHide(dropDownID);
break;
}
}
}
function selectImages(value) {
editClass('remove', document.getElementById("afr").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("sasia").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("eur").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("fea").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("lac").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("me").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("naf").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("nam").getElementsByTagName('a')[0], 'selected', '');
editClass('remove', document.getElementById("uki").getElementsByTagName('a')[0], 'selected', '');
switch (value) {
case "AfricaandIndianOcean":
editClass('add', document.getElementById("afr").getElementsByTagName('a')[0], 'selected', '');
break;
case "NorthAfrica":
editClass('add', document.getElementById("naf").getElementsByTagName('a')[0], 'selected', '');
break;
case "Europe":
editClass('add', document.getElementById("eur").getElementsByTagName('a')[0], 'selected', '');
break;
case "MiddleEast":
editClass('add', document.getElementById("me").getElementsByTagName('a')[0], 'selected', '');
break;
case "CentralAsia":
editClass('add', document.getElementById("sasia").getElementsByTagName('a')[0], 'selected', '');
break;
case "FarEastandAustralia":
editClass('add', document.getElementById("fea").getElementsByTagName('a')[0], 'selected', '');
break;
case "LatinAmericaandCaribbean":
editClass('add', document.getElementById("lac").getElementsByTagName('a')[0], 'selected', '');
break;
case "USAandCanada":
editClass('add', document.getElementById("nam").getElementsByTagName('a')[0], 'selected', '');
break;
case "UKandIreland":
editClass('add', document.getElementById("uki").getElementsByTagName('a')[0], 'selected', '');
break;
}
}
function editClass(action, object, class1, class2) {
switch (action) {
case 'swap':
object.className = !editClass('check', object, class1) ? object.className.replace(class2, class1): object.className.replace(class1, class2);
break;
case 'add':
if (!editClass('check', object, class1)) {object.className += object.className ? ' ' + class1 : class1; }
break;
case 'remove':
var rep = object.className.match(' '+class1) ? ' ' + class1 : class1;
object.className = object.className.replace(rep, '');
break;
case 'check':
return new RegExp('\\b'+class1+'\\b').test(object.className);
break;
}
}
function functionalPageLoad() {
if(nav_form.pageid.value == "ECSERVICEFEESTBL") {
switch (nav_form.country.value) {
case "gb":
case "ie":
showHideValue("regionDropDown", "UKandIreland");
break;
case "bd":
case "in":
case "pk":
showHideValue("regionDropDown", "CentralAsia");
break;
case "au":
case "cn":
case "hk":
case "id":
case "jp":
case "my":
case "nz":
case "sg":
case "th":
case "vn":
showHideValue("regionDropDown", "FarEastandAustralia");
break;
case "ae":
case "bh":
case "jo":
case "kr":
case "kw":
case "om":
case "qa":
showHideValue("regionDropDown", "MiddleEast");
break;
case "ag":
case "ar":
case "bb":
case "bm":
case "bo":
case "br":
case "bs":
case "cl":
case "co":
case "cr":
case "cu":
case "do":
case "ec":
case "gt":
case "hn":
case "jm":
case "ky":
case "lc":
case "mx":
case "ni":
case "pa":
case "pe":
case "pr":
case "py":
case "sv":
case "tc":
case "tt":
case "uy":
case "ve":
showHideValue("regionDropDown", "LatinAmericaandCaribbean");
break;
case "ca":
case "us":
showHideValue("regionDropDown", "NorthAmerica");
break;
case "al":
case "eg":
case "ly":
showHideValue("regionDropDown", "NorthAfrica");
break;
case "ao":
case "gh":
case "ke":
case "ng":
case "tz":
case "ug":
case "za":
case "zm":
case "zw":
showHideValue("regionDropDown", "AfricaandIndianOcean");
break;
case "at":
case "ba":
case "be":
case "bg":
case "ch":
case "cy":
case "cz":
case "de":
case "dk":
case "dz":
case "ee":
case "es":
case "fi":
case "fr":
case "gi":
case "gr":
case "hr":
case "hu":
case "il":
case "it":
case "lt":
case "lu":
case "lv":
case "mk":
case "mt":
case "nl":
case "no":
case "pl":
case "pt":
case "ro":
case "ru":
case "se":
case "si":
case "sk":
case "tr":
case "ua":
case "yu":
default:
showHideValue("regionDropDown", "Europe");
break;
}
}
}