/**
 * @Copyrigth 2008 MediaThread
 */

function EnchulaCorolla() {
	var WindowObjectReference = window.open("http://eventostoyota.com.ar/postventa/accesorios/corolla/cliente/popup.html","_blank","menubar=no,location=no,resizable=no,scrollbars=false,status=no,dependent=yes,width=800,height=600");
	if (WindowObjectReference==null) { 
	alert("Su navegador ha bloqueado la ventana que intentó abrir.\nPara poder visualizarla modifique la configuracion del mismo de forma acorde.");
	}
	return false;
}

function TresSesenta() {
	var WindowObjectReference = window.open("/360/start.html","_blank","menubar=no,location=no,resizable=no,scrollbars=false,status=no,dependent=yes,width=650,height=488");
	if (WindowObjectReference==null) { 
	alert("Su navegador ha bloqueado la ventana que intentó abrir.\nPara poder visualizarla modifique la configuracion del mismo de forma acorde.");
	}
	return false;
}

// XMLHttpRequest
function reqChange () {
	if(req.readyState==4) {
		if(req.status==200) { 
			if(req.responseText!="") {
				// Success !
//				alert("Form received");
			} else {
				alert("Hubo un problema al tratar de contactar al servidor.\nPor favor intÃ©ntelo nuevamente.");
			}
		} else {
			alert("Hubo un problema al tratar de contactar al servidor.\nPor favor intÃ©ntelo nuevamente.");
		}
	}
};
function getData (aURL) {
	var tJumble = "";
	if (!aURL) return;

	var reqURL = aURL;

	if(window.XMLHttpRequest) {
		req=new XMLHttpRequest();
		req.onreadystatechange=reqChange;
		req.open("GET", reqURL, true);
		req.send(null);
	}else if(window.ActiveXObject) {
		req=new ActiveXObject("Microsoft.XMLHTTP");
		if(req) {
			req.onreadystatechange=reqChange;
			req.open("GET", reqURL, true);
			req.send();
		}
	}
};

function contactenos(aApe, aNom, aTel, aEmail, aEAlt, aChas, aKmts, aConVen, aConSer, aCmnt) {
	var tURL = 'webid=12&name='+aApe+'&firstname='+aNom+'&phone='+aTel+'&email1='+aEmail+'&email2='+aEAlt;
	var tURL = tURL + '&chasis='+aChas+'&kms='+aKmts+'&conce1='+aConVen+'&conce2='+aConSer+'&comment='+aCmnt;
	tURL = 'http://eventostoyota.com.ar/contacto/contactoAjax.php?' + tURL;
	getData(tURL);
};
function testDrive(aNom, aDir, aLoc, aProv, aCP, aDia, aMes, aAno, aEmpresa, aFono, aEmail, aVehi, aConce, aComment, aOptin) {
	var tURL = 'webid=12&name='+aNom+'&dia='+aDia+'&mes='+aMes+'&ano='+aAno+'&company='+aEmpresa;
	var tURL = tURL + '&address='+aDir+'&city='+aLoc+'&postal='+aCP+'&state='+aProv+'&fono='+aFono;
	var tURL = tURL + '&email='+aEmail+'&coche='+aVehi+'&concesionario='+aConce+'&comment='+aComment+'&optin='+aOptin;
	tURL = 'http://eventostoyota.com.ar/webadmin/corolla-teaser/registry.php?' + tURL;
	getData(tURL);
}
function amigo(aNomMio, aEmailMio, aNomAmigo, aEmailAmigo) {
	var tURL = 'name='+aNomMio+'&email='+aEmailMio+'&name2='+aNomAmigo+'&email2='+aEmailAmigo;
	tURL = 'http://eventostoyota.com.ar/webadmin/corolla-teaser/friend.php?' + tURL;
	getData(tURL);
}
function dealerMap() {
	var hndlr = window.open('http://www.eventostoyota.com.ar/mapa/mapa.html','popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=403,height=505,top=150,left=250');
}

