$('document').ready(function() {
try
	{
	$("#txtqNEWSLETTER").blur(function() { if ($(this).val()=='') { $(this).val('Votre email...') }  return false;  });
  $("#txtqNEWSLETTER").focus(function() { if ($(this).val()=='Votre email...') { $(this).val('') }  return false; });

  $("#txtqINVITE").blur(function() { if ($(this).val()=='') { $(this).val('email de votre ami...') }  return false;  });
  $("#txtqINVITE").focus(function() { if ($(this).val()=='email de votre ami...') { $(this).val('') }  return false; });

  $("#txtqNOMINVITE").blur(function() { if ($(this).val()=='') { $(this).val('Votre nom...') }  return false;  });
  $("#txtqNOMINVITE").focus(function() { if ($(this).val()=='Votre nom...') { $(this).val('') }  return false; });
  
    $("#txtqFORMINVITE").submit(function() {
		if(!emailOK($("#txtqINVITE").val()))
			{
			$("#ErrtxtqINVITE").text("Adresse email incorrecte.").show().fadeOut(3000);
			$("#ErrtxtqINVITE").css('color', '#931d52');
			$("#ErrtxtqINVITE").css('font-size', '11px');
			$("#ErrtxtqINVITE").css('font-weight', 'bold');
			$("#ErrtxtqINVITE").css('padding-top', '5px');
			$("#txtqINVITE").select();
			}
		else
			{
			poststr = "email=" + encodeURIComponent( $("#txtqINVITE").val() ) + 
			"&nomsender=" + encodeURIComponent( $("#txtqNOMINVITE").val() );
			makePOSTRequest('/include/phpcalledbyajax/invite_friend.php', poststr, 'ErrtxtqINVITE');
			$("#ErrtxtqINVITE").text('').show();
			$("#ErrtxtqINVITE").css('color', '#931d52');
			$("#ErrtxtqINVITE").css('font-size', '10px');
			$("#ErrtxtqINVITE").css('font-weight', 'bold');
			$("#ErrtxtqINVITE").css('padding-top', '5px');
			}
      return false;
    });

    $("#txtqFORMNEWSLETTER").submit(function() {
		if(!emailOK($("#txtqNEWSLETTER").val()))
			{
			$("#ErrtxtqNEWSLETTER").text("Adresse email incorrecte.").show().fadeOut(2000);
			$("#ErrtxtqNEWSLETTER").css('color', '#931d52');
			$("#ErrtxtqNEWSLETTER").css('font-size', '11px');
			$("#ErrtxtqNEWSLETTER").css('font-weight', 'bold');
			$("#ErrtxtqNEWSLETTER").css('padding-top', '5px');
			$("#txtqNEWSLETTER").select();
			}
		else
			{
			poststr = "email=" + encodeURIComponent( $("#txtqNEWSLETTER").val() );
			makePOSTRequest('/include/phpcalledbyajax/add_newsletter.php', poststr, 'ErrtxtqNEWSLETTER');
			$("#ErrtxtqNEWSLETTER").text('').show();
			$("#ErrtxtqNEWSLETTER").css('color', '#931d52');
			$("#ErrtxtqNEWSLETTER").css('font-size', '10px');
			$("#ErrtxtqNEWSLETTER").css('font-weight', 'bold');
			$("#ErrtxtqNEWSLETTER").css('padding-top', '5px');
			}
      return false;
    });

  	}
catch(e)
	{}
})



/*
jQuery.get('/some/script.php', {'name': 'Simon'}, function(data) {
    alert('The server said: ' + data);
}); // GET against /some/script.php?name=Simon

jQuery.post('/some/script.php', {'name': 'Simon'}, function(data) {
    alert('The server said: ' + data);
}); // POST to /some/script.php

jQuery.getJSON('/some.json', function(json) {
    alert('JSON rocks: ' + json.foo + ' ' + json.bar);
}); // Retrieves and parses /some.json as JSON

jQuery.getScript('/script.js'); // GET and eval() /script.js
*/