/*_________________________________________________POP UP*/
	function popUp(pg, w, h, scr, res) 
	{ 
		if (w == "" || h == "")
		{
			w = (screen.width - 250);
			h = (screen.height - 250);
		}

		larg = screen.width;
		alt = screen.height;

		larg = (larg - w)/2;
		alt = (alt - h)/2;

		window.open(pg, 'p', 'scrollbars=yes, resizable='+res+', width='+w+', height='+h+', top='+alt+', left='+larg+', status=no, location=no, toolbar=no');
	}

	
	// Zoom delle FOTO
	function zoomin(img)
	{
		document.getElementById("bigFOTO").innerHTML = '<img src="'+img+'" alt="'+img+'" width="400" />';
	}

function ajaxModel(idmake)
	{
	var idmake;
	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)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
			document.getElementById('model').innerHTML = xmlHttp.responseText;
		  }
		}
	  xmlHttp.open("GET","model.asp?idmake="+idmake,true);
	  xmlHttp.send(null);
	}

// Funzione in homepage Ajax per visualizzazione modelli dopo la selezione della marca
function ajaxModel_index(idmake, marca, tipologia)
	{
	var idmake;
	var xmlHttp;
	var marca;
	var tipologia;
	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)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
			document.getElementById('model').innerHTML = xmlHttp.responseText;
		  }
		}
	  xmlHttp.open("GET","model_index.asp?idmake="+idmake+"&marca="+marca+"&tipologia="+tipologia,true);
	  xmlHttp.send(null);
	}

// Il div delle marche in ricerca cambia a seconda se spunto su nuovo/usato/km0
function changedivmarche(tipologia)
	{
	var tipologia;
	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)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
			document.getElementById('divmarche').innerHTML = xmlHttp.responseText;
		  }
		}
	  xmlHttp.open("GET","divmarche.asp?tipologia="+tipologia,true);
	  xmlHttp.send(null);
	}


function vetrinaview()
	{
	document.getElementById('vetrina').innerHTML = '<img src="/imgg/loading3.gif" />';
	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)
		  {
		  alert("Your browser does not support AJAX!");
		  return false;
		  }
		}
	  }
	  xmlHttp.onreadystatechange=function()
		{
		if(xmlHttp.readyState==4)
		  {
			document.getElementById('vetrina').innerHTML = xmlHttp.responseText;
		  }
		}
	  xmlHttp.open("GET","vertical.asp",true);
	  xmlHttp.send(null);
	}
// auto importazione dalla germania
function checkrichieste()
{
	var nome = document.account.nome.value;
	var email = document.account.email.value;
	
	if (!nome)
	{
		alert('Inserisci nome e cognome per continuare');
		return false;
	}
	if (!email)
	{
		alert('Inserisci il tuo indirizzo email per continuare');
		return false;
	}
}
