﻿$().ready(function(){
	$('a.popup').click(function(){
		var url = $(this).attr('href');
		//var title = $(this).html();
		window.open(url, 'popup', 'resizable=yes,width=725,height=444,left=100,top=100,status=yes,scrollbars=yes');
		return false;
	});
	
	$('a.inline img').remove();
	$('a.inline').click(function(){
		// Obtenemos el href
		var href = $(this).attr('href');
		// Tiene ancla?
		var anchorpos = href.lastIndexOf('#');
		if (anchorpos != -1) {
			// Obtenemos ancla
			var anchor = href.substring(anchorpos);
			anchor = $(anchor);
			// Existe el nodo?
			if (anchor) {
				// mostramos-ocultamos el nodo
				if (anchor.css('display') == 'none') {
					anchor.slideDown();
				} else {
					anchor.slideUp();
				}
				return false;
			}
		}
		
		// No tiene ancla o nodo no encontrado,
		//	dejamos que el navegador vaya al enlace
		return true;
	});
});
