function initgeneral()
{


		/*efecto hover de las imagenes*/
		$('a img, input, textarea, select').animate({ opacity: 0.8 }, "fast");
		$('a img, input, textarea, select').mouseover(function(){ $(this).animate({ opacity: 1 }, "fast");})
		$('a img, input, textarea, select').mouseout(function(){ $(this).animate({ opacity: 0.8 }, "fast");})


		$('input.inputcampo, textarea.textareacampo').focus(function(){	lastcampofocus = $(this).attr('id'); });

		initejemplos();
 /*
        3.) Simply Centered Informational DIV Popup
    */

    /*
		ESTO CORRESPONDE LA VENTANA D AYUDA
        The viewport object is mainly for the cross-browser mess
        that is unfortunately necessary to get a DIV to center.

        There is also an officially supported plugin called "Dimensions"
        that can manage some of this on your own projects. Check it out at:

        http://jquery.com/plugins/project/dimensions
    */

    var viewport = {
        o: function() {
            if (self.innerHeight) {
    			this.pageYOffset = self.pageYOffset;
    			this.pageXOffset = self.pageXOffset;
    			this.innerHeight = self.innerHeight;
    			this.innerWidth = self.innerWidth;
    		} else if (document.documentElement && document.documentElement.clientHeight) {
    			this.pageYOffset = document.documentElement.scrollTop;
    			this.pageXOffset = document.documentElement.scrollLeft;
    			this.innerHeight = document.documentElement.clientHeight;
    			this.innerWidth = document.documentElement.clientWidth;
    		} else if (document.body) {
    			this.pageYOffset = document.body.scrollTop;
    			this.pageXOffset = document.body.scrollLeft;
    			this.innerHeight = document.body.clientHeight;
    			this.innerWidth = document.body.clientWidth;
    		}
    		return this;
        },
        init: function(el) {
            $(el).css("left",Math.round(viewport.o().innerWidth/2) + viewport.o().pageXOffset - Math.round($(el).width()/2));
            $(el).css("top",Math.round(viewport.o().innerHeight/2) + viewport.o().pageYOffset - Math.round($(el).height()/2));
        }
    };
    $(".simple_popup_info").each(function(){
        $(this).css("display","none").siblings(".simple_popup").mouseover(function(){
            $(".simple_popup_div").remove(); // a continuacion uso el fromcharcode para evitar que el xhtml parser crea q hay un div en el head
            var strSimple = String.fromCharCode(60)+String.fromCharCode(100)+"iv class='simple_popup_div'><"+String.fromCharCode(100)+"iv class='simple_popup_inner'>";
						strSimple += String.fromCharCode(60)+"p class='simple_close'> "+String.fromCharCode(60)+"a href='#'>"+String.fromCharCode(60)+"img alt='X' src='images/cierra.gif'/>"+String.fromCharCode(60)+"/a>"+String.fromCharCode(60)+"/p>";

            strSimple += $(this).siblings(".simple_popup_info").html();

			strSimple += String.fromCharCode(60)+"p class='simple_close'> "+String.fromCharCode(60)+"a href='#'>"+String.fromCharCode(60)+"img alt='X' src='images/cierra.gif'/>"+String.fromCharCode(60)+"/a>"+String.fromCharCode(60)+"/p>";

            strSimple += String.fromCharCode(60)+"/div>"+String.fromCharCode(60)+"/div>";
            $("body").append(strSimple);
            viewport.init(".simple_popup_div");
            $(".simple_close").click(function(){
                $(".simple_popup_div").fadeOut();
                return false;
            });
            return false;
        }); //onmouseover funcion
		
    }); //del each
	/*$(".simple_popup_info").siblings(".simple_popup").mouseout(function(){ $(".simple_popup_div").remove(); return false;});*/


	$(".menu").click(function(){ $('form#formulario').attr('action', $(this).attr('href')); $('form#formulario').submit(); return false; });
	$("#homelink").click(function(){$('form#formulario').attr('action', $(this).attr('href')); $('form#formulario').submit(); return false; });
	



 /*efecto de posicion absoluta del diccionario cuando hay js*/

 /*al cargar la pagina se coloca el diccionario en la posición inmediatamente inferior al elemento*/
 var top_inicial = $('#hr-posicion-diccionario').offset().top;
 $('#diccionario').css("top",top_inicial +"px");
 $(window).scroll(function(){

	if (  ($('#ejemplodiccionario-div').is(":visible"))||(($('#dialog-propuesta-traduccion').is(":visible")))  ) {}
		else  posicionYFija('diccionario', top_inicial, 5); // para que el div #diccionario se mueva con el scroll
 });
 


};


function posicionYFija(nombrediv, top_inicial, distancia)
{ 
  var mydiv =  $('#'+nombrediv);
  var nuevo_top = 0;
  var offset = mydiv.offset();
  var scroll = $(window).scrollTop();

	if ((top_inicial-scroll)<distancia){
		nuevo_top = scroll+distancia;		
		mydiv.css("top",nuevo_top +"px");
	}


  
// alert("tcY	:"+tcY+". scroll: "+$(window).scrollTop()+"coords ( " + offset.left + ", " +offset.top + " )");
}
