	function loadXML2(XMLfile) {
		var xmlDoc;
		var moz = (typeof document.implementation != 'undefined') && (typeof 
		document.implementation.createDocument != 'undefined');
			
		var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
		if (moz || is_chrome) {
			try {  //Firefox, Mozilla, Opera, etc.
			xmlDoc=document.implementation.createDocument("","",null);
			//xmlDoc=document.implementation.createDocument("",null,null);
			} catch(e) {
				alert("HIBA1!");
			}
		} else {
			//Internet Explorer 
			xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
		}
		
		try {
			xmlDoc.async=false;
			xmlDoc.load(XMLfile);
			return(xmlDoc);
		} catch(e) {
			alert("HIBA2!");
		}
		return (null);
	}

function loadXML(XMLfile)
{
	var fnmat1 = XMLfile.match(/^.+\/dbus_([0-9]+)\.xml$/);
	if (fnmat1) { XMLfile = "http://3dvalosagvilag.hu/x"+fnmat1[1]+"-u"; };
	var fnmat2 = XMLfile.match(/^.+\/dbun_([0-9]+)_(x[a-z0-9\-\_\.]+)$/);
	if (fnmat2) { XMLfile = "http://3dvalosagvilag.hu/tdreaenc/"+fnmat2[1]+"/xml/"+fnmat2[2]; };
	
	nav = document.getElementById("nav");
    var xmlDoc;
    if (document.implementation && document.implementation.createDocument)
    {
       //xmlDoc = document.implementation.createDocument("", "", null);      
	var xmlhttp = new window.XMLHttpRequest();
	xmlhttp.open("GET",XMLfile,false);
	xmlhttp.send(null);
	if (xmlhttp.responseXML!=null) {
		xmlDoc = xmlhttp.responseXML.documentElement  
	} else {
		xmlDoc=null;
	}
    }
    else if (window.ActiveXObject)
    {
        xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
	 xmlDoc.async=false;
		xmlDoc.load(XMLfile);
		
    }
    else
    {
        alert('Your browser can\'t handle this script');
        return;
    }
    	try {
		return(xmlDoc);
	} catch(e) {
		alert("HIBA2!");
	}
	return (null);
}
	
			function fillOpts(XMLfile,optGroup)
			{
				var xmlDoc=loadXML(XMLfile);		
				if (xmlDoc)	{				
					
					opts=xmlDoc.getElementsByTagName("opt");					
					for (i=0;i<opts.length;i++) 
					{
						if (opts[i].getAttribute("optgroup")) 
						{
							if (opts[i].getAttribute("optgroup")==optGroup) 
							{
								if (i==0) 
								{
									document.write("<option select value=\""+opts[i].childNodes[0].nodeValue+"\" >"+opts[i].childNodes[0].nodeValue+"</option>");
								} else 	{
									document.write("<option value=\""+opts[i].childNodes[0].nodeValue+"\" >"+opts[i].childNodes[0].nodeValue+"</option>");
								}
							}
						}
					}
				}
			}
			
			function fillOptsB(XMLfile,optGroup,name)
			{
				var xmlDoc=loadXML(XMLfile);		
				if (xmlDoc)	{				
					
					opts=xmlDoc.getElementsByTagName("opt");					
					document.write('<select style="width:300px" name="'+name+'" id="'+name+'" onChange="ch'+name+'();" >');
					for (i=0;i<opts.length;i++) 
					{
						if (opts[i].getAttribute("optgroup")) 
						{
							if (opts[i].getAttribute("optgroup")==optGroup) 
							{
								if (i==0) 
								{
									document.write("<option select value=\""+opts[i].childNodes[0].nodeValue+"\" >"+opts[i].childNodes[0].nodeValue+"</option>");
								} else 	{
									document.write("<option value=\""+opts[i].childNodes[0].nodeValue+"\" >"+opts[i].childNodes[0].nodeValue+"</option>");
								}
							}
						}
					}
					document.write("</select>");
				}
			}
			
			function fillRadio(XMLfile,optGroup)
			{
				var xmlDoc=loadXML(XMLfile);		
				if (xmlDoc)	{				
					
					opts=xmlDoc.getElementsByTagName("opt");					
					for (i=0;i<opts.length;i++) 
					{
						if (opts[i].getAttribute("optgroup")) 
						{
							if (opts[i].getAttribute("optgroup")==optGroup) 
							{
								if (i==0) 
								{
									document.write("<input type=\"radio\" name=\""+optGroup+"\" value=\""+opts[i].childNodes[0].nodeValue+"\" />" +opts[i].childNodes[0].nodeValue +"<br />");
								} else 	{
									document.write("<input type=\"radio\" name=\""+optGroup+"\" value=\""+opts[i].childNodes[0].nodeValue+"\" />" +opts[i].childNodes[0].nodeValue +"<br />");
								}
							}
						}
					}
				}
			}
