var gbVote = new Class({    Implements: Options,       options: {   selectEl  : ['country', 'group'],   incFile   : '',   imgId   : ['voteimg', 'effizienzimg'],   imgstr   : ['vote', 'effizienz'],   txtId   : 'votetxt'  },    initialize: function(options){   this.setOptions(options);   this.checkInput();  },    checkInput: function(){   this.bound = {};   for (i=0; i<this.options.selectEl.length; i++){    el = this.options.selectEl[i];    this.bound.byChange = this.byChange.bindWithEvent(this,i);    $(el).addEvent('change', this.bound.byChange);   }  },    byChange: function (event,i){   el = $(event.target);   this.requestAjax();  },    getValue: function (){   tophpstr = '&incfile='+this.options.incFile;   for (i=0; i<this.options.selectEl.length; i++){    el = this.options.selectEl[i];    tophpstr += '&selel[]='+$(el).value;   }   return tophpstr;  },    setValue: function (str){   voteAr = str.split ('|');   for (i=0; i<this.options.imgId.length; i++){    $(this.options.imgId[i]).src = 'img/'+this.options.imgstr[i]+voteAr[0]+'.gif';    $(this.options.imgId[i]).alt = voteAr[1]+' | '+voteAr[2]+' | '+voteAr[4];    $(this.options.imgId[i]).title = voteAr[1]+' | '+voteAr[2]+' | '+voteAr[4];   }   if (voteAr[3] != ''){    $(this.options.txtId).innerHTML = '<div class="list"><div class="listimg"><img src="img/pfeil_ani.gif" /></div><div class="listcontent">'+voteAr[3]+'</div></div>';   }else {    $(this.options.txtId).innerHTML = voteAr[3];   }  },    requestAjax: function(){   for (i=0; i<this.options.selectEl.length; i++){    el = this.options.selectEl[i];    if ($(el).value == ''){     this.setValue('0||||0');     return;    }   }      tophpstr = this.getValue();   var myRequest = new Request({    method: 'post',    url: 'inc/ajax_request.php',    onSuccess: function (txt,xml){     gbvote.setValue(txt);    },    onFailure: function (msg){     alert ('fehler: '+msg);    }   });   myRequest.send(tophpstr);  }   }); gbVote.implement(new Options);
