Ecard =
{
	Responder:  function(card)
	{
		

	
		valida =  function () {
				 new FormCheck('formular_ecard', {
					submitByAjax: true, 
	        		tipsClass: 'semBalao',
	        		ajaxEvalScripts: true,
	        		ajaxResponseDiv: 'shadowbox_content',
	        		fieldErrorClass: 'fc-field-error',
	        		display :{
	        			 indicateErrors : 2,
	        			 scrollToFirst : false,
	        			 addClassErrorToField: 1
	        		}
	        	});
	        	
        	
    	};			
		
		//debugger;
		var req = new Request.HTML(
		{
	   		url: site_url + '/ajude/enviado/'+card,
	   		method: 'get',
	   		onSuccess: function( responseTree, responseElements, responseHTML, responseJavaScript )
			{ 
				var options = {
			        enableKeys: false,
			        onFinish: valida
			    };
				
				Shadowbox.init(options);
				
				Shadowbox.open({
				        player:     'html',
				        content:    responseHTML,
				        height:     662,
				        width:      614
				});
			}
		}).send( );
	},
	
	
	
	
	Enviar:  function(card)
	{
		
		submitForm =  function(){
			var width = 300;
		    var s = window.Shadowbox;	    
		    var t =  "Envio concluido 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_ecard', {
					submitByAjax: true, 
	        		tipsClass: 'semBalao',
	        		onAjaxSuccess : submitForm,
	        		ajaxEvalScripts: true,
	        		fieldErrorClass: 'fc-field-error',
	        		display :{
	        			 indicateErrors : 2,
	        			 scrollToFirst : false,
	        			 addClassErrorToField: 1
	        		}
	        	});
	        	
        	
    	};			
		
		
		
		//debugger;
		var req = new Request.HTML(
		{
	   		url: site_url + '/ajude/enviar/'+card,
	   		method: 'get',
	   		onSuccess: function( responseTree, responseElements, responseHTML, responseJavaScript )
			{ 
				var options = {
			        enableKeys: false,
			        onFinish: valida
			    };
				
				Shadowbox.init(options);
				
				Shadowbox.open({
				        player:     'html',
				        content:    responseHTML,
				        height:     662,
				        width:      614
				});
			}
		}).send( );
	},
	
	
	Gifts:  function(card)
	{
		
		/*submitForm =  function(){
			var width = 300;
		    var s = window.Shadowbox;	    
		    var t =  "Envio concluido 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_ecard', {
					submitByAjax: true, 
	        		tipsClass: 'semBalao',
	        		onAjaxSuccess : submitForm,
	        		ajaxEvalScripts: true,
	        		fieldErrorClass: 'fc-field-error',
	        		display :{
	        			 indicateErrors : 2,
	        			 scrollToFirst : false,
	        			 addClassErrorToField: 1
	        		}
	        	});
	        	
        	
    	};	*/		
		
		//debugger;
		
		new Request({
			url: site_url + '/ajude/gifts/'+card,
			onComplete: function(response)
			{
				Shadowbox.init({
					enableKeys: false,
					onFinish: function()
					{
						
					}
				});
				
				/*skipSetup: true,
    	onFinish: Whatishot.finishModal,
    	animate: false,
    	animateFade: false,
    	displayNav: false,
    	enableKeys:false,
    	modal:true*/
				
				Shadowbox.open({
				        player:     'html',
				        content:    response,
				        height:     405,
				        width:      530
				});
			}
		}).send();
		
		/*var req = new Request.HTML(
		{
	   		url: site_url + '/ajude/gifts/'+card,
	   		method: 'get',
	   		onSuccess: function( responseTree, responseElements, responseHTML, responseJavaScript )
			{ 
				var options = {
			        enableKeys: false,
			        onFinish: valida
			    };
				
				Shadowbox.init(options);
				
				Shadowbox.open({
				        player:     'html',
				        content:    responseHTML,
				        height:     405,
				        width:      530
				});
				
				//alert(responseHTML);
			}
		}).send( );*/
	}
};