function merken(stellenid,firmenid) {
	request_merken();

	if (!http) {
		alert('Cannot create XMLHTTP instance');
		return false;
	}
	//document.getElementById('category').value = bereich;
	
	var poststr = 'stellenid=' + stellenid + '&firmenid=' + firmenid;
		
	http.onreadystatechange = update_merken;
	http.open('POST', window.location.protocol + '//' + window.location.host + '/home/praktikanten/stelle_merken.phtml', true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", poststr.length);
	http.setRequestHeader("Connection", "close");
	http.send(poststr);
}

function request_merken() {
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
		http = new XMLHttpRequest();
		if (http.overrideMimeType) {
			// set type accordingly to anticipated content type
			//http.overrideMimeType('text/xml');
			http.overrideMimeType('text/html');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) { }
		}
	}
	if (!http) {
		alert('Cannot create XMLHTTP instance');
		return false;
	}
}

function update_merken() {
	if (http.readyState == 4) {
		if (http.status == 200) {
			if (http.responseText == 'true') {
				document.getElementById('stelleMerken').parentNode.className = "middle_first loggedin gemerkt";
				document.getElementById('stelleMerken').innerHTML = '<span style="color: #fff !important;">Stelle gemerkt</span>';
				document.getElementById('infoText').style.display = 'block';
			} else {
				document.getElementById('stelleMerken').innerHTML = '<span style="color: #f00 !important;">Stelle nicht gemerkt</span>';
			}
		} else {
			alert(http.status);
			alert('There was a problem with the request.');
		}
	}
}

function error_handle() {
	document.getElementById('stelleMerken').parentNode.className = "middle_first loggedout nichtgemerkt";
	document.getElementById('errorText').style.display = 'block';
	scroll(0,0);
}
