// <![CDATA[
	$(document).ready(
		function() {
			if (es_IE6) { 
				DD_belatedPNG.fix('.transparente');
			}
			$('.cancion input').focus(
				function() {
					$(this).select();
				}
			);

			// centrar verticalmente
			function centroVert(lo_que) {
				var y = $(window).scrollTop() + $(window).height() / 2 - parseFloat($(lo_que).height()) / 2;
				$(lo_que).css({'top': y});
			}
			/* checkbox con estilo */
			/* los que ya estan checkeados */
			var alt_check = $('input.check').css('height');
			/* opacidad que valida */
			$('.check').css('filter', 'alpha(opacity=0)');
			$('.check').css('opacity', '0');
			$('input.check:checked').parent().css({'background-position' : '0 -' + alt_check});
			/* click */
			$('input.check').click(function() {
					if($(this).is(':checked')) {
						$(this).parent().css({'background-position' : '0 -' + alt_check});
					}
					else {
						$(this).parent().css({'background-position' : '0 0'});
					}
				}
			);
			
			opacidad('.subir', 0);
			
			/* subir archivos */
			if(es_IE) {
				$('.r-form-arch .subir').attr('size', '6');
			}
			
			/*
			$('.subir').change(function() {
				$(this).parent().children('.fondo-txt-img').children().text($(this).val());
			});
			*/
			
			$(window).scroll(
				function() {
					centroVert($('.lightbox'));
				}
			);
			
			$('#fon-lb').click(
				function() {	
					cierraLB('.lightbox');
					return false;
				}
			);
			
			// para abrir los laibos
			// muestraLB('#lb-1');
			// muestraLB('#lb-2');
		}
	);
	
	function cierraLB(quien) {
		$(quien).fadeOut('normal', function() {$('#fon-lb').fadeOut('normal');} );
		
		setTimeout(function(){
			$('.video, #flushin-meadows').show();
		}, 1000)
		/*
		if(es_IE) {

		}
		*/
	}
	
	// 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});
	}
	
	// lightbox
	function muestraLB(quien) {
		$('#fon-lb').css('width', $(window).width() + 'px');
		$('#fon-lb').css('height', $(document).height() + 'px');
		
		opacidad('#fon-lb', 70);
		centro(quien);
		
		$('.video, #flushin-meadows').hide();
		/*
		if(es_IE) {
		}
		*/
		
		$('#fon-lb').fadeIn('normal', function() {$(quien).fadeIn('normal');} );
	}
	
	function JS_mostrarMensajeComentario(sMensaje){
		$('div.comentar').slideUp().animate({opacity: 1.0}, 3000).slideDown();
		$('div.mensaje-comentario').children().html(sMensaje).slideDown().animate({opacity: 1.0}, 3000).slideUp();
	}
			
	function JS_mostrarMensajeCancion(sMensaje){
		frm = $('#frmcancion');
		
		frm.find('input:not([type=checkbox])').val('');
		$('#cont-arch').html('');
		
		/*
		frm.slideUp().animate({opacity: 1.0}, 3000).slideDown();
		frm.next().children().html(sMensaje).slideDown().animate({opacity: 1.0}, 3000).slideUp();
		*/
		sCerrar = '<h3 onclick="cierraLB(\'.lightbox\');" class="mouse">Cerrar</h3>';
		frm.slideUp().next().children().html(sMensaje + sCerrar).slideDown();
	}
			
	function JS_mostrarMensajeInvitacion(sMensaje){
		frm = $('#frminvite');
		
		frm.slideUp().animate({opacity: 1.0}, 3000).slideDown();
		frm.next().children().html(sMensaje).slideDown().animate({opacity: 1.0}, 3000).slideUp();
	}
	
	function JS_limpiarInvitacion(selector){
		$(selector).find('input:not([type=checkbox]), textarea').val('');
	}
// ]]>
