1 window.onload=function(){
2 var sts = document.getElementById("sts");
3 if(sts != null){
4 sts.onblur=function(){getSelectInfo(this); }; }
5
6 var eur = document.getElementById("euro");
7 if(eur != null){
8 eur.onclick=function(){generateList(this); };}
9 var southa = document.getElementById("southam");
10 if(southa != null){
11 southa.onclick=function(){generateList(this); };}
12 }
13
14 function generateList(obj){
15 if (obj == null ) { return; }
16 if(obj.checked) {
17 formObj=obj;
18 formObjTyp =formObj.tagName.toLowerCase();
19 var url = "http://www.parkerriver.com/s/selectl?countryType="+
20 encodeURIComponent(obj.value);
21 alert(url);
22 //httpRequest("GET",url,true);
23 }
24 }
25
26 function getSelectInfo(selectObj){
27 if (selectObj == null) { return; }
28 formObj=selectObj;
29 formObjTyp =formObj.tagName.toLowerCase();
30 var optsArray = formObj.options;
31 var selectedArray = new Array();
32 var val = "";
33 for(var i=0,j=0; i < optsArray.length; i++){
34 if(optsArray[i].selected) {
35 selectedArray[j]=optsArray[i].value;
36 j++;
37 }
38
39 }
40 for(var k = 0; k < selectedArray.length; k++){
41 if(k !=selectedArray.length-1 ) { val +=selectedArray[k]+",";}
42 else {val +=selectedArray[k]; }
43 }
44 var url = "http://www.parkerriver.com/s/webforms?objtype="+
45 encodeURIComponent(formObjTyp)+"&val="+ encodeURIComponent(val);
46 alert(url);
47 //httpRequest("GET",url,true);
48 }