function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function storeCaret(text) { 
   if (text.createTextRange) {
    text.caretPos = document.selection.createRange().duplicate();
   }
  }

<!-- Begin
  function flip(rid)
  {
    current=(document.getElementById(rid).style.display == 'none') ? 'block' : 'none';
    document.getElementById(rid).style.display = current;
  }
 // End -->


function agregar(){
if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
var url="http://www.frasecitas.com";
var titulo="FraseCitas.CoM - Frases y Citas";
window.external.AddFavorite(url,titulo);
}
else {
if(navigator.appName == "Netscape") 
alert ("Presione Crtl+D para agregar este sitio en sus Bookmarks o Favoritos");
}
}

function validar(theform) {
	if (theform.categoria.value=="") {
		alert("La categoría está vacia");
		return false; }
	if (theform.frases.value=="Esta es la frase 1 - Nombre del Autor 1") {
		alert("No puedes enviarnos esta frase, inserta frases.");
		return false; }
	if (theform.nick.value=="")
	{
	alert("Error con el nick, está vacio.");
	return false; 
	}
	//nick
	var checkOK = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚ0123456789_" + "abcdefghijklmnñopqrstuvwxyzáéíóú012345678_";
    var checkStr = theform.nick.value;
    var allValid = true; 
    for (i = 0; i < checkStr.length; i++) {
    ch = checkStr.charAt(i); 
    for (j = 0; j < checkOK.length; j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length) { 
      allValid = false; 
      break; 
    }
  }
  if (!allValid) { 
    alert("Escriba sólo letras,numeros o guión bajo _ en el campo \"Nick\"."); 
    theform.nick.focus(); 
    return (false); 
  } 
    if (theform.nick.value.length < 4) {
    alert("El nick debe de tener al menos 4 caracteres.");
    theform.nick.focus();
    return (false);
   }
else
{
	    return (true);

	}
}
