      // JavaScript Document	
jQuery(document).ready(function(){
		var URLactual = "http://cefojor.sites.sapo.ao/";
		jQuery('.txt-menos').click( function ( ) 
		{				
			var _a = jQuery('.text').css('font-size');
			_a = (parseFloat(_a)-2);
			jQuery('.text').css('font-size',_a+'px');
		});
        
		jQuery('.txt-mais').click( function ( ) 
		{ 
			var _a = jQuery('.text').css('font-size');
			_a = (parseFloat(_a)+2);
			jQuery('.text').css('font-size',_a+'px');
		}); 
		jQuery('.enviar').click( function ( ) 
		{ 
			if(! jQuery('.caixa-enviar').is(":animated"));
			{
				jQuery('.caixa-enviar').slideToggle('slow');
				sendMailComments();
				return false;
			}
		});
        
		jQuery('.boton1').bind('click', function() {
				jQuery('.caixa-enviar').slideToggle('slow');
				return false;
		});
		
		jQuery('.boton1enviado').bind('click', function() {
				jQuery('.caixa-enviado').slideToggle('slow');
				return false;
		});
		 
		 var sendMailCommentsLimit = 500;
		 var sendSugestionCommentsLimit = 500;
		 
		jQuery('#sendMailCommentsLimit').html(sendMailCommentsLimit);
		jQuery('#sendSugestionCommentsLimit').html(sendSugestionCommentsLimit);
	 	function sendMailComments()
	 	{
		        var txt = jQuery('.campo-md').val();
				if(txt){
	        		var dif = sendMailCommentsLimit - txt.length;
				}
	        	if(dif<=0)
	        		{
	        			 jQuery('.campo-md').val(txt.substring(0, sendMailCommentsLimit));
	        		 	 jQuery('#sendMailCommentsLimit').html('0' );
	        		}
	        	else
	        		 jQuery('#sendMailCommentsLimit').html(dif );
	 	}
		
		function sendSugestionComments()
	 	{
		        var txt = jQuery('.campo-md2').val();
				if(txt){
	        		var dif = sendSugestionCommentsLimit - txt.length;
				}
	        	if(dif<=0)
	        		{
	        			 jQuery('.campo-md').val(txt.substring(0, sendSugestionCommentsLimit));
	        		 	 jQuery('#sendMailCommentsLimit').html('0' );
	        		}
	        	else
	        		 jQuery('#sendSugestionCommentsLimit').html(dif );
	 	}
 
 		sendMailComments();
		sendSugestionComments();
		jQuery('.campo-md').keyup( function () { sendMailComments()} );
		jQuery('.campo-md2').keyup( function () { sendSugestionComments()} );
		jQuery('.boton').click(
			function() {  
			
			jQuery('.boton').hide();
			jQuery('#submitSendMailLoader').show();
		
				function postjson(url,data,s,e) //
				{	
					jQuery.ajax({type:'POST',url:url,data:data,/*dataType:'json',*/success:s,error:e});
				}

				//postjson("http://www.google.com", jQuery(".caixa-enviar :input").serialize() , 
				postjson(URLactual+"classes/classes/SendMail.php", jQuery(".caixa-enviar :input").serialize() , 
					function(data){	
						if(data != "")
						{ 
							jQuery(".caixa-enviado").hide().show('slow');
							jQuery("#contactName").val('').removeClass( 'FieldFormError' );
							jQuery("#destino").val('').removeClass( 'FieldFormError' );
							jQuery(".campo-md").val('');
							jQuery('.caixa-enviar').slideToggle('slow');

						}
			 			jQuery('.boton').show();
						jQuery('#submitSendMailLoader').hide();
					},
					function (data) { 	
						jQuery(".menssagem-erro").html('Pedimos desculpa, ocorreu um erro de comunica&ccedil;ao').hide().show('slow'); 
						jQuery('.boton').show();
						jQuery('#submitSendMailLoader').hide();
					}
				);
			}
		);	

		jQuery('.botonSugestion').click(
			function() {  

			jQuery('.botonSugestion').hide();
			jQuery('#submitSendMailLoader').show();
		
				function postjson(url,data,s,e) //
				{	
					jQuery.ajax({type:'POST',url:url,data:data,/*dataType:'json',*/success:s,error:e});
				}

				//postjson("classes/sendMail.php", jQuery(".caixa-enviar :input").serialize() , 
				postjson(URLactual+"classes/classes/SendSugestion.php", jQuery(".caixa-enviar :input").serialize() , 
					function(data) {	
						if(data != "") { 
							jQuery("#contactName").val('').removeClass( 'FieldFormError' );
							jQuery("#destino").val('').removeClass( 'FieldFormError' );
							jQuery(".campo-md").val('');
						}
						jQuery(".menssagem-sucesso").hide().show('slow');
			 			jQuery('.botonSugestion').show();
						jQuery('#submitSendMailLoader').hide();
					},
					function (data) { 	
						jQuery(".menssagem-erro").html('Pedimos desculpa, ocorreu um erro de comunica&ccedil;ao').hide().show('slow'); 
						jQuery('.botonSugestion').show();
						jQuery('#submitSendMailLoader').hide();
					}
				);
			}
		);
 	}
 );
        
        
