
function toColor (id,col) {
	var obj = document.getElementById(id);
	if ( obj ) {
		obj.style.background = col;
	}
}

function show (id,uri) {
	var obj = document.getElementById(id);
	if ( obj ) {
		if ( obj.style.visibility == "visible" ) {
			obj.style.visibility = "hidden";
			obj.style.display = "none";
		} else {
			obj.style.visibility = "visible";
			obj.style.display = "block";
		}
	}
	var s = id.substr(3);
	obj = document.getElementById("sp"+s);
	
	if ( obj ) {
	    obj.innerHTML = "<iframe src=\"http://www.facebook.com/widgets/like.php?href="+uri+"\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; width:400px; height:40px\"></iframe>";
	}
}

function ajax(params) {
//    alert(params);
	var xmlHttp;
	try {
  		// Firefox, Opera 8.0+, Safari
  		xmlHttp=new XMLHttpRequest();
  	} catch (e) {
  		// Internet Explorer
  		try {
    		xmlHttp=new ActiveXObject('Msxml2.XMLHTTP');
		} catch (e) {
			try {
				xmlHttp=new ActiveXObject('Microsoft.XMLHTTP');
			} catch (e)	{
      			return false;
      		}
    	}
  	}
  	xmlHttp.onreadystatechange=function() {
    	if(xmlHttp.readyState==4) { 
    		var valasz = xmlHttp.responseText; // id=innerhtml
    		var idx = valasz.substring(0,valasz.indexOf("="));
    		var rpt = valasz.substring(valasz.indexOf("=")+1);
    		var obj = document.getElementById(idx);
    		if ( obj ) {
			obj.innerHTML=rpt;
		}
    		var obj2 = document.getElementById("negyzet"+idx.substring(5));
    		if ( obj2 ) {
			obj2.innerHTML="<img src='negyzet_tele.gif' border='0' />";
		}
    	}
    }
  	xmlHttp.open('GET',params,true);
  	xmlHttp.send(null);
}

var width = '900'; 
var height = '450';
var popu = 'scrollbars=yes, resizable=yes, toolbar=yes,' + 'menubar=yes, status=yes, location=yes, left=85, top=20, height=' + height + ',width=' + width;

function onKlikk(id,uri,c) {
	ajax("ajax.php?id="+id+"&c="+c);
	var win2 = window.open(uri, "bw", popu);
	//win2.blur();
	//window.focus();
}

var vltmr = 0;

function onckereses() {
	if ( vltmr == 0 ) {
		vltmr = 1;
		var o = document.getElementById('ikeres');
		if ( o ) {
			o.style.color = '#000000';
			o.value = '';
		}
	}
}

