var dsg=1;
	
function iqRequest() {
  this.params = new Array();
  this.paramsIndex = 0;
  this.execute = iqRequestExecute;
  this.add = iqRequestAdd;
}

function iqRequestAdd(name,value) {
  this.params[this.paramsIndex]=new iqPair(name,value);
  this.paramsIndex++;
}

function iqRequestExecute(sUrl, sMethod) {
  var xmlhttp;
  var targetURL = sUrl;
  /*@cc_on @*/
  /*@if (@_jscript_version >= 5)
	   try {
	   xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
	  } catch (e) {
	   try {
		 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
	   } catch (E) {
		xmlhttp=false
	   }
	  }
	 @else
	  xmlhttp=false
	 @end @*/

  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
	  try {
		xmlhttp = new XMLHttpRequest();
	  } catch (e) {
	   xmlhttp=false;
	   alert ("Fehler: "+ e);
	   return "Fehler: " + e;
	  }
	 }

  try {
	var i = 1;
	var txt="?";
	for(i in this.params) {
	  txt = txt+'&'+this.params[i].name+'='+this.params[i].value;
	}
	xmlhttp.open(sMethod, targetURL+txt, false, null, null);
	xmlhttp.send('');
  } catch(e) {
	alert ("Fehler: "+ e);
	response = 'Fehler beim Aufruf der externen Seite..: '+e;
  }

  switch(xmlhttp.readyState) {
	  case 1,2,3:
		response = 'Bad Ready State: '+xmlhttp.status;
	  break
	  case 4:
		if(xmlhttp.status !=200) {
		  response = 'Server antwortet mit Statuscode: '+httpRequest.status;
		} else {
		  var response = xmlhttp.responseText;
		}
	  break;
	}
	return escape(response);
}

function iqPair(name,value) {
  this.name = name;
  this.value = value;
}


function eGet(objname) {
	return document.getElementById(objname);
}

function change_value(what, value){
	if( value==1 ) {
		eGet(what+'1').src='http://kruta.de/img/vote/v5_on.jpg';
		eGet(what+'2').src='http://kruta.de/img/vote/v4_on.jpg';
		eGet(what+'3').src='http://kruta.de/img/vote/v3_on.jpg';
		eGet(what+'4').src='http://kruta.de/img/vote/v2_on.jpg';
		dsg=5;
	}
	if( value==2 ) {
		eGet(what+'1').src='http://kruta.de/img/vote/v5_off.jpg';
		eGet(what+'2').src='http://kruta.de/img/vote/v4_on.jpg';
		eGet(what+'3').src='http://kruta.de/img/vote/v3_on.jpg';
		eGet(what+'4').src='http://kruta.de/img/vote/v2_on.jpg';
		dsg=4;
	}
	if( value==3 ) {
		eGet(what+'1').src='http://kruta.de/img/vote/v5_off.jpg';
		eGet(what+'2').src='http://kruta.de/img/vote/v4_off.jpg';
		eGet(what+'3').src='http://kruta.de/img/vote/v3_on.jpg';
		eGet(what+'4').src='http://kruta.de/img/vote/v2_on.jpg';
		dsg=3;
	}
	if( value==4 ) {
		eGet(what+'1').src='http://kruta.de/img/vote/v5_off.jpg';
		eGet(what+'2').src='http://kruta.de/img/vote/v4_off.jpg';
		eGet(what+'3').src='http://kruta.de/img/vote/v3_off.jpg';
		eGet(what+'4').src='http://kruta.de/img/vote/v2_on.jpg';
		dsg=2;
	}
	if( value==5 ) {
		eGet(what+'1').src='http://kruta.de/img/vote/v5_off.jpg';
		eGet(what+'2').src='http://kruta.de/img/vote/v4_off.jpg';
		eGet(what+'3').src='http://kruta.de/img/vote/v3_off.jpg';
		eGet(what+'4').src='http://kruta.de/img/vote/v2_off.jpg';
		dsg=1;
	}
}
