function confirmar_url(url,texto)
{
	if (confirm (texto)) {self.location=url;}
}

function Permut (flag,img) {
  if (document.images) {
       if (document.images[img].permloaded) {
           if (flag==1) document.images[img].src = document.images[img].perm.src
           else document.images[img].src = document.images[img].perm.oldsrc
       }
  }
}
function preloadPermut (img,adresse) {
  if (document.images) {
       img.onload = null;
       img.perm = new Image ();
       img.perm.oldsrc = img.src;
       img.perm.src = adresse;
       img.permloaded = true;
  }
}

function openZoom(url,w,h)
{
  var str="height="+h+",width="+w+", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no";
  window.open(url,"_blank",str);
}

function openZoomWithScroll(url,w,h)
{
  var str="height="+h+",width="+w+", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no";
  window.open(url,"_blank",str);
}

function isNumber(a)
{
  var variable;
  var digito;
    for(i=0; i<a.length; i++)
	{
	  digito = a.substring(i, i+1);
	  if(digito < "0" || digito > "9")
	    return false;
	}
	return true;
}

function isEmailAddress(theElement)
{
  var s = theElement;
  var filter=/^[A-Za-z][A-Za-z0-9_]*@[A-Za-z0-9_]+\.[A-Za-z0-9_.]+[A-za-z]$/;

  if (filter.test(s))
    return true;
  else
    return false;
}

function isURL(url)
{
  var re=/^http:\/\/\w+(\.\w+)*\.\w{2,3}$/;
  return re.test(url);
}

function iSubmitEnter(oEvento, oFormulario)
{
  var iAscii;

  if (oEvento.keyCode)
    iAscii = oEvento.keyCode;
  else if (oEvento.which)
     iAscii = oEvento.which;
  else
     return false;

  if (iAscii == 13) oFormulario.submit();
  
  return true;
}
