$(document).ready(function () {


	$('a.galeria').lightBox({	imageBtnClose: 'imagenes/ligthbox/lightbox-cerrar.gif',
	imageBtnPrev: 'imagenes/ligthbox/lightbox-anterior.gif',
	imageBtnNext: 'imagenes/ligthbox/lightbox-siguiente.gif',
	txtImage: 'Im&aacute;gen',	txtOf: 'de'});


	// formularios marcados
	$(".marcados").focus(function() {
		$(this).parent().addClass("curFocus")
	});
	$(".marcados").blur(function() {
		$(this).parent().removeClass("curFocus")
	});

	generarRealPerson();

	/*
	$('.panel').animate({
	height: 'show',
	opacity: 'show'
	}, 2000, function() {
	// Animation complete.
	});

	*/

	//	var seccion = <?php echo $seccion; ?>;
	var seccion = getUrlVars()['sec']
	if (seccion == "" || !(seccion)) {
		seccion = 0;
	}
	$('.enlaces_menus').each(function(){
		var texto = "<div>( ";
		var pasa = false;
		var numero = 0;
		var actual = this;
		$('.enlaces_menus').each(function(){
			numero+=1;
			if (! ($(actual).hasClass('_tipo'+numero))) {
				if (pasa) {	texto += " - "};
				texto +='<a href="javascript:enlace('+numero+');">' + $(".tipo"+numero).html() + '</a>';
				pasa = true;
			}
		});
		texto +=" )</div>"
		$(this).html(texto)
	});
	if (seccion!= 0) {
		enlace(seccion)
	}


});

function enlace(id){
	$.scrollTo(".tipo"+id,1500)
}

function generarRealPerson(){
	$('#real').realperson({regenerate: 'Regenerar',includeNumbers: true,length: 6});

}
function getUrlVars() {
	var vars = {};
	var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {
		vars[key] = value;
	});
	return vars;
}

function enlacesInternos(){
	$(".interno").each(function(){
		var href = $(this).attr("href");
		$(this).attr({ href: "javascript:void(0);"});
		$(this).click(function(){
			$("#box").load(href, function() { $('html').animate( { scrollTop: 0 }, 'fast' );});
		});
	});


}

	function actualizarClick(Id){
		$.post("modulos/noticias/noticia_click.php", {'Id':escape(Id)})

	}

