function generateHtmlCode(form){
	form.htmlcode.value = '';
	
  if (form.option1.checked == true) {
    form.htmlcode.value +="<span style=\"font-family: 'trebuchet MS'; font-size: '26px'; font-weight: bold; color: #000;\" >Service mobiles</span>";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="\n";
    form.htmlcode.value +="<span style=\"font-family: 'trebuchet MS'; font-size: '26px'; font-weight: bold; color: #3b9802;\" >0 899 650 655*</span>";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="\n\n";
  }
  if (form.option2.checked == true) {
    form.htmlcode.value +="<span style=\"font-family: 'trebuchet MS'; font-size: '26px'; font-weight: bold; color: #000;\" >Service fixe ou fax</span>";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="\n";
    form.htmlcode.value +="<span style=\"font-family: 'trebuchet MS'; font-size: '26px'; font-weight: bold; color: #3b9802;\" >0 899 650 950*</span>";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="\n\n";
  }
  if (form.option3.checked == true) {
    form.htmlcode.value +="<span style=\"font-family: 'trebuchet MS'; font-size: '26px'; font-weight: bold; color: #000;\" >Service géo-localisation</span>";
    form.htmlcode.value +="<br />";    
    form.htmlcode.value +="\n";
    form.htmlcode.value +="<span style=\"font-family: 'trebuchet MS'; font-size: '26px'; font-weight: bold; color: #3b9802;\" >0 899 650 850*</span>";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="<br />";
    form.htmlcode.value +="\n\n";
  }
  
  form.htmlcode.value +="Service d\'annuaire inversé <a href='http://www.phoneannuaire.fr' target='_blank'>phone-annuaire</a>";
  form.htmlcode.value +="<br />";
  form.htmlcode.value +="\n";
  if(form.htmlcode.value != ''){
  	form.htmlcode.value +="<a href='http://www.phoneannuaire.fr/conditions-utilisation/' target='_blank'>*conditions générales d\'utilisation</a>";
  }
}

function isNumberKey(evt)
{
	var charCode = (evt.which) ? evt.which : event.keyCode
	if (charCode > 31 && (charCode < 48 || charCode > 57))
		return false;
	
	return true;
}

function getResponse(form) {
	var code = form.code.value;

	new Ajax.Request('get_response.php',   
	{    
		parameters: 'code=' + code,
		method:'get',                    
		onSuccess: function(transport) {
		var response = transport.responseText || ""; 
			$('responseAjax').value = response;
			if(response == '')
				alert('Désolé mais le numéro saisi n\'apparait pas dans notre base de données\n' + code);
			else
				$('divResponse').show();
		}
	}
	);
}

