var ukcountries=new Object(); ukcountries["United Kingdom"]="United Kingdom"; var eurocountries = new Object(); eurocountries["SHOW_ALL"]="SHOW ALL COUNTRIES"; eurocountries["Austria"]="Austria"; eurocountries["Belgium"]="Belgium"; eurocountries["Bulgaria"]="Bulgaria"; eurocountries["Czech Republic"]="Czech Republic"; eurocountries["Denmark"]="Denmark"; eurocountries["Egypt"]="Egypt"; eurocountries["Finland"]="Finland"; eurocountries["France"]="France"; eurocountries["Germany"]="Germany"; eurocountries["Greece"]="Greece"; eurocountries["Hungary"]="Hungary"; eurocountries["Israel"]="Israel"; eurocountries["Italy"]="Italy"; eurocountries["Morocco"]="Morocco"; eurocountries["Netherlands"]="Netherlands"; eurocountries["Northern Ireland"]="Northern Ireland"; eurocountries["Norway"]="Norway"; eurocountries["Poland"]="Poland"; eurocountries["Portugal"]="Portugal"; eurocountries["Republic of Ireland"]="Republic of Ireland"; eurocountries["Romania"]="Romania"; eurocountries["Russian Federation"]="Russian Federation"; eurocountries["Saudi Arabia"]="Saudi Arabia"; eurocountries["Slovakia"]="Slovakia"; eurocountries["South Africa"]="South Africa"; eurocountries["Spain"]="Spain"; eurocountries["Sweden"]="Sweden"; eurocountries["Switzerland"]="Switzerland"; eurocountries["Turkey"]="Turkey"; eurocountries["United Arab Emirates"]="United Arab Emirates"; eurocountries["United Kingdom"]="United Kingdom"; eurocountries["United States"]="United States"; var requestcountry=""; function ETACountryCombo(cs,def,force) { var countries= new Object(); var index=0; var validcountry=false; var set=false; //validate that the requestcountry is a valid one for (var i in allcountries) { if (allcountries[i]==def) { requestcountry=def; } } alert(cs.value); if ( (force=="SHOW_AUTO") && (requestcountry =="United States")) requestcountry=""; if ((force=="SHOW_AUTO") && (requestcountry !="") ) { cs.options.length=0; cs.options[0] = new Option("--Select Country--","",false,false); cs.options[cs.options.length]=new Option(requestcountry,requestcountry,false); countries["SHOW_EURO"]="SHOW OTHER COUNTRIES"; } else if (cs.value=="SHOW_EURO" || (cs.options.length==0) ||(force=="SHOW_EURO") || (force=="SHOW_AUTO")) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option("--Select Country--","",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true); } countries=eurocountries; countries["SHOW_ALL"]="SHOW ALL COUNTRIES"; } else if ( (cs.value=="SHOW_ALL") ||(force=="SHOW_ALL") ) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option("--Select Country--","",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=allcountries; countries["SHOW_EURO"]="SHOW EURO COUNTRIES ONLY"; } else if ( (cs.value=="SHOW_UK") ||(force=="SHOW_UK") ) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option("--Select Country--","",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=ukcountries; countries["SHOW_EURO"]="SHOW EURO COUNTRIES ONLY"; countries["SHOW_ALL"]="SHOW ALL COUNTRIES"; } else if ( (cs.value=="SHOW_CHINADAY") ||(force=="SHOW_CHINADAY") ) { cs.options.length=0; if (requestcountry=="") {cs.options[0] = new Option("--Select Country--","",false,false);} else { cs.options[cs.options.length]=new Option(requestcountry,requestcountry,true,true);} countries=chinadaycountries; } for (var i in countries) { cs.options[cs.options.length]=new Option(countries[i],i,false,false); } }