/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


function ver_anuncio(lang, idanuncio, marca, id){
  var params = "";
  if (marca!='' && marca!='undefined'){
    params += "&AS_marca0="+marca;
  }
  if (id!=-1){
    params += "&AS_shop="+id;    
  }
  document.location.href = "/fiat_anuncio_detalle.php?lang="+lang+"&idanuncio="+idanuncio+params;
  return false;
}

function ver_home(lang, marca){
  if (marca!='' && marca!='undefined'){
    if (marca=='FIAT PROFESIONAL'){
      document.location.href = "fiat_home.php?lang="+lang+"&AS_marca0=FIAT&sub=PROFESIONAL&AS_carr0=8";
    }
    else{
      document.location.href = "fiat_home.php?lang="+lang+"&AS_marca0="+marca;
    }
  }
  else{
    document.location.href = "fiat_home.php?lang="+lang;
  }
  return false;
}

function ver_promesas(lang, marca){
  if (marca!='' && marca!='undefined'){
    document.location.href = "fiat_promesas.php?lang="+lang+"&AS_marca0="+marca;
  }
  else{
    document.location.href = "fiat_promesas.php?lang="+lang;
  }
  return false;
}

function ver_noticias(lang){
	document.location.href = "fiat_noticias.php?lang="+lang;
}

function ver_micro(lang, id){
  //document.location.href = "fiat_microsite.php?lang="+lang+"&AS_shop="+id;
  window.open("fiat_microsite.php?lang="+lang+"&AS_shop="+id, "_blank");
  return false;
}

function ver_area(){
  window.open("http://www.motorflash.com/fiat/", "_blank");
  return false;
}

function ver_micro_home(lang, id){
  document.location.href = "fiat_microsite.php?lang="+lang+"&AS_shop="+id;
  return false;
}

function ver_micro_noticias(lang, id){
  document.location.href = "fiat_microsite_noticias.php?lang="+lang+"&AS_shop="+id;
  return false;
}

function ver_micro_quienes(lang, id){
  document.location.href = "fiat_microsite_quienes.php?lang="+lang+"&AS_shop="+id;
  return false;
}

function ver_micro_donde(lang, id){
  document.location.href = "fiat_microsite_donde.php?lang="+lang+"&AS_shop="+id;
  return false;
}

function ver_last(lang, marca, id){
  if (marca!='' && marca!='undefined'){
    document.location.href = "fiat_lista_anuncios.php?lang="+lang+"&orden=last"+"&AS_marca0="+marca+"&AS_shop="+id;;
  }
  else{
    document.location.href = "fiat_lista_anuncios.php?lang="+lang+"&orden=last&AS_shop="+id;
  }
  return false;
}

function ver_mapa(lang, marca){
  if (marca!='' && marca!='undefined'){
    document.location.href = "fiat_mapa.php?lang="+lang+"&AS_marca0="+marca;
  }
  else{
    document.location.href = "fiat_mapa.php?lang="+lang;
  }
  return false;
}

function ver_vistos(lang, marca, id){   
  if (marca!='' && marca!='undefined'){    
    document.location.href = "fiat_lista_anuncios.php?lang="+lang+"&orden=mvistos"+"&AS_marca0="+marca+"&AS_shop="+id;
  }
  else{
    document.location.href = "fiat_lista_anuncios.php?lang="+lang+"&orden=mvistos&AS_shop="+id;
  }  
  return false;
}

function ver_impresion(lang, idanuncio){
  document.location.href = "fiat_anuncio_print.php?lang="+lang+"&idanuncio="+idanuncio;
  return false;
}

function ver_resultados(lang){
    //document.location.href = "resultados.php?lang="+lang;
    history.back();
    return false;
}

function ver_fotos(lang, idanuncio){
  window.open("fiat_anuncio_foto.php?lang="+lang+"&idanuncio="+idanuncio, "", "width=850,height=550,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
  return false;
}

function ver_legal(lang){
  window.open("fiat_legal.php?lang="+lang, "", "width=950,height=550,status=no,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
  return false;
}


function ver_marca(marca){
    if (marca=='FIAT'){
        window.open("http://www.fiat.es", "_blank");
    }else if (marca=='FIATPROFESIONAL'){
        window.open("http://www.fiatprofessional.es", "_blank");
    }else if (marca=='LANCIA'){
        window.open("http://www.lancia.es", "_blank");
    }else if (marca=='ALFA ROMEO'){
        window.open("http://www.alfaromeo.es", "_blank");
    }
    return false;
}


function ver_concesion(lang, id){
  document.location.href = "fiat_concesion.php?lang="+lang+"&concesion="+id;
  return false;
}

function seleccionaPest(index, max){
  for (i=0;i<=max;i+=1){
    pest = document.getElementById('pest'+i);
    pest.className = "";    
    datos = document.getElementById('datos'+i);    
    datos.style["display"]="none";
  }
  pestSel = document.getElementById('pest'+index);
  pestSel.className="pestanaseleccionada";
  datosSel = document.getElementById('datos'+index);
  datosSel.style["display"]="block";
  return false;
}

function subfrm(){
  alert("submit");
  //document.getElementById('formulario_buscador').submit();
  alert("fin submit");
  return false;
}

