function toggle(file) {

	ajax_keres(file, "lightglow.php", "lightbox");

	if(file != 'NULL') {

			document.getElementById('lightbox').style.display = "";

	} else {
	
			document.getElementById('lightbox').style.display = "none";
	
	}

}

function new_rcat() {

	var title = prompt("Kategória neve?");
	
	window.location.href = "process.php?new_rcat=" + title;
	
}

function del_rcat(id) {

	if(confirm("Biztosan törlöd?")) {
	
		window.location.href = "process.php?del_rcat=" + id;
		
	}
	
}

function del_rpic(id) {

	if(confirm("Biztosan törlöd?")) {
	
		window.location.href = "process.php?del_rpic=" + id;
		
	}
	
}

function ajax_keres(adat, szerverfile, cel_elem) {

	var xmlHttp=null;

	if (window.XMLHttpRequest) {

		xmlHttp=new XMLHttpRequest();

	} else if (window.ActiveXObject) {

		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

	}

  	xmlHttp.onreadystatechange=function() {

		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 

			document.getElementById(cel_elem).innerHTML=xmlHttp.responseText;

		} 

	}

	xmlHttp.open("POST", szerverfile, true);

	if(adat != 'NULL') {

		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send("adat="+adat);

	} else {

		xmlHttp.send(null);

	}

}
