function numPhoto(photo,pag) //nombre de la foto
{
	document.getElementById("auto-foto").innerHTML="<img title='Para hacer esta foto tu background solamente haz clic derecho y elige Set as Background o Establecer como fondo' src="+photo+" >";
}
function writit(text,id)
{
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
	{
		x = document.all[id];
		x.innerHTML = text;
	}
	else if (document.layers)
	{
		x = document.layers[id];
		text2 = '<P CLASS="testclass">' + text + '</P>';
		x.document.open();
		x.document.write(text2);
		x.document.close();
	}
}

function ver(imagen){
vartemp = '<img alt="Para hacer esta foto tu background solamente haz clic derecho y elige \'Set as Background\' o \'Establecer como fondo\'" src="' + imagen + '">'
    writit(vartemp, 'div1');
}


<!-- Begin JS Script -->

<!-- Begin
// Set up the image files to be used.
var theImages = new Array() // do not change this
// To add more image files, continue with the
// pattern below, adding to the array.

theImages[0] = 'images/random1.jpg'
theImages[1] = 'images/random2.jpg'
theImages[2] = 'images/random3.jpg'
theImages[3] = 'images/random4.jpg'
theImages[4] = 'images/random5.jpg'
theImages[5] = 'images/random6.jpg'
theImages[6] = 'images/random7.jpg'
theImages[7] = 'images/random8.jpg'
theImages[8] = 'images/random9.jpg'


// do not edit anything below this line

var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+theImages[whichImage]+'">');
}

//  End -->

function emailCheck (emailStr) {	
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=emailStr.match(emailPat);
	if (matchArray==null) {
	 alert("Tu direccion de email es incorrecta (revisa las @ y .'s)");
	 return false;
	}
	var user=matchArray[1];
	var domain=matchArray[2];
	if (user.match(userPat)==null) {
	 alert("El username no es valido");
	 return false;
	}
	var IPArray=domain.match(ipDomainPat);
	if (IPArray!=null) {
	  for (var i=1;i<=4;i++) {
	  if (IPArray[i]>255) {
	  alert("El IP no es valido");
	  return false;
	  }
	 }
	 return true;
	}
	var domainArray=domain.match(domainPat);
	if (domainArray==null) {
	 alert("El nombre de dominio no es valido.");
	 return false;
	}
	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;
	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>4) {
	  alert("La direccion debe terminar con un dominio de cuatro letras o un pais de dos.");
	 return false;
	}
	if (len<2) {
	 var errStr="Falta el hostname!";
	 alert(errStr);
	 return false;
	}
	var doms= Array("hotmail.com.mx","hotamil.com" ,"hotmai.com","hotmail.com.", "homail.com" ,"hotmil.com" ,"hotmail.com.pe" ,"htomail.com","hotmail.co" ,"hotmial.com" ,"hotmail .com" ,"@." ,"htmail.com","hormail.com" ,"latinamail.com" ,"latinamil.com" ,"hot mail.com","hormail.com" ,"holmail.com" ,"hotmail.com.com" ,".com.com" ,"hotmail.cm",".comm" ,"hotmail." ,"hot");
	var splited=emailStr.split('@');
	var dom=splited[1];
	var test=true;
	for (i=0; i<doms.length; i++)
	{
	  test=(test && !(doms[i]==dom));
	}
	if (!test) 
	{ 
	  alert('Por favor revise que su dominio este bien escrito');
	  return false;
	}
	return true;
}



  function recomanda(){
      
    if (document.reco1.email.value.length < 7 || document.reco1.email.value == 'Tu Email'){
   	  document.reco1.email.focus();
	  alert('Ingresa tu email correctamente');
	  return false;
	}
    if (!emailCheck(document.reco1.email.value))
	{
	    document.reco1.email.focus();
		return false;
	}

    if (document.reco1.email2.value.length < 7 || document.reco1.email2.value == 'Email de Tu Amigo 1'){
   	  document.reco1.email2.focus();
	  alert('Ingresa el email de tu amigo correctamente');
	  return false;
	}
    if (!emailCheck(document.reco1.email2.value))
	{
	    document.reco1.email2.focus();
		return false;
	}	
  }
function leipzig(){
	window.open("internaGaleria.asp","pollwin","toolbar=no,scrollbars=no,directories=no, status=no,menubar=no,resizable=no,width=480,height=550")
} 

function add_bookmark() {    
	var browsName = navigator.appName;     
	if (browsName == "Microsoft Internet Explorer") {     
		window.external.AddFavorite('http://www.aceleracion.com/','Aceleracion.com, autos, marcas de autos, autos deportivos, motos,  formula 1, moto gp y mucho mas.');    
	} else     
		if (browsName == "Netscape") {    
			alert ("\nPara agregar esta pgina a tu BookMark presiona CTRL+D");    
		}   
}

function subscribe(form) {
	var exp_email1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;

  	var exp_email2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/;

  	if (!(!exp_email1.test(form.e_mail.value) && exp_email2.test(form.e_mail.value))) {
		alert(unescape('Por favor, indica un e-mail v%E1lido para suscribirte al bolet%EDn de aceleracion.com.'));
		form.e_mail.focus();
		return false;
  	}
  	window.open('http://boletin.aceleracion.com/validate.php', 'popw', 'toolbar=no,scrollbars=yes,directories=no,status=no,menubar=no,resizable=no,width=430,height=300');
  	return true;
}

function comprobarB(forma)
{
	if ( forma.marca[forma.marca.selectedIndex].value == '' && forma.modelo[forma.modelo.selectedIndex].value == '' && forma.categoria[forma.categoria.selectedIndex].value == '' && forma.keyword.value == ''  )
	{
		alert('Debes ingresar al menos un parámetro de búsqueda');
		return false;
	}
}

function anunciate(){
	window.open("http://www.sugerimos.com/coti.asp","pollwin","toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=583,height=515")
}
  
function privacidad(){
	window.open("politicas_aceleracion.html","pollwin","toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=583,height=515")
}

