var ventana;

if(document.images)
{
   maximagen = 20;
   actualimagen=0;
   ftover = new Array(maximagen);
   ftout = new Array(maximagen);
}
 
function tabOn(i) 
{
	document.images["btn_"+i].style.cursor = 'hand';
	if(document.images) document.images["btn_"+i].src=ftover[i].src;
}
 
function tabOff(i) 
{
	if(document.images) document.images["btn_"+i].src=ftout[i].src;
}


function popupmodif(href)
{ 
   parametros="dialogHeight: 600 px; dialogWidth: 800 px;";
   var valor = window.showModalDialog( href ,"Telam", parametros );
   window.location.reload();
}

function between(val, li, ls)
{
  return (val>=li && val<=ls);
}


function verificar_entero(cadena)
{
  for (var indice=0; indice<cadena.length; indice++)
    if (!between(cadena.charAt(indice), '0', '9'))
	  if (!(cadena.charAt(indice) == '-'))
  	    return false;
  return true;
}

//----Esfumado de imagenes en barra de menu ---
function nereidFade(object, destOp, rate, delta)
{
    object.style.cursor = 'hand';
    if (!document.all)
        return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
        
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}

function abrirpagina(nombre) 
{
   window.open( nombre , "Diario_Local" );
}

function openprn(id, tipo)
{
  window.open("notaprn.php?id="+id+"&tipo="+tipo,"Imprimir", "toolbar=no,directories=no,menubar=no,scrollbars=1,status=no,left=100,top=10,width=629,height=450");
}

function popenviamail(tipo, id)
{ 
   var w=410; var h=440;
   var winl = (screen.width - w) / 2;
   var wint = (screen.height - h) / 2;
   window.open("enviarnota/index.php?id="+id+"&tipocontenido="+tipo,"Recomendar", "toolbar=no,directories=no,menubar=no,scrollbars=0,status=0,location=no,left="+winl+",top="+wint+",width="+w+",height="+h);
}

function abrirlink(nombre) 
{
   window.open("http://"+nombre,"Diario_Local");
}


function abrirlinkpub(nombre) 
{
   var hh = window.open(nombre,"_blank");  //,"height=10,width=10,left=-20"
   //hh.close();
   
}


function habilitaloc()
{
  var sel = eval('document.all.chk_todalocalidad');
  if (sel.checked)
  {
    document.all.sel_localidad.disabled = true;   
  }else{
    document.all.sel_localidad.disabled = false;  
  }
  

}

function busquedanota()
{
  if (document.frmbuscador.buscador.value!="")
  {
     window.open("busqueda.php?pag=1&frase="+document.frmbuscador.buscador.value,"Busqueda de Noticias");
  }
}

function seleccionar(op)
{
   document.all.frmbuscaweb.edweb[op].checked=true;
}

function seleccionarop(op)
{
   document.all.rEncuesta[op].checked=true;   
}


function aceptaencuesta()
{
  document.all.frm_encuesta.submit();
}

function cambiarDistrito(sender)
{
 var sel = eval('document.all.SELZONA');
 window.location = "home.php?dis="+sel.value,"Diario";
}

function cambiarDistrito(seccion)
{
  var distrito = document.getElementById('seldistrito').value;
  window.location = "home.php?dis="+distrito+"&sec="+seccion;
}


function validagetaviso()
{
  var txt = eval('document.form_uaviso.txt_ref');
  if (document.all.txt_ref.value=="")
  {
      alert('Debe ingresar Nro. de Referencia.');
	  return false;
  }
  if (document.all.txt_pass.value=="")
  {
      alert('Debe ingresar su clave.');
	  return false;
  }   
  
 
  if (!verificar_entero(document.all.txt_ref.value))
  {
     alert('Debe ingresar un valor numérico como referencia.');
	 document.all.txt_ref.value ='';
	 return false;
  }
 
   return true;
}


function popupbuscaweb(sender)
{
   var sel  = eval('document.all.frmbuscaweb.edweb');
   var clave = document.all.textoweb.value;
   if (clave!=""){  
      if (sel[0].checked==true){
         window.open("http://ar.search.yahoo.com/search/ar?p="+clave+"&R=on", "Yahoo");
      }else{
         window.open("http://www.google.com.ar/search?q="+clave, "Google");
      }
  }else{
     alert('Deberá ingresar la palabra a buscar');
  }
}

function vervideo(archivo, tmulti)
{ 
  var directorio='';
  if (tmulti=='AN')  directorio='archivos/audio/';  //Audio Nota
  if (tmulti=='VN')  directorio='archivos/video/';  //Video nota
  if (directorio!='')
     window.open( directorio+archivo );
}


function popupaudio_nota_leida(idnota, titnota)
{ 
/*  window.open("archivos/noticias/audionotaleida.php?id="+idnota+"&titnota="+titnota, "Telam", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=473,height=286");*/
  window.open("./archivos/noticias/audionotaleida_local.php?id="+idnota+"&titnota="+titnota, "Telam", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=602,height=184");
}

function popupvideo(idnota, idpub, tmulti)
{ 
  window.open("vervideo.php?id="+idnota+"&idPub="+idpub+"&visor="+tmulti, "Video", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=473,height=286");
}

function popupalerta(idnota, idpub)
{
  var ancho;
  var alto;
  ancho = 428;
  alto = 250;
  izquierda = (screen.width) ? (screen.width-ancho)/2 : 100
  arriba = (screen.height) ? (screen.height-alto)/2 : 100
  opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,width='+ancho+',height='+alto+',left=' + izquierda + ',top=' + arriba;
  window.open("veralerta.php?id="+idnota+"&idPub="+idpub, "Alerta", opciones );
}


function popuppresenta(codpub, alto, ancho)
{
  izquierda = (screen.width) ? (screen.width-ancho)/2 : 100
  arriba = (screen.height) ? (screen.height-alto)/2 : 100
  opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,width='+ancho+',height='+alto+',left=' + izquierda + ',top=' + arriba;
  window.open("verpresenta.php?codpub="+codpub, "Presentacion", opciones );
}


function popgalimg(idnota, idPub)
{
   window.open("vergaleria.php?id="+idnota+"&idPub="+idPub, "Galeria", "toolbar=no,directories=no,menubar=no,status=no,left=50,top=10,width=700,height=560");
}


function popupsugerencias()
{
   window.open("correo.php?tcorreo=S", "Sugerencias", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=407,height=390");
}

function popupmaillector()
{
  window.open("correo.php?tcorreo=L", "Correo_de_Lectores", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=428,height=375");
}

function popupclasificado(opcion)
{
  if (opcion=='A')
     window.open("altaclasi.php?proc=conclasi", "Clasificados", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=500,height=460");
  else
     window.open("altaclasi.php?proc=getclasi", "Clasificados", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=500,height=460");
}



function submitencuesta(sender)
{ 
  var hpub = eval('document.all.hid_pub');
  var hid = eval('document.all.hid_sel');
  var henc = eval('document.all.hid_enc');
  
  hid.value = "";
  for (var indice=0; indice < document.all.rEncuesta.length; indice++)
  {
	if (document.all.rEncuesta[indice].checked) 
	  hid.value = document.all.rEncuesta[indice].value;
  }
   if (hid.value == "")
   {
     alert("Debe seleccionar una opción");
	 return false;
   }
   alert('Entro');
   window.open("encuesta.php?hid_pub="+hpub.value+"&hid_sel="+hid.value+"&hid_enc="+henc.value,"", "refresh=none,toolbar=no,directories=no,menubar=no,status=no,left=100,top=20,width=420,height=520");
}


function validaencuesta()
{ 
  var hid = eval('document.all.hid_sel');
 
  hid.value = "";
  for (var indice=0; indice < document.all.rEncuesta.length; indice++)
  {
	if (document.all.rEncuesta[indice].checked) 
	  hid.value = document.all.rEncuesta[indice].value;
  }
   if (hid.value == "")
   {
     alert("Debe seleccionar una opción");
	 return false;
   }
   return true;
}

function validarubro()
{
  var sel = eval('document.all.sel_localidad');
  var hidLocalidad = eval('document.all.hid_localidad');  	  
  var hidOperacion = eval('document.all.hid_operacion');
  var hidEspecializa = eval('document.all.hid_especialidad');
 
  hidOperacion.value = "";
  hidEspecializa.value = "";
  
  hidOperacion.value  = document.frmclasificado.sel_operacion.value;
  hidEspecializa.value = document.frmclasificado.sel_especialidad.value;  
    
  if (hidOperacion.value == "")
  {
     alert("Debe seleccionar operación");
	 return false;
  }
  if (hidEspecializa.value == "")
  {
     alert("Debe seleccionar especialización");
	 return false;
  }
  
  hidLocalidad.value = "";
  for (var indice=0; indice < sel.length; indice++)
	if (sel[indice].selected) 
	  hidLocalidad.value = hidLocalidad.value + sel[indice].value + "|";  
  return true;
}


function submitBusqueda(sender, idPub, dis, tipo )
{
  var alto=375;
  var ancho=428;  
  var izquierda = (screen.width) ? (screen.width-ancho)/2 : 100;
  var arriba = (screen.height) ? (screen.height-alto)/2 : 100;
  var opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + ancho + ',height=' + alto + ',left=' + izquierda + ',top=' + arriba + '';
  var txtbus = eval('document.all.txtbusqueda');
  
  if (txtbus.value != "")
  {
	  var cadenabus = txtbus.value;

	  cadenabus= cadenabus.replace('á','//a');
	  cadenabus= cadenabus.replace('à','//a');
	  cadenabus= cadenabus.replace('Á','//A');
	  cadenabus= cadenabus.replace('À','//A');

	  cadenabus= cadenabus.replace('é','//e');
	  cadenabus= cadenabus.replace('è','//e');
	  cadenabus= cadenabus.replace('É','//E');
	  cadenabus= cadenabus.replace('È','//E');
	  
	  cadenabus= cadenabus.replace('í','//i');
	  cadenabus= cadenabus.replace('ì','//i');
	  cadenabus= cadenabus.replace('Í','//I');
	  cadenabus= cadenabus.replace('Ì','//I');

      cadenabus= cadenabus.replace('ò','//o');
	  cadenabus= cadenabus.replace('ó','//o');
	  cadenabus= cadenabus.replace('Ò','//O');
	  cadenabus= cadenabus.replace('Ó','//O');
	  
	  cadenabus= cadenabus.replace('ú','//u');
	  cadenabus= cadenabus.replace('ù','//u');
	  cadenabus= cadenabus.replace('Ú','//U');
	  cadenabus= cadenabus.replace('Ù','//U');

      cadenabus= cadenabus.replace('ñ','//n');
	  cadenabus= cadenabus.replace('Ñ','//N');

      window.open("busqueda.php?txtbusqueda="+cadenabus+"&idPub="+idPub+"&pag=1&tipo="+tipo+"&dis="+dis,"Búsquedas",opciones); 	  
   }else{
      alert("Ingrese texto a buscar");
      return false;
   }
}


function submitBusquedaavanzada(sender )
{
  var alto=375;
  var ancho=428;  
  var izquierda = (screen.width) ? (screen.width-ancho)/2 : 100;
  var arriba = (screen.height) ? (screen.height-alto)/2 : 100;
  var opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + ancho + ',height=' + alto + ',left=' + izquierda + ',top=' + arriba + '';

  window.open("busqavan.php","Búsquedas",opciones); 	  
}

function popupencuesta(idpub)
{
  window.open("encuesta.php?ver=S&hid_pub="+idpub, "Encuesta", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=420,height=520");
}

function popupclimas()
{
  window.open("tiempociudad.php","Climas", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=350,height=250");
}

function refrescaredicion()
{
  var edsel = eval('document.all.seledicion');
  if (edsel.value!= "")
  {
    window.location = "veredicion.php?pag=1&dis=1&idPub="+edsel.value;
  }else
  {
     alert('Debe seleccionar una edición');
  }
}

function popupseledicion()
{
   ventana = window.open("ediciones.php","Ediciones_Anteriores", "toolbar=no,directories=no,menubar=no,status=no,left=100,top=50,width=420,height=370");
}

function popupediciones(id)
{
  var edsel = eval('document.all.seledicion');
  if (edsel.value!= "")
  {
     window.open("veredicion.php?pag=1&dis=1&idPub="+edsel.value,"Edicion_Anterior");
     window.close();
  }else
  {
     alert('Debe seleccionar una edición');
  }
}

function enviarcorreo(sender)
{
  var debe="Debe ingresar ";
   
  if (document.all.edapellido.value==""){
    alert(debe+"Apellido." );
	return false;
  }

  if (document.all.ednombre.value==""){
    alert(debe+"Nombre." );
	return false;
  }
/*
  if ((document.all.eddia.value=="")  || (isNum(document.all.eddia)) &&
      ((document.all.eddia.value<0) || (document.all.eddia.value>31))
	  ){
    alert(debe+"dia." );
	return false;
  }
  if ((document.all.edmes.value=="") || (isNum(document.all.edmes)) &&
      ((document.all.edmes.value<0) || (document.all.edmes.value>12))
	  ){
    alert(debe+"mes." );
	return false;
  }
  if ( (document.all.edanio.value=="") || (isNum(document.all.edanio)) &&
      ((document.all.edanio.value<1900) || (document.all.edanio.value>2003)) 
	  )
  {  
      alert(debe+"año." );
      return false;
  }
  if (isValidEmail( document.all.edmail.value )==false){
	alert("\nLa dirección de e-mail NO es valida.")
	return false;
  }
  */
  if (document.all.edcomentario.value==""){
    alert(debe+"comentario." );
	return false;
  }  
  return true;
}

function usuariocorrecto(sender)
{
  var debe="Debe ingresar ";
  
  if (document.all.edusuario.value==""){
    alert(debe+"Usuario." );
	return false;
  }
  
  if (document.all.edclave.value==""){
    alert(debe+"Clave." );
	return false;
  }
  return true;
}

function nuevousuario(sender)
{
  var debe="Debe ingresar ";
   
  if (document.all.edapellido.value==""){
    alert(debe+"Apellido." );
	return false;
  }
  if (document.all.ednombre.value==""){
    alert(debe+"Nombre." );
	return false;
  }
  if ((document.all.eddia.value=="")  || (isNum(document.all.eddia)) &&
      ((document.all.eddia.value<0) || (document.all.eddia.value>31))
	  ){
    alert(debe+"dia." );
	return false;
  }
  if ((document.all.edmes.value=="") || (isNum(document.all.edmes)) &&
      ((document.all.edmes.value<0) || (document.all.edmes.value>12))
	  ){
    alert(debe+"mes." );
	return false;
  }
  if ( (document.all.edanio.value=="") || (isNum(document.all.edanio)) &&
      ((document.all.edanio.value<1900) || (document.all.edanio.value>2003)) 
	  )
  {  
      alert(debe+"año." );
      return false;
  }
  if (isValidEmail( document.all.edmail.value )==false){
	alert("\nLa dirección de e-mail NO es valida.")
	return false;
  }
  
  if (document.all.edfacultad.value==""){
    alert(debe+"Facultad." );
	return false;
  }
  
  if (document.all.edcarrera.value==""){
    alert(debe+"Carrera." );
	return false;
  }
  
  return true;
}

function enviarclasificado(sender)
{
  var comprubro = eval('document.all.edrubro');
  var compesp   = eval('document.all.edespecialidad');
  var compope   = eval('document.all.edoperacion');
  var comploc   = eval('document.all.edlocalidad');
  
  var debe="Debe ingresar ";
  
  if (document.all.edapellido.value==""){
    alert(debe+"Apellido." );
	return false;
  }
  
  if (document.all.ednombre.value==""){
    alert(debe+"Nombre." );
	return false;
  }

  if (document.all.edtelefono.value==""){
    alert(debe+"Teléfono." );
	return false;
  }

  if (document.all.eddescripcion.value==""){
    alert(debe+"descripción." );
	return false;	
  }

  
  if ( (document.all.edclave.value=="") || (document.all.edclave1.value==""))
  {
    alert(debe+"Clave y la confirmación." );
	return false;   
  }

  if (document.all.edclave.value!=document.all.edclave1.value) 
  {
    document.all.edclave.value = "";
    document.all.edclave1.value = "";
    alert("NO coinciden la clave y su confirmación." );
	return false;   
  }
  
  comprubro.value = document.all.selrubro.value;
  compesp.value   = document.all.selesp.value;
  compope.value   = document.all.selop.value;
  comploc.value   = document.all.sellocalidad.value;
  
  return true;
}


function submitcorreo(sender) 
{
   if (enviarcorreo(sender)==true){
      document.all.form_correo.submit();
   }   
}

function submitnewusr(sender) 
{
   if (nuevousuario(sender)==true){
      document.all.form_newusr.submit();
   }   
}

function submitvercupon(sender) 
{
   if (usuariocorrecto(sender)==true){
      document.all.form_vercupon.submit();
   }   
}

function submitaviso(sender) 
{
   if (enviarclasificado(sender)==true){
      document.all.form_aviso.submit();
   }   
}

function isValidEmail( unmail )
{  
   if (unmail == '') 
   { 
     return false;
   }else{
      if (unmail.indexOf ('@',0) == -1 || unmail.indexOf ('.',0) == -1)
      { 
		 return false;		 
      }
   }
}


function isNum(sender)
{
   var str = sender.value;
   if (str == ""){
	  return false;
   }
   //si es digito
   for (var i = 0; i < str.length; i++) 
      {
      var ch = str.substring(i, i + 1);
      if ((ch < "0" || "9" < ch) && ch != '.') 
      {        
        return false;
      }
   }
   return true;
}

function mas_leidas()
{
    var ancho=394;
    var alto=400;
	izquierda = (screen.width) ? (screen.width-ancho)/2 : 100
	arriba = (screen.height) ? (screen.height-alto)/2 : 100
	opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + ancho + ',height=' + alto + ',left=' + izquierda + ',top=' + arriba + ''
	window.open('masleidas.php?pag=1', 'popUp', opciones)
}

function abrirventana(url, ancho, alto, barra) 
{
	izquierda = (screen.width) ? (screen.width-ancho)/2 : 100
	arriba = (screen.height) ? (screen.height-alto)/2 : 100
	opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + barra + ',resizable=0,width=' + ancho + ',height=' + alto + ',left=' + izquierda + ',top=' + arriba + ''
	window.open(url, 'popUp', opciones)
}


function vercorreolec(url, ancho, alto, barra)
{
	izquierda = (screen.width) ? (screen.width-ancho)/2 : 100
	arriba = (screen.height) ? (screen.height-alto)/2 : 100
	opciones = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=' + barra + ',resizable=0,width=' + ancho + ',height=' + alto + ',left=' + izquierda + ',top=' + arriba + ''
	window.open(url, 'popUp', opciones)
}


function sendEmail(Form, Address, Subject, CC, BCC, ReplyTo) 
{
    Form = document.all.frmenviamail;
    var emailBody;
    var emailTo;
    var emailSubject;
    var emailCC;
    var emailBCC;

    var emailURL; // The URL that will open the user's email client
	
    // temporary variables
    var elementCount;
    var elementIsHeader;

    var i;
    var j;

    // Set some default values
    emailBody = "Te aconsejo veas esto : \n\n";
    emailTo = Address;
    emailSubject = Subject;
    emailCC = CC ? CC : '';
    emailBCC = BCC ? BCC : '';
    emailReplyTo = ReplyTo ? ReplyTo : '';
    
    for(i = 0; i < Form.elements.length; i++) 
	{
	fe = Form.elements[i];
	elementIsHeader = 0;
	/* Check for special form elements whose names start with 'Mailto_'
	   These are used to set our headers from HTML form elements instead
	   of from the function parameters.
	 */
	
	switch(fe.name) {
	case "Mailto_To":
	    emailTo = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_Subject":
	    emailSubject = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_CC":
	    emailCC = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_BCC":
	    emailBCC = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_ReplyTo":
	    emailReplyTo = fe.value;
	    elementIsHeader = 1;
	    break;
	}
	
	if(!elementIsHeader) 
	{
	    switch(fe.type) 
		{
	    case "hidden":
	    case "password":
	    case "text":
	    case "textarea":
		if(fe.value.length > 0) {
		    emailBody += ">>> " + fe.value + "\n";
		}
		break;

	    case "select-multiple":
	    case "select-one":
		elementCount = 0;
		for(j = 0; j < fe.options.length; j++) {
		    if(fe.options[j].selected) {
			elementCount++;
			if(elementCount > 1) {
			    emailBody += ", " + fe.options[j].value;
			} else {
			    emailBody +=  ">>> " + fe.options[j].value;
			}
		    }
		}
		if(elementCount > 0) {
		    emailBody += "\n";
		}
		break;

	    case "radio":
	    case "checkbox":
		if(fe.checked) {
		    emailBody += ">>> " + fe.value + "\n";
		}
		break;
		
	    case "button":
	    case "image":
	    case "submit":
	    case "file":
		/* We do not record the name or value of buttons.  Please 
		   note that if a button is named with one of the special
		   element names (Mailto_To, Mailto_Subject etc.) that it
		   will not be ignored.  This means that you can have 
		   several different buttons, and name them Mailto_Subject
		   with different values.  Whichever button the user 
		   clicks on will cause the subject to be set.
		*/
		break;

	    default :
		// If we have never heard of this type of input we record
		// the name, input type, and value.
		emailBody += fe.name + "(" + fe.type + "): " + fe.value + "\n";
	    }
	}
    }
	
	emailBody += document.URL+ "\n\n";	
    //emailBody += escape(document.all.spntxt.innerText);

    emailURL = "mailto:" + escape(emailTo) + 
	"?subject=" + escape(emailSubject) +
	"&cc=" + escape(emailCC) +
	"&bcc=" + escape(emailBCC) +
	"&replyto=" + escape(emailReplyTo) +
	"&body=" + escape(emailBody);

    window.location = emailURL;
    return true;
}


function enviamailaviso( nombrediv ) 
{   
    var Form = eval('document.all.'+nombrediv);

    var emailBody;
    var emailTo;
    var emailSubject;
    var emailCC;
    var emailBCC;

    var emailURL; // The URL that will open the user's email client
	
    // temporary variables
    var elementCount;
    var elementIsHeader;

    var i;
    var j;

    // Set some default values
    emailBody = "Te aconsejo veas este aviso...: \n\n";
    emailTo = "";
    emailSubject = "Aviso Clasificado";
    emailCC = '';
    emailBCC = '';
    emailReplyTo = '';
	
   
    for(i = 0; i < Form.elements.length; i++) 
	{
       fe = Form.elements[i];
	   elementIsHeader = 0;
	   
	switch(fe.name) 
	{
	case "Mailto_To":
	    emailTo = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_Subject":
	    emailSubject = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_CC":
	    emailCC = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_BCC":
	    emailBCC = fe.value;
	    elementIsHeader = 1;
	    break;
	case "Mailto_ReplyTo":
	    emailReplyTo = fe.value;
	    elementIsHeader = 1;
	    break;
	}
	if(!elementIsHeader) 
	{
	    switch(fe.type) 
		{
	    case "hidden":
		    emailBody += ">>> " + fe.value + "\n";
		break;
		
	    case "password":
	    case "text":
	    case "textarea":
		if(fe.value.length > 0) {
		    emailBody += ">>> " + fe.value + "\n";
		}
		break;

	    case "select-multiple":
	    case "select-one":
	  	     elementCount = 0;
		    for(j = 0; j < fe.options.length; j++) 
			{
		       if(fe.options[j].selected) 
			   {
			        elementCount++;
					if(elementCount > 1) 
					{
					    emailBody += ", " + fe.options[j].value;
					} else {
					    emailBody +=  ">>> " + fe.options[j].value;
					}
		       }
		   }
		   
		if(elementCount > 0) {
		    emailBody += "\n";
		}
		break;

	    case "radio":
	    case "checkbox":
		     if(fe.checked) 
			 {
		         emailBody += ">>> " + fe.value + "\n";
	  		  }
		break;
		
	    case "button":
	    case "image":
	    case "submit":
	    case "file":
		break;

	    default :
//		  emailBody += fe.name + "(" + fe.type + "): " + fe.value + "\n";
	    }
	}
    }

    emailBody += document.URL+ "\n\n";
	
    emailURL = "mailto:" + escape(emailTo) + 
	"?subject=" + escape(emailSubject) +
	"&cc=" + escape(emailCC) +
	"&bcc=" + escape(emailBCC) +
	"&replyto=" + escape(emailReplyTo) +
	"&body=" + escape(emailBody);

    window.location = emailURL;
}



function adecuarimg(contenedor,porc,imgsrc)
{
var fcont = eval("document.all."+contenedor);
var fimgsrc = eval("document.all."+imgsrc);
var fwidthcont =  fcont.style.pixelWidth;
var fwidthimg = fimgsrc.width;
var fwidthzona =  Math.round(fwidthcont * porc / 100 );

//alert(contenedor+' fwidthcont: '+fwidthcont);
//alert(imgsrc+' fwidthimg: '+fwidthimg+'='+fwidthzona);

  //Chequeo si la foto es mas grande que la zona asignada
  nuevoporc = 0;
//  alert ('fwidthzona: '+fwidthzona+'  fwidthimg: '+fwidthimg +' Nombre Imagen: '+imgsrc );
  if (fwidthzona < fwidthimg)
  {   
   fporcajuste = Math.round((fwidthzona  * 100) / fwidthimg);
   var wo = fimgsrc.width;
   var ho = fimgsrc.height;
   var auxh=Math.round(ho * fporcajuste /100 );
   var auxw=Math.round(wo * fporcajuste /100 );
   fimgsrc.height = auxh;
   fimgsrc.width = auxw;
   nuevoporc = fporcajuste;

   //alert(contenedor+'->widthcont: '+fwidthcont+' widthimg: '+fwidthimg+'--- wp '+wo+ 'ho '+ho); 
  }
}

function isEnterKey(evt) 
{
if (!evt) 
{
	// grab IE event object
	evt = window.event
} 
else if (!evt.keyCode) 
{
	// grab NN4 event info
	evt.keyCode = evt.which
	}
	return (evt.keyCode == 13)
}

function searchOnEnter(fld, evt, idpub) 
{
	if (isEnterKey(evt)) 
	{
		submitBusqueda(fld,idpub,1,"B",1);
		return false
	}
	return true
}
