function A(c) 
{ 
	var entra=new Array(' ','-','_','*','/','+','.','!','@','#','$','%','^','&','(',')','=','{','}','[',']',':',';',',','<','>','?','|','`','~','¡','¿','á','é','í','ó','ú','ä','ë','ï','ö','ü','à','è','ì','ò','ù','ñ'); 
	var sale =new Array('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','a','e','i','o','u','a','e','i','o','u','a','e','i','o','u','n'); 
	do
	{
		var oc=new String(c.value),nt=new String(""),nc; 
		oc = c;
		for(var q=0;q<oc.length;q++) 
		{ 
			nc=oc.charAt(q); 
			for(var w=0;w<entra.length;w++) 
			{ 
				if(oc.charAt(q)==entra[w]) 
				{ 
					if(q!=0 && entra[w]=='-')
					{ 
						break;
					}
					else
					{
						nc=sale[w]; 
						break; 
					}
				} 
			} 
			nt+=nc; 
		} 
		document.formaBusq.dominio.value=nt;
		c=nt;
		nc=nt.charAt(0);
		delete oc,nt; 
	}while(nc=='-')
} 

function verificaSintaxis() {
	var regex = new RegExp('^[a-zA-Z0-9]([a-zA-Z0-9\-])*[a-zA-Z0-9]$');
	var cont = 0;
	var dominio
	var dominio2
	dominio = document.formaBusq.dominio.value
	dominio2 = dominio.split(".")
	document.formaBusq.dominio.value = dominio2[0]
	A(document.formaBusq.dominio.value)

//	if (!regex.test(document.formaBusq.dominio.value)) {
//		alert("Error en captura, favor de revisar la sintaxis");
//		flag = 0;
//		return false;
//	}
//	if (document.formaBusq.tipo.length) {
//		var len = document.formaBusq.tipo.length;
//		var flag = 0, i, cont = 0;
//		for (i = 0;i < len; i++) {
//			if (document.formaBusq.tipo[i].checked){
//				cont = cont + 1;
//				flag = 1;
//			}
//		}
//	}
//	else
//		if (document.formaBusq.tipo.checked)
//			flag = 1;

//	if (!flag) {
//		alert("Por favor selecciona por lo menos un dominio a registrar");
//		return false;
//	}
//	document.formaBusq.cont.value = cont;
}

function todas() {
	if (document.formaBusq.todos.checked == true)
		for (i=0; i<8; i++)
			document.formaBusq.tipo[i].checked = true;
	else
		for (i=0; i<8; i++)
			document.formaBusq.tipo[i].checked = false;
}
document.write('<table width="400" border="0" cellspacing="0" cellpadding="0">');
document.write('  <tr> ');
document.write('    <td><table width="400" border="0" align="center" cellpadding="0" cellspacing="0">');
document.write('        <tr> ');
document.write('          <td width="10" valign="top"><img src="http://dominios.terra.com.mx/i/esq1.gif" width="10" height="31"></td>');
document.write('          <td width="16" align="right" bgcolor="1C3964"><img src="http://dominios.terra.com.mx/i/num.gif" width="13" height="30"></td>');
document.write('          <td align="left" bgcolor="1C3964"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">Consulta ');
document.write('          <strong>GRATIS</strong> la disponibilidad de tu dominio <br>');
document.write('            Adquiere tu dominio</font></td>');
document.write('          <td width="10" valign="top"><img src="http://dominios.terra.com.mx/i/esq2.gif" width="10" height="31"></td>');
document.write('        </table></td>');
document.write('  </tr>');
document.write('        </tr>');
document.write('        <tr bgcolor="ececec"> ');
//document.write('          <td></td>');
document.write('          <td height="18" align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
document.write('            <img src="" width="8" height="1"> </font></td>');
//document.write('          <td height="18" align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".com" >');
//document.write('            .com</font></td>');
//document.write('          <td align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".net" >');
//document.write('            .net</font></td>');
//document.write('          <td align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".org" >');
//document.write('            .org</font></td>');
//document.write('          <td align="left"></td>');
//document.write('          <td align="left"><font size="1" face="verdana"> ');
//document.write('            <input type="checkbox" name="todos" value="todas" onClick="todas();">');
//document.write('            <strong>TODAS</strong></font></td>');
//document.write('          <td></td>');
document.write('        </tr>');
document.write('  <tr><td>');
document.write('	  <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">');
document.write('		<form action="http://dominios.terra.com.mx/buscaDominio.asp" method="post" name="formaBusq" id="formaBusq" target="_blank" onSubmit="return(verificaSintaxis());">');
document.write('		<input type="hidden" name="cont" value="5">');
document.write('		<input type="hidden" name="mx" value="1">	');
document.write('        <tr bgcolor="ececec"> ');
document.write('          <td></td>');
document.write('          <td height="30" colspan="6" align="center"><font size="1" face="Arial, Helvetica, sans-serif"><img src="http://dominios.terra.com.mx/i/img_wwwc.gif" width="54" height="17" border="0" >&nbsp; ');
document.write('            <input name="dominio" type="text" style="font-family: Arial; font-size:12px;" size="30" maxlength="40">');
document.write('            &nbsp;&nbsp; ');
document.write('            <input name="image" type="image" src="http://dominios.terra.com.mx/i/btn_consultarc.gif" width="75" height="19" border="0">');
document.write('            </font></td>');
document.write('          <td></td>');
document.write('        </tr>');
document.write('        <tr bgcolor="ececec"> ');
document.write('          <td></td>');
document.write('          <td height="18" align="left"><font size="1" face="Arial, Helvetica, sans-serif"><img src="" width="8" height="1"></font></td>');
document.write('				   <td><input type="hidden" name="tipo" value=".com.mx, .net.mx, .org.mx, .edu.mx, .gob.mx"></td>');
//document.write('          <td align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".com.mx" >.com.mx</font></td>');
//document.write('          <td align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".net.mx" >.net.mx</font></td>');
//document.write('          <td align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".org.mx" >.org.mx</font></td>');
//document.write('          <td align="left"><font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".edu.mx" >.edu.mx</font></td>');
//document.write('          <td align="left"> <font size="1" face="Arial, Helvetica, sans-serif"> ');
//document.write('            <input type="checkbox" name="tipo" value=".gob.mx" >.gob.mx</font></td>');
document.write('          <td colspan="1" align="left"><font color="ececec">____________<img src="http://dominios.terra.com.mx/i/ej1.gif" width="117" height="13"></font></td>');
document.write('          <td></td>');
document.write('          <td></td>');
//document.write('          <td></td>');
document.write('          <td></td>');
document.write('          <td></td>');
document.write('          <td></td>');
document.write('        <tr> ');
document.write('          <td bgcolor="#FFFFFF" width="5"><img src="http://dominios.terra.com.mx/i/esq3.gif" width="10" height="7"></td>');
document.write('          <td colspan="6" align="center" bgcolor="ececec"></td>');
document.write('          <td bgcolor="#FFFFFF"><img src="http://dominios.terra.com.mx/i/esq4.gif" width="10" height="7"></td>');
document.write('	  </form>');
document.write('  </table>');
document.write('</td>');
document.write('</tr>');
document.write('</table>');


