Abrace =
{
	abrirDetalhes: function( id )
	{
		//debugger;
		var req = new Request.HTML(
		{
	   		url: site_url + '/abrace/detalhes/' + id,
	   		method: 'get',
			onSuccess: function( responseTree, responseElements, responseHTML, responseJavaScript )
			{
				
				Shadowbox.init({
			        // let's skip the automatic setup because we don't have any
			        // properly configured link elements on the page
			        skipSetup: true,
			        onFinish: function()
	        		{
						$$('img.fixPNG').each(Browser.fixPNG);
        			}
			    });

				Shadowbox.open({
				        player:     'html',
				        content:    responseHTML,
				        height:     626,
				        width:      614
				});
			}
		}).send( );
	},

	Enviar:  function(id)
	{

		submitForm =  function(){
			var width = 300;
		    var s = window.Shadowbox;
		    var t =  "Mensagem enviada com sucesso. Obrigado!";
		    s.open({
		        player:     'html',
		        content:    '<div style="padding-top:30px; padding-bottom:20px; text-align:center;color:#ffffff; font-size:14px">' + t + '</div><div style="width:'+width+'px; text-align:center;"><a href="javascript: function fecha(){}" onclick="Shadowbox.close()" style=" color:#ffffff;">FECHAR</a></div>',
		        width:      width,
		        height:     100
		    });
		};

		valida =  function () { 
				 new FormCheck('formular_busca', {
					submitByAjax: true,
	        		//ajaxResponseDiv: 'shadowbox',
	        		tipsClass: 'semBalao',
	        		onAjaxSuccess : submitForm,
	        		fieldErrorClass: 'fc-field-error',
	        		display :{
	        			 indicateErrors : 2,
	        			 scrollToFirst : false,
	        			 addClassErrorToField: 1
	        		}
	        	});

    	};

		//debugger;
		var req = new Request.HTML(
				{
			   		url: site_url + '/abrace/detalhes/' + id,
			   		method: 'get',
					onSuccess: function( responseTree, responseElements, responseHTML, responseJavaScript )
					{
						
						var options = {
					        enableKeys: false,
					        onFinish: valida
					    };
						
						Shadowbox.init(options);
		
						Shadowbox.open({
						        player:     'html',
						        content:    responseHTML,
						        height:     626,
						        width:      614
						});
						
					}
				}).send( );
	}

};