function validCGC(){$("#cgc").css("display","none");$("#contactForm").css("display","block");$(document).scrollTop(0)}function updateCategory(elm){var iCategory_id=elm.options[elm.selectedIndex].value;var sThread_id=elm.name;if((iCategory_id!="")&&(sThread_id!="")){$("#sHotlineThread_id").val(sThread_id);$("#iHotlineCategory_id").val(iCategory_id);$("#updateCategory").submit()}}function insertMessage(elm){var iMessage_id=elm.options[elm.selectedIndex].value;if(iMessage_id!=""){$("#contentMessage").val("Chargement...");$.ajax({url:"/ajax.php?module=hotline&method=getMessage",data:{message_id:iMessage_id},type:"GET",success:function(response){$("#contentMessage").val("");$("#contentMessage").val(response.message);return response},dataType:"json"})}}$(document).ready(function(){$("#hotlineRecord").submit(function(){var sName=$("#hotlineThread_sName").val();var sEmail=$("#hotlineThread_sEmail").val();var sCategory=$("#hotlineCategory_id").val();var sMessage=$("#hotlineMessage_sContent").val();if(!sName.length>0){alert(hotlineRecordErrorContentEmpty);$("#hotlineThread_sName").focus();return false}if(!sEmail.length>0){alert(hotlineRecordErrorContentEmpty);$("#hotlineThread_sEmail").focus();return false}if(!sCategory.length>0||sCategory=="none"){alert(hotlineRecordErrorContentEmpty);$("#hotlineCategory_id").focus();return false}if(!sMessage.length>0){alert(hotlineRecordErrorContentEmpty);$("#hotlineMessage_sContent").focus();return false}var checkEmail=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(sEmail);if(!checkEmail){alert(hotlineRecordErrorEmail);$("#hotlineThread_sEmail").focus();return false}})});
