
var xmlHttp

function showSpec(elem,type, id){
    xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
	  {
		document.forms['formular'].chng.value = 1;
		document.forms['formular'].submit();
		return;
	  }
	var url="/get.php";
	url=url+"?q="+document.getElementById(elem).value;
	url=url+"&type="+type;
	url=url+"&elem="+id;
    xmlhttp.onreadystatechange= function() { 
        if (xmlhttp.readyState==4){
			DetailChanged(id);
		
			eval(xmlhttp.responseText);	
 		}
    }

    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
		
}


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;
}

	function DetailChanged(elem)
	{	
		var o = document.getElementById(elem);
			
		while(o.length>0){
			o.remove(o.length-1);
		}
		o.disabled = false;
				
	}


function AddToDetail(id, name, elem)	{
		SelectAddOption(document.getElementById(elem), name, id);
}



function SelectAddOption(o, text, value)
	{
		var opt = document.createElement("OPTION");
		o.options.add(opt);
		opt.innerHTML = text;
		opt.value = value;		
		return opt;
	}	 	
