function switchMenu(obj) {
var el = document.getElementById(obj);
if ( el.style.display != 'none' ) {
el.style.display = 'none';
}
else {
el.style.display = '';
}
}
function compter(chaine) {
var exp=new RegExp("[a-zA-Z0-9éèêëàáâäóòôöíìîïçÉÈÊËÀÁÂÄÒÓÔÖÌÍÎÏÇ-]+","g");
var tabNom=chaine.match(exp);
if(tabNom==null) return 0;
return tabNom.length;
}
function verif_formulaire_reco()
{
if(document.myFormReco.firstname.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormReco.firstname.focus();
return false;
}
if(document.myFormReco.lastname.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormReco.lastname.focus();
return false;
}
if(document.myFormReco.email.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormReco.email.focus();
return false;
}
adresse = document.myFormReco.email.value;
var place = adresse.indexOf("@",1);
var point = adresse.indexOf(".",place+1);
if ((place > -1)&&(adresse.length >2)&&(point > 1))
{
}
else
{
window.alert("يرجى ملء كافة الخانات الضرورية");
document.myFormReco.email.focus();
return false;
}
if(document.myFormReco.email2.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormReco.email2.focus();
return false;
}
adresse2 = document.myFormReco.email2.value;
var place2 = adresse2.indexOf("@",1);
var point2 = adresse2.indexOf(".",place+1);
if ((place2 > -1)&&(adresse2.length >2)&&(point2 > 1))
{
formObjReco.submit();switchMenu('reco');
document.getElementById('ajoutereco').removeAttribute("href");
document.getElementById('ajoutereco2').removeAttribute("href");
document.getElementById('reco').innerHtml='';
}
else
{
window.alert("يرجى ملء كافة الخانات الضرورية");
document.myFormReco.email2.focus();
return false;
}
}
function verif_formulaire_comm()
{
if(document.myFormCommentVideo.pseudo.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormCommentVideo.pseudo.focus();
return false;
}
if(document.myFormCommentVideo.pseudo.value.length < 2 ){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormCommentVideo.pseudo.focus();
return false;
}
if(document.myFormCommentVideo.email.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormCommentVideo.email.focus();
return false;
}
adresse = document.myFormCommentVideo.email.value;
var place = adresse.indexOf("@",1);
var point = adresse.indexOf(".",place+1);
if ((place > -1)&&(adresse.length >2)&&(point > 1))
{
}
else
{
window.alert("يرجى ملء كافة الخانات الضرورية");
document.myFormCommentVideo.email.focus();
return false;
}
if(document.myFormCommentVideo.orthographe.checked == false) {
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormCommentVideo.orthographe.focus();
return false;
}
if(document.myFormCommentVideo.commentaire.value == ""){
window.alert('يرجى ملء كافة الخانات الضرورية');
document.myFormCommentVideo.commentaire.focus();
return false;
}
if(document.myFormCommentVideo.commentaire.value.length < 200) {
window.alert('تعليقك يجب أن يحتوي على 200 حرف على الأقل');
document.myFormCommentVideo.commentaire.focus();
return false;
}
else {
formObjCommentVideo.submit();switchMenu('addcomments');
}
}