var xmlHttp;

function aktowka(oid, action) {

	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}

	var url="./ajax/aktowka.php";
	url=url+"?oid="+oid+"&action="+action;
	//xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,false);
	xmlHttp.send(null);
    
    if (action !='add'){
    //history.go(0);
    
    //window.location.reload();
    }
}

function stateChanged() {
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		var split = xmlHttp.responseText.split(",");
		var list = "";

		if(split[0] != "") {
			for(var i = 0; i < split.length; i++) {
				list+="<a href=\"#\" style=\"color:#999;\" onclick=\"javascript: correct('"+split[i]+"');\">"+split[i]+"</a>";
			}
		}

		document.getElementById("suggestions").innerHTML=list;
		document.getElementById("suggestions").style.display = 'block';
	}
}


function GetXmlHttpObject() {
	var xmlHttp=null;
	try{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}catch (e){
	// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}catch (e){
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}