var xmlHttp = createXmlHttpRequestObject();

	function verifica_quick(f) {
		if (f.elements.marca.value=="") { alert("Alegeti marca!"); return false; }
		return true;
	}

function createXmlHttpRequestObject() 
{
  var xmlHttp;

  try
  {

    xmlHttp = new XMLHttpRequest();
  }
  catch(e)
  {

    var XmlHttpVersions = new Array("MSXML2.XMLHTTP.6.0",
                                    "MSXML2.XMLHTTP.5.0",
 
                                    "MSXML2.XMLHTTP.4.0",
                                    "MSXML2.XMLHTTP.3.0",
                                    "MSXML2.XMLHTTP",
                                    "Microsoft.XMLHTTP");

    for (var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) 
    {
      try 
      { 

        xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
      } 
      catch (e) {}
    }
  }

  if (!xmlHttp)
    alert("Error creating the XMLHttpRequest object.");
  else 
    return xmlHttp;
}


function show_sectiune(id)
{
	//alert(id);
	
		//var marca = document.getElementById('select_marca').value;
		//alert(marca_concurs);
		marca = "VOLKSWAGEN";
	if (marca>'') {
if ((xmlHttp.readyState == 4) || (xmlHttp.readyState == 0)) {	
  if (xmlHttp)
  {

    try
    {
//alert(marca);
      xmlHttp.open("GET", "http://www.masinaanului.ro/sectiuniFlash.php?scat_id="+id, true);
      xmlHttp.onreadystatechange = handleRequestStateChange1;
      xmlHttp.send(null);
	 
			
		
    }

    catch (e)
    {
      alert("Can't connect to server:\n" + e.toString());
    }
  }

  } else {
	alert('Va rugam asteptati finalizarea cererii anterioare!');  
  }
	}
}


function handleRequestStateChange1() 
{
	

  if (xmlHttp.readyState == 4) 
  {

    if (xmlHttp.status == 200) 
    {
		
		//alert();
      try
      {

        handleServerResponse1();
		
      }
      catch(e)
      {

        alert("Eroare la citirea raspunsului: " + e.toString());
      }
    } 
    else
 
    {

      alert("S-a intampinat o eroare:\n" + 
            xmlHttp.statusText);
    }
  }
}


function handleServerResponse1()
{

	var response = xmlHttp.responseText;
	//alert(response);

	if(response.length == 0) {
		throw(response.length == 0 ? "Server error" : response);
	}
	
	var c = document.getElementById('sectt');

	var j = document.getElementById('nominalizate');

			if(esteIE() || (navigator.appName.indexOf("Opera") + 1))
			{
				 nr = 2 + parseInt(2 * Math.random(), 10);
				// alert(nr);
				
				j.innerHTML = response;
				


				//alert('Pozitia terenului a fost salvata!');					
			}
			else
			{
				j.innerHTML = response;
			}
			
			

} 


	function esteIE()
	{
		var browser = navigator.appName;

		if(browser == "Microsoft Internet Explorer") 
			return true;
			
		return false;		
	}