// <![CDATA[
	// opacidad
	function opacidad(elemento, valor) {
		var valor_noie = valor / 100;
		$(elemento).css('filter', 'alpha(opacity=' + valor + ')');
		$(elemento).css('-moz-opacity', valor_noie);
		$(elemento).css('-khtml-opacity', valor_noie);
		$(elemento).css('opacity',valor_noie);
	}
	// centrar elemento en la pantalla
	function centro(lo_que) {
		var x = parseFloat($(window).width()) / 2 - parseFloat($(lo_que).width()) / 2;
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		x = x + 'px';
		y = y + 'px';
		$(lo_que).css({'left': x, 'top': y});
	}
	// centrar verticalmente
	function centroVert(lo_que) {
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		$(lo_que).css({'top': y});
	}
	// carga de imagenes
	function cargaImg(sID, sURL) {
		$(sID).unbind("load");
		$(sID).bind("load", function() { $(this).fadeIn(); } )
		$(sID).stop(true, true).fadeOut("normal", function () { $(sID).attr('src', sURL); } );
	}
	// le saca los puntitos de m*** a los links en IE
	if ($.browser.msie) {
		$('a').focus(
			function() {
				$(this).blur()
			}
		);
	}
	// opacidad
	function opacidad(elemento, valor) {
		var valor_noie = valor / 100;
		$(elemento).css('filter', 'alpha(opacity=' + valor + ')');
		$(elemento).css('-moz-opacity', valor_noie);
		$(elemento).css('-khtml-opacity', valor_noie);
		$(elemento).css('opacity',valor_noie);
	}
	// centrar elemento en la pantalla
	function centro(lo_que) {
		var x = parseFloat($(window).width()) / 2 - parseFloat($(lo_que).width()) / 2;
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		x = x + 'px';
		y = y + 'px';
		$(lo_que).css({'left': x, 'top': y});
	}
	// centrar verticalmente
	function centroVert(lo_que) {
		var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
		$(lo_que).css({'top': y});
	}
	// lightbox
	function muestraLB() {
		$('#fon-lb').css('width', $(window).width() + 'px');
		$('#fon-lb').css('height', $(document).height() + 'px');
		opacidad('#fon-lb', 75);
		centro('#lb');
		$('#fon-lb').fadeIn('normal', function() {$('#lb').fadeIn('normal');} );
	}
	function cierraLB() {
		$('#lb').fadeOut('normal', function() {$('#fon-lb').fadeOut('normal');} );
	}

	$(document).ready(
		function() {
			// acomoda un menu en IE6, y bueno, que queres que le haga...
			if(es_IE6) {
				altura = $('ul.lista-estudio li').length * 29;
				$('ul.lista-estudio').css('height', altura + 'px');
			}
			// le saca los puntitos de m*** a los links en IE
			if ($.browser.msie) {
				$('a').focus(
					function() {
						$(this).blur()
					}
				);
			}

		$('ul.listado-materiales li .imagen a').click(
				function() {	
					muestraLB();

					return false;
				}
			);
			$('#fon-lb, ul.titulo-cerrar .btn-cerrar').click(
				function() {	
					cierraLB();
					return false;
				}
			);
			$(window).scroll(
				function() {
					centroVert($('#lb'));
				}
			);
			/* estilos para los selects */
			/* ni vale la pena hacer esto en IE 6 */
			if (!($.browser.msie && $.browser.version == "6.0")) {
				$('.select-estilo').css('filter', 'alpha(opacity=0)');
				$('.select-estilo').css('opacity', '0');
				$('.select-estilo').change(function() {
					var opcion = $(this).children(":selected").text();
					$(this).parent().children('.span-estilo').text(opcion);
				});
				/* que ponga autom�ticamente el texto del que este seleccionado */
				$('.span-estilo').each(
					function() {$(this).text($(this).parent().children('.select-estilo').children(':selected').text())}
				);
			}
			opacidad('.subir', 0);
			/* subir archivos */
			$('.subir').change(function() {
				$(this).parent().children('.fondo-txt-img').children().text($(this).val());
			});
		}
	);

	function validaRRHH() {
		clase = "error";
		bError = false;
		if ($("#rrhh_nombre").val()=='') {
			$("#rrhh_nombre").addClass(clase);
			bError= true;
		} else {
			$("#rrhh_nombre").removeClass(clase);
		}

		if ($("#rrhh_telefono").val()=='') {
			$("#rrhh_telefono").addClass(clase);
			bError= true;
		} else {
			$("#rrhh_telefono").removeClass(clase);
		}

		if ($("#rrhh_correo").val()=='') {
			$("#rrhh_correo").addClass(clase);
			bError= true;
		} else {
			$("#rrhh_correo").removeClass(clase);
		}

		if ($("#rrhh_destino").val()=='') {
			$("#rrhh_destino").addClass("error");
			bError= true;
		} else {
			$("#rrhh_destino").removeClass("error");
		}

		if ($("#rrhh_mensaje").val()=='') {
			$("#rrhh_mensaje").addClass("error");
			bError= true;
		} else {
			$("#rrhh_mensaje").removeClass("error");
		}

		if ($("#rrhh_archivo").val()=='') {
			$("#fakeInput").addClass("error");
			bError= true;
		} else {
			$("#fakeInput").removeClass("error");
		}

		if (bError) {
			$("#mensajes").html("Error al enviar el formulario.<br>Verifique los campos en rojo.");
			return false;
		} else {
			$("#mensajes").html("Enviando formulario.<br>Por favor espere.");
			return true;
		}
	}

// ]]>
