	
var username = "Frau Wenk+++";
function ajaxRequest(callback,url,queryParams)
{
		
	//document.getElementById('loader_profile').style.display = 'block';
	
	if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
http=new XMLHttpRequest();
}
else
{// code for IE6, IE5
http=new ActiveXObject("Microsoft.XMLHTTP");
}

http.open("POST", url, true);

//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");	
http.setRequestHeader("Content-length", queryParams.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {//Call a function when the state changes.
	
	if(http.readyState == 4 && http.status == 200) {
		if(callback) callback(http.responseText);
		//document.getElementById('loader_profile').style.display = 'none';
		
		}
}
http.send(queryParams);

}



    function changeWeldTxt(txt,pos)
    {
	document.getElementById('weld_txt').innerHTML = txt;
	document.getElementById('torte').style.backgroundPosition = '-' + pos * 172 + 'px 0';
	
	}
		
		function clearWeldTxt()
    {
	document.getElementById('weld_txt').innerHTML = "Ein Lob f&uuml;r " + username;	
	document.getElementById('torte').style.backgroundPosition = '0 0';
		}

function storeData(gift)
{

	
	ajaxRequest(function(data){
						 
						 changeState("second_wrapper","wrapper_main",gift);
										   },"http://www.gogogadgeto.de/lobometer/store.php","gift=" + gift);
	
	
	}
	
function changeState(on,off, highlight)
{
	
document.getElementById(on).style.display = "block";
document.getElementById(off).style.display = "none";
document.getElementById('scale_img_animated').src = "http://www.gogogadgeto.de/lobometer/css/images/h_scale_animation.gif";
document.getElementById("box_small_" + highlight).style.backgroundImage = "url(css/images/h_box-verlaufen.gif)";

//setTimeout("startAnim()",1000);

}

function startAnim()

{
document.getElementById('scale_img_animated').src = "http://www.gogogadgeto.de/lobometer/css/images/h_scale_animation.gif";
		
	
	}
