function objetoAjax(){
  var xmlhttp=false;

  try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
  try {
  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

  } catch (E) {
  xmlhttp = false;
  }
  }
  if (!xmlhttp && typeof XMLHttpRequest!='undefined') {

  xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
}
function funcionopcion(a,b,c){
divFormulario = document.getElementById('mainContent');
ajax=objetoAjax();
if(b==0)
{
	ajax.open("POST", "operaciones.php");
}
else
{
	ajax.open("POST", "operacionesc.php");
}
ajax.onreadystatechange=function() 
{ if (ajax.readyState==4) {            
divFormulario.innerHTML = ajax.responseText            
}    
}        
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");       
ajax.send("va="+a+"&vb="+b+"&vc="+c)
}
function contactenos(){
fnom=document.contactenos.tnombre.value;
fmail=document.contactenos.tmail.value;
ftel=document.contactenos.ttelefono.value;
fciu=document.contactenos.tciudad.value;
fasu=document.contactenos.tasunto.value;
fmen=document.contactenos.tmensaje.value;
fver=document.contactenos.tverifica.value;
fcod=document.contactenos.codigo.value;
a=11;
divFormulario = document.getElementById('mainContent');
ajax=objetoAjax();
ajax.open("POST", "operaciones.php");
ajax.onreadystatechange=function() 
{ if (ajax.readyState==4) {            
divFormulario.innerHTML = ajax.responseText            
}    
}        
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");       
ajax.send("vnom="+fnom+"&vmail="+fmail+"&vtel="+ftel+"&vciu="+fciu+"&vasu="+fasu+"&vmen="+fmen+"&vver="+fver+"&va="+a+"&vcod="+fcod)
}
function verifica(){
fver=document.verificacion.treverifica.value;
fcod=document.verificacion.recodigo.value;
fmen=document.verificacion.tmensaje.value;
fasu=document.verificacion.tasunto.value;
divFormulario = document.getElementById('validacion');
ajax=objetoAjax();
ajax.open("POST", "verificacontactenos.php");
ajax.onreadystatechange=function() 
{ if (ajax.readyState==4) {            
xDisplay('validacion', 'none');
xDisplay('validacion', 'block');
divFormulario.innerHTML = ajax.responseText            
}    
}        
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");       
ajax.send("vver="+fver+"&vcod="+fcod+"&vmen="+fmen+"&vasu="+fasu)
}
function consultarplaca(){
fplaca=document.consultaplaca.tplaca.value;
divFormulario = document.getElementById('consultaplaca1');
ajax=objetoAjax();
ajax.open("POST", "consultaplaca.php");
ajax.onreadystatechange=function() 
{ if (ajax.readyState==4) {            
xDisplay('consultaplaca1', 'none');
xDisplay('consultaplaca1', 'block');
divFormulario.innerHTML = ajax.responseText            
}    
}        
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");       
ajax.send("vplaca="+fplaca)
}
function validaforma(Form){
/* if(checkField (Form.tnombre,isAlphabetic, false)&& 
 	checkField( Form.tmail,isEmail, false)&& 
 	checkField( Form.ttelefono,isInteger, true)&& 
 	checkField( Form.tciudad,isAlphabetic, false)&& 
 	checkField( Form.tasunto,isAlphanumeric, false)&& 
 	checkField( Form.tmensaje,esDireccion, false)&& 
 	checkField( Form.tverifica,isAlphanumeric, false) )*/
	contactenos();
}
var xOp7Up,xOp6Dn,xIE4Up,xIE4,xIE5,xNN4,xUA=navigator.userAgent.toLowerCase();if(window.opera){var i=xUA.indexOf('opera');if(i!=-1){var v=parseInt(xUA.charAt(i+6));xOp7Up=v>=7;xOp6Dn=v<7;}}else if(navigator.vendor!='KDE' && document.all && xUA.indexOf('msie')!=-1){xIE4Up=parseFloat(navigator.appVersion)>=4;xIE4=xUA.indexOf('msie 4')!=-1;xIE5=xUA.indexOf('msie 5')!=-1;}else if(document.layers){xNN4=true;}xMac=xUA.indexOf('mac')!=-1;function xDef(){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])=='undefined') return false;}return true;}function xDisplay(e,s){if(!(e=xGetElementById(e))) return null;if(e.style && xDef(e.style.display)) {if (xStr(s)) e.style.display = s;return e.style.display;}return null;}function xGetElementById(e){if(typeof(e)!='string') return e;if(document.getElementById) e=document.getElementById(e);else if(document.all) e=document.all[e];else e=null;return e;}function xStr(s){for(var i=0; i<arguments.length; ++i){if(typeof(arguments[i])!='string') return false;}return true;}