/*
 * jQuery LIGHTBOX RECIPIENTE v1.0
 *
 * Copyright (c) 2008 Mateus Reis Martins (Visualcom)
 * 
 * URI: http://www.visualcom.com.br
 * Description: exibe um ligthbox com um recipiente para carregar qualquer coisa dentro
 * Version: 3.0
 * Author: Mateus Reis Martins
 * Author URI: http://mateus.com4.com.br/
 *////////////////////////////////////////////////////////////////////////////////////////
function mLightbox(pagina) {
	includeCSS('scripts/vcom_lightbox/lightbox.js.css');
	alturaPag  = $("body").height();
	
	estilo = "height:"+alturaPag+"px;";
	estilo2 = "margin-top:500px;";
		
	$("body").prepend('<div id="jlightbox" style="'+estilo+'"><div id="boxLoad" style="'+estilo2+'"></div></div>');

	
	$("#boxLoad").load(pagina);
	$("#boxLoad").ajaxComplete(function() {
		$(".fechar").click(function () {
			$("#jlightbox").css({display:'none'});
			return false;
		});
		
		$(".agende").click(function(){
			$("#jlightbox").css({display:'block'});
			fPost('#fAgende')
			return false;
		});
	});

}

function includeCSS(arquivo) {
	$("head").prepend('<link href="'+arquivo+'" rel="stylesheet" type="text/css" />');
}

$(document).ready(function(){
	mLightbox("index.php?session=agende_visita.php&ajax");
});


