function maximize() {
if (top.location != location) top.location.href = location.href;
 self.moveTo(0,0);
 self.resizeTo(screen.availWidth,screen.availHeight);
}

function parent() {
if(top==self) { setTimeout("location='http://sanyiao.com.mx'",2500)
 }
}

function autotime() {
setTimeout("location='inicio.htm'",7000)
}

function Ir(list) {
frames.estados.location.href="lista.htm#" + list.options[list.selectedIndex].value
}


function Validar(form) {
   if (form.email.value == "")
  { alert("Por favor ingrese su dirección de e-mail"); form.email.focus(); return; }
if (form.email.value.indexOf('@', 0) == -1 || form.email.value.indexOf('.', 0) == -1 || form.email.value.indexOf(' ') != -1)
  { alert("Dirección de e-mail inválida verifiquela"); 
  form.email.focus(); return; }
 if (form.Nombre.value == "")
  { alert("Por favor ingrese su nombre"); form.Nombre.focus(); return; }
  form.submit();
}

function setpopup(mypage,myname,w,h) {
 var win=null;  {
   myleft=(screen.width)?(screen.width-w)/2:100; 
   mytop=(screen.height)?(screen.height-h)/2:100;
  }
   settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes"; 
 win=window.open(mypage,myname,settings);
win.focus();
}


function findInPage(str) {
var NS4 = (document.layers); 
var IE4 = (document.all);
var win = top.principal.estados; // Con frames usar top.nombre.window; 
var n = 0; 

var txt, i, found; 
if (str == "") 
return false; 
// Find next occurance of the given string on the page, wrap around to the 
// start of the page if necessary. 
if (NS4) { 
// Look for match starting at the current point. If not found, rewind 
// back to the first match. 
if (!win.find(str)) 
while(win.find(str, false, true)) 
n++; 
else 
n++; 
// If not found in either direction, give message. 
if (n == 0) 
alert("Not found."); 
} 
if (IE4) { 
txt = win.document.body.createTextRange(); 
// Find the nth match from the top of the page. 
for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { 
txt.moveStart("character", 1); 
txt.moveEnd("textedit"); 
} 
// If found, mark it and scroll it into view. 
if (found) { 
txt.moveStart("character", -1); 
txt.findText(str); 
txt.select(); 
txt.scrollIntoView(); 
n++; 
} 
// Otherwise, start over at the top of the page and find first match. 
else { 
if (n > 0) { 
n = 0; 
findInPage(str); 
} 
// Not found anywhere, give message. 

else 
alert("No encontrado"); 
} 
} 

return false; 
} 