function statechange(szam, e)
{
 	if(xmlhttp_tomb[szam].readyState == 4)
	{
		
		var hc;
		hc = xmlhttp_obj_tomb[szam].id.substr(xmlhttp_obj_tomb[szam].id.length-8);
		
		var txt = xmlhttp_tomb[szam].responseText;
		//txt = txt.replace(new RegExp('<hashcode />', 'g'), hc);
		xmlhttp_obj_tomb[szam].innerHTML = txt;
		//xmlhttp_obj_tomb[szam].style.opacity = '0.5';
		init_ablakok();
		gmaps_listafrissites(hc);
		if(xmlhttp_obj_tomb[szam].id.substr(0, 14) == 'divablak_torzs')
		{
			divablak_kozepre();
		}
		
		loadscript(xmlhttp_src_tomb[szam]);
		
		//loadstyle(xmlhttp_src_tomb[szam]);
		
		
		if(xmlhttp_src_tomb[szam] == 'modositoablak.php')
		{
			//alert();
		}
		//alert(xmlhttp_src_tomb[szam]);
		toltesablak();
		//ablaksuti();
		
		if(G_('reklamhely_'+hc) != null)
		{
			G_('reklamhely_'+hc).innerHTML = G_('reklamtarolo').innerHTML;
		}
		
		xmlhttp_varolistaellenorzes();
		
		if(typeof xmlhttp_callback_tomb[szam] == 'function')
		{
			(xmlhttp_callback_tomb[szam])();
		}
		
		if(xmlhttp_tomb[szam].status == 200) // status: OK
		{
			xmlhttp_leker_folyamatban[szam] = 0;
			xmlhttp_nyit_folyamatban[szam] = 0;
		}
		else
		{
			//alert('#'+xmlhttp_leker_folyamatban[szam]+'\n#'+xmlhttp_nyit_folyamatban[szam])
			if(xmlhttp_leker_folyamatban[szam] != 0)
			{
				xmlhttp_leker_varolista.push(xmlhttp_leker_folyamatban[szam]);
				xmlhttp_leker_folyamatban[szam] = 0;
				//setTimeout(function(){xmlhttp_varolistaellenorzes();}, 6000);
			}
			
			if(xmlhttp_nyit_folyamatban[szam] != 0)
			{
				xmlhttp_nyit_varolista.push(xmlhttp_nyit_folyamatban[szam]);
				xmlhttp_nyit_folyamatban[szam] = 0;
				//setTimeout(function(){xmlhttp_varolistaellenorzes();}, 6000);
				
			}
		}
		
		
		
		UnTip();//ha valaki tip()-es linkre kattint, akkor nem játszódik le az onmouseout, igy a tippablak nyitva marad. ezt itt bezárjuk.
		
		if(xmlhttp_obj_tomb[szam].id == 'keresosav')//ennek fekete a hattere, nem all jol neki az attunes
		{
			xmlhttp_obj_tomb[szam].style.opacity = '1';
		}
		else
		{
			attuno_sotetites(xmlhttp_obj_tomb[szam], 0.1);
		}
		
		hrefremove();//az ujonnan betoltodo html resz linkjeinek tisztitasa.
	}
}

function attuno_sotetites(obj, i)
{
	obj.style.opacity = ''+i;
	
	if(i <= 1)
	{
		setTimeout(function(){attuno_sotetites(obj, i-(-0.1));}, 40);
	}
	else
	{
		obj.style.opacity = '1';
	}
}




function statechange0(e)
{
	statechange(0, e);
}
function statechange1(e)
{
	statechange(1, e);
}
function statechange2(e)
{
	statechange(2, e);
}
function statechange3(e)
{
	statechange(3, e);
}
function statechange4(e)
{
	statechange(4, e);
}
function statechange5(e)
{
	statechange(5, e);
}
function statechange6(e)
{
	statechange(6, e);
}
function statechange7(e)
{
	statechange(7, e);
}
function statechange8(e)
{
	statechange(8, e);
}
function statechange9(e)
{
	statechange(9, e);
}
	
