/*
 * lanacion.com - 2008
 */


jQuery.fn.Grafo = function(nota) {

	//alert("Nota recibida: "+nota);
	return this.each(function(){
		var container = jQuery(this);
		//container.find("p.loading").remove();
		//container.removeClass("csw").addClass("stripViewer");

		container.each(function(i) {
			jQuery("div#grafos a").click(function(){

				jQuery("body .noprint").hide();
				jQuery("body #contenedorPie").hide();
				jQuery("body #contenedor").hide();
				jQuery("body .copyright").hide();
				jQuery("body #scripts").hide();
				jQuery("body").css("overflow", "hidden");

				jQuery("body").prepend("<div id='gfc'><iframe src='/herramientas/grafo/app/grafo.asp?nota_id="+nota+"&grafo=1' frameborder='0' scrolling='no' width='100%' height='100%'></iframe></div>").show();
				jQuery("#gfc").css("height", jQuery(window).height());
				jQuery("#gfc").css("width", jQuery("body").width());
				jQuery("#gfc").before("<div class='cerrarGrafo'><a href='#'><b>Cerrar</b></a><img src='/herramientas/grafo/app/logoLabs.gif' /><h1>A quien le interesó esta nota además leyó</h1></div>");
				
				jQuery("body .cerrarGrafo").css("height","35px");
				jQuery("body .cerrarGrafo").css("background","#fff");
				jQuery("body .cerrarGrafo").css("padding", "5px 15px");
				jQuery("body .cerrarGrafo a").click(function(){$().closeGraf();});
				return false;
			});
		});

	});

};

jQuery.fn.closeGraf = function() {
	//alert("cierroooo");
	jQuery("#gfc").remove();
	jQuery("body .cerrarGrafo").remove();
	jQuery("body .noprint").show();
	jQuery("body #contenedor").show();
	jQuery("body #contenedorPie").show();
	jQuery("body .copyright").show();
	jQuery("body #scripts").show();
	jQuery("body").css("overflow", "auto");
};


