//Para agregar a favoritos
function agregar_a_favoritos(obj){   
    var title=String(document.title);
    var url=String(window.location);

    if (window.sidebar) // firefox
	   window.sidebar.addPanel(title, url, "");
    else if(window.opera && window.print)
    { // opera
        obj.href = url;
        obj.title = title;
        obj.rel = 'sidebar';
        obj.click();
    } 
    else if(document.all)// ie
	   window.external.AddFavorite(url, title);
	else 
    {// otros web Browsers
        alert ("Presione Crtl+D para agregar a este sitio en sus Bookmarks");  
    }
}

//Para abrir nueva ventana
function abrir_ventana(url,titulo,opciones)
{
    NuevaVentana = window.open(url,titulo,opciones+'location=no,menubar=no,resizable=yes,scrollbars=no,status=no,toolbar=no');
    NuevaVentana.focus();
}


function ValidarCampos(nameform,nameemail1,nameemail2) {

var miform = document.getElementById(nameform);
var email1 = document.getElementById(nameemail1);
var email2 = document.getElementById(nameemail2);
var goodEmail = email1.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi);
    if (!goodEmail)
    {
    alert('Por favor entra una dirección de correo.');
    email1.focus();
    email1.select();
    return;
    }
    goodEmail = email2.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.info)|(\.sex)|(\.biz)|(\.aero)|(\.coop)|(\.museum)|(\.name)|(\.pro)|(\..{2,2}))$)\b/gi); 
    if (!goodEmail)
    {
    alert('Por favor entra una dirección de correo.');
    email2.focus();
    email2.select();
    return;
    }
    miform.submit();
}

