		function gE ( id )
		{
			return document.getElementById(id);
		}
	
    	window.addEvent('domready', function()
		{

			$$('div.indique').each(function(el){	
				var link = el.getElement('a');
				var block = (link.rel != "")? $(link.rel) : link.getNext();
				
				var fx = new Fx.Slide(block);

				fx.hide();
		
				link.addEvent('click', function(){
					fx.toggle();
				});
				
			});
			
			$$('img.indicarBtn').each(function(el)
			{
				var id = el.getProperty('id');
				/* VARIAVEIS */
				var SeuNome 		= gE('indique_seunome_'+id);
				var SeuEmail 		= gE('indique_seuemail_'+id);
				var IndiqueNome1	= gE('indique_n1_'+id);
				var IndiqueEmail1	= gE('indique_e1_'+id);
				var IndiqueNome2	= gE('indique_n2_'+id);
				var IndiqueEmail2	= gE('indique_e2_'+id);
				el.addEvent('click', function()
				{
					if ( SeuNome.value == "" || SeuNome.value == null )
					{
						alert("Informe o seu nome !");
						SeuNome.focus();
						return false;
					}
					if ( SeuEmail.value == "" || SeuEmail.value == null )
					{
						alert("Informe o seu e-mail !");
						SeuEmail.focus();
						return false;
					}
					else 
					{
						 var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
						 var returnval=emailfilter.test(SeuEmail.value)
						 if ( returnval == false ) 
						 {
						 	alert("Informe o seu e-mail corretamente !");
							SeuEmail.focus();
							return false;
						 }
					}

					$('resposta_idq_'+id).setHTML('Enviando... aguarde.');

					new Ajax("index.php/spolight/ajax/indicar/saude/"+id,

					{
						method:		'post',
						data:		$('indique_form_'+id),
						update:		$('resposta_idq_'+id),
						onSuccess:	function ()
						{
							SeuNome.value		= "";
							SeuEmail.value		= "";
							IndiqueNome1.value	= "";
							IndiqueEmail1.value = "";
							IndiqueNome2.value	= "";
							IndiqueEmail2.value = "";
						}
					}).request();
					
				});
			});

		});
		
		
		$$('img.indicarBtn2').each(function(el)
		{
			var id = el.getProperty('id');
			/* VARIAVEIS */
			var SeuNome 		= gE('2indique_seunome_'+id);
			var SeuEmail 		= gE('2indique_seuemail_'+id);
			var IndiqueNome1	= gE('2indique_n1_'+id);
			var IndiqueEmail1	= gE('2indique_e1_'+id);
			var IndiqueNome2	= gE('2indique_n2_'+id);
			var IndiqueEmail2	= gE('2indique_e2_'+id);
			el.addEvent('click', function()
			{
				if ( SeuNome.value == "" || SeuNome.value == null )
				{
					alert("Informe o seu nome !");
					SeuNome.focus();
					return false;
				}
				if ( SeuEmail.value == "" || SeuEmail.value == null )
				{
					alert("Informe o seu e-mail !");
					SeuEmail.focus();
					return false;
				}
				else 
				{
					 var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
					 var returnval=emailfilter.test(SeuEmail.value)
					 if ( returnval == false ) 
					 {
						alert("Informe o seu e-mail corretamente !");
						SeuEmail.focus();
						return false;
					 }
				}

				$('2resposta_idq_'+id).setHTML('Enviando... aguarde.');
				
				new Ajax("index.php/gianni/indicar/"+id,
				{
					method:		'post',
					data:		$('2indique_form_'+id),
					update:		$('2resposta_idq_'+id),
					onSuccess:	function ()
					{
						SeuNome.value		= "";
						SeuEmail.value		= "";
						IndiqueNome1.value	= "";
						IndiqueEmail1.value	= "";
						IndiqueNome2.value	= "";
						IndiqueEmail2.value	= "";
					}
				}).request();
				
			});
		});
