    function give_rep(id) {
            // Set up the request
            var xmlhttp =  createRequestObject();
            
            xmlhttp.open('POST', 'give_rep.php', true);
            // The callback function
            xmlhttp.onreadystatechange = function() {
                if (xmlhttp.readyState == 4) {
                    if (xmlhttp.status == 200) {
						//alert(xmlhttp.responseText)
                        var stat = xmlhttp.responseXML.getElementsByTagName('success')[0].firstChild.data;
                        var changed = xmlhttp.responseXML.getElementsByTagName('changed')[0].firstChild.data;
						var hearts = xmlhttp.responseXML.getElementsByTagName('hearts')[0].firstChild.data;
						var user = xmlhttp.responseXML.getElementsByTagName('user')[0].firstChild.data;
						if (changed == 1)
						{
                        	document.img_rep.src = 'profile/rep_' + hearts + '.gif';
						}
						window_msg(stat, user);
                    }
                }
            }
            
            // Send the POST request
            xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
            xmlhttp.send('to_user=' + id);
        
    }

	function window_msg(stat, user)
	{
		var win = window.open("reputation_popup.html?stat="+stat+"&user="+user,"rep","toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=380,left = 380,top = 312");
	}
