function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function abrirVentanaNuevaConTitulo(url,titulo){
	//w_height=screen.availHeight
	//w_width=screen.availWidth
	w_width=565;
	w_height=504;
	pos_left = (screen.availWidth - 12 - w_width)/2;
	pos_top = (screen.availHeight - 37 - w_height)/2;
	ventana = window.open(url,titulo,"toolbar=no, location=no, directories=no, status=no, scrollbars=yes, menubar=no, resizable=no, height=" + w_height + ",width=" + w_width + ",left=" + pos_left + ",top=" + pos_top + "");
	ventana.focus();
}
function abrirVentanaNueva(url){
	//w_height=screen.availHeight
	//w_width=screen.availWidth
	w_width=565;
	w_height=504;
	pos_left = (screen.availWidth - 12 - w_width)/2;
	pos_top = (screen.availHeight - 37 - w_height)/2;
	window.open(url,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, height=" + w_height + ",width=" + w_width + ",left=" + pos_left + ",top=" + pos_top + "");
}
function abrirLink(url){
	//w_height=screen.availHeight
	//w_width=screen.availWidth
	w_width=800;
	w_height=600;
	pos_left = (screen.availWidth - 12 - w_width)/2;
	pos_top = (screen.availHeight - 37 - w_height)/2;
	window.open(url,"","toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, height=" + w_height + ",width=" + w_width + ",left=" + pos_left + ",top=" + pos_top + "");
}
function abrirVentanaNuevaSelector(url){
	//w_height=screen.availHeight
	//w_width=screen.availWidth
	w_width=360;
	w_height=290;
	pos_left = 20;
	pos_top = (screen.availHeight - 37 - w_height)/2;
	window.open(url,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, height=" + w_height + ",width=" + w_width + ",left=" + pos_left + ",top=" + pos_top + "");
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function verObjeto(idobjeto){
  DOMViewerObj = document.getElementById(idobjeto);
  DOMViewerName = DOMViewerObj.id;
  window.open('domviewer.htm');	
}
function verObjetoSinNombre(objeto){
  DOMViewerObj = objeto;
  DOMViewerName = DOMViewerObj.id;
  window.open('domviewer.htm');	
}
function MM_findObj(n, d) { //v4.0
  var p,i,x; 
  //d = destino
  if(!d) d=document; 
  //Si hay un interrogante dentro de la cadena de busqueda n y hay mas de un frame
  //La cadena de busqueda puede ser nombre_elemento?nombre_frame
  if((p=n.indexOf("?"))>0 && parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; 
	n=n.substring(0,p);
  }
  //Intenta coger el elemento del documento destino en plan array
  if(!(x=d[n])&&d.all) 
  	x=d.all[n]; 
  //Intenta coger el elemento de un formulario
  for (i=0;!x&&i<d.forms.length;i++) 
  	x=d.forms[i][n];
  //Intenta coger el elemento de una capa
  for(i=0;!x&&d.layers&&i<d.layers.length;i++)
  	x=MM_findObj(n,d.layers[i].document);
  //Intenta coger el elemento con el metodo getElementByID
  if(!x && document.getElementById)
  	x=document.getElementById(n); 
  return x;
}
function MWJ_findObj( oName, oFrame, oDoc ) {
    /* this function is slightly bigger than the DreamWeaver
    function but is more efficient as it can also find
    anchors, frames, variables, functions, and check through
    any frame structure

    if not working on a layer, document should be set to the
    document of the working frame
    if the working frame is not set, use the window object
    of the current document
    WARNING: - cross frame scripting will cause errors if
    your page is in a frameset from a different domain */
    if( !oDoc ) { if( oFrame ) { oDoc = oFrame.document; } else {
        oDoc = window.document; } }

    //check for images, forms, layers
    if( oDoc[oName] ) { return oDoc[oName]; }

    //check for pDOM layers
    if( oDoc.all && oDoc.all[oName] ) { return oDoc.all[oName]; }

    //check for DOM layers
    if( oDoc.getElementById && oDoc.getElementById(oName) ) {
        return oDoc.getElementById(oName); }

    //check for form elements
    /*if (oDoc.forms.length){
	for( var x = 0; x < oDoc.forms.length; x++ ) {
        if( oDoc.forms[x][oName] ) { return oDoc.forms[x][oName]; } }
	}*/
	
    //check for anchor elements
    //NOTE: only anchor properties will be available,
    //NOT link properties!
    /*for( var x = 0; x < oDoc.anchors.length; x++ ) {
        if( oDoc.anchors[x].name == oName ) {
            return oDoc.anchors[x]; } }*/

    //check for any of the above within a layer in layers browsers
    for( var x = 0; document.layers && x < oDoc.layers.length; x++ ) {
        var theOb = MWJ_findObj( oName, null, oDoc.layers[x].document );
            if( theOb ) { return theOb; } }

    //check for frames, variables or functions
    if( !oFrame && window[oName] ) { return window[oName]; }
    if( oFrame && oFrame[oName] ) { return oFrame[oName]; }

    //if checking through frames, check for any of the above within
    //each child frame
    for( var x = 0; oFrame && oFrame.frames &&
      x < oFrame.frames.length; x++ ) {
        var theOb = MWJ_findObj( oName, oFrame.frames[x],
          oFrame.frames[x].document ); if( theOb ) { return theOb; } }

    return null;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; 
	  img.MM_up = args[3]; 
	  img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) 
	  	nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2)
	  	if ((img = MM_findObj(args[i])) != null){
        	if (!img.MM_up) 
				img.MM_up = img.src;
        	img.src = img.MM_dn = args[i+1];
        	nbArr[nbArr.length] = img;
     	}
	}
  }else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) 
	  if ((img = MM_findObj(args[i])) != null) {
      	if (!img.MM_up) 
			img.MM_up = img.src;
      	img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      	nbArr[nbArr.length] = img;
      }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; 
	  img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; 
	}
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}


function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
	for(i=0; i<a.length; i++)
    	if (a[i].indexOf("#")!=0){
			d.MM_p[j]=new Image; 
			d.MM_p[j++].src=a[i];
		}
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; 
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) 
  	x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
	   document.MM_sr[j++]=x; 
	   if(!x.oSrc) x.oSrc=x.src; 
	   x.src=a[i+2];
	}
}
<!-- Changes:  Sandeep V. Tamhankar (stamhankar@hotmail.com) -->

/* 1.1.2: Fixed a bug where trailing . in e-mail address was passing
            (the bug is actually in the weak regexp engine of the browser; I
            simplified the regexps to make it work).
   1.1.1: Removed restriction that countries must be preceded by a domain,
            so abc@host.uk is now legal.  However, there's still the 
            restriction that an address must end in a two or three letter
            word.
     1.1: Rewrote most of the function to conform more closely to RFC 822.
     1.0: Original  */

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function emailCheck (emailStr, idioma) {
	if (emailStr == ""){
		alert((idioma == "e")?"Blank e-mail":"El campo email está vacio");
		return false;
	}
/* The following pattern is used to check if the entered e-mail address
   fits the user@domain format.  It also is used to separate the username
   from the domain. */
var emailPat=/^(.+)@(.+)$/
/* The following string represents the pattern for matching all special
   characters.  We don't want to allow special characters in the address. 
   These characters include ( ) < > @ , ; : \ " . [ ]    */
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
/* The following string represents the range of characters allowed in a 
   username or domainname.  It really states which chars aren't allowed. */
var validChars="\[^\\s" + specialChars + "\]"
/* The following pattern applies if the "user" is a quoted string (in
   which case, there are no rules about which characters are allowed
   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
   is a legal e-mail address. */
var quotedUser="(\"[^\"]*\")"
/* The following pattern applies for domains that are IP addresses,
   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
   e-mail address. NOTE: The square brackets are required. */
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
/* The following string represents an atom (basically a series of
   non-special characters.) */
var atom=validChars + '+'
/* The following string represents one word in the typical username.
   For example, in john.doe@somewhere.com, john and doe are words.
   Basically, a word is either an atom or quoted string. */
var word="(" + atom + "|" + quotedUser + ")"
// The following pattern describes the structure of the user
var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
/* The following pattern describes the structure of a normal symbolic
   domain, as opposed to ipDomainPat, shown above. */
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


/* Finally, let's start trying to figure out if the supplied address is
   valid. */

/* Begin with the coarse pattern to simply break up user@domain into
   different pieces that are easy to analyze. */
var matchArray=emailStr.match(emailPat)
if (matchArray==null) {
  /* Too many/few @'s or something; basically, this address doesn't
     even fit the general mould of a valid e-mail address. */
	alert((idioma == "e")?"E-mail seems incorrect (check @ and .'s)":"El email parece incorrecto (comprueba @ y .'s)");
	return false
}
var user=matchArray[1]
var domain=matchArray[2]

// See if "user" is valid 
if (user.match(userPat)==null) {
    // user is not valid
    alert((idioma == "e")?"User name does not seem valid":"El nombre de usuario no parece valido.")
    return false
}

/* if the e-mail address is at an IP address (as opposed to a symbolic
   host name) make sure the IP address is valid. */
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
    // this is an IP address
	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
	        alert((idioma == "e")?"Target ip not valid":"Ip destino no es valida")
		return false
	    }
    }
    return true
}

// Domain is symbolic name
var domainArray=domain.match(domainPat)
if (domainArray==null) {
	alert((idioma == "e")?"Domain name does not seem correct":"El nombre de dominio no parece ser correcto")
    return false
}

/* domain name seems valid, but now make sure that it ends in a
   three-letter word (like com, edu, gov) or a two-letter word,
   representing country (uk, nl), and that there's a hostname preceding 
   the domain or country. */

/* Now we need to break up the domain to get a count of how many atoms
   it consists of. */
var atomPat=new RegExp(atom,"g")
var domArr=domain.match(atomPat)
var len=domArr.length
if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
   // the address must end in a two letter or three letter word.
   alert((idioma == "e")?"Addresses must have a 3-letter domain or 2-letter country":"La direccion debe terminar en un dominio de tres letras o un identificativo de pais de dos letras")
   return false
}

// Make sure there's a host name preceding the domain.
if (len<2) {
   var errStr=(idioma == "e")?"Not host name!":"A esta direccion le falta el nombre de host!"
   alert(errStr)
   return false
}
return true;
}
