J(window).scroll(function() { if(J(window).scrollTop() == 0){ J("#scrollToTop").fadeOut("fast"); } else { if(J("#scrollToTop").length == 0){ J("body").append('
'+ ''+ '
'); } J("#scrollToTop").fadeIn("fast"); } }); J("#scrollToTop a").live("click", function(event){ event.preventDefault(); J("html,body").animate({scrollTop: 0}, "slow"); }); function checkFormQuickSearch(form) { if( (form.search.value.length > 0) && (form.search.value.length < 3) ) { alert("At least 3 characters are required for searching"); return false; } else return true; } function checkFormConnexion(theform) { if(!oblig(theform.pseudo,"Username")) { return false; } else if(!oblig(theform.password,"Password")) { return false; } else { return true; } } function AddFavoris() { if(window.confirm("Click OK to add this page to your bookmarks")) { if ((navigator.appName.indexOf("Microsoft",0)>=0) && (parseInt(navigator.appVersion)>=4)) { window.external.AddFavorite(location.href, document.title); } else { alert("This function is avalaible only with Internet Explorer 4 +. But you can do CTRL + D to add this page to your bookmarks.") } } } function oblig(inputObject,inputName) { if(inputObject.value == "") { alert("Warning, "+inputName+" is required"); inputObject.focus(); return false; } return true; } function voteForQuizz(form,idQuizz) { var txtMessage = form.message.value; if( txtMessage == "Add a comment...") txtMessage = ''; var confidentialite = "public"; if( (txtMessage == "") && (form.notes.value == "") ) { alert("Please rate and/or comment this quiz !");return false;} if(form.estauteur.value == "1") confidentialite="public"; else if(form.confidentialite[1].checked) confidentialite="prive"; //document.getElementById("bouton_submit_note").disabled="disabled"; ajaxMe("/ajax/persistence.php","act=loading","div_submit_note"); ajaxMe("/ajax/getBarre.php","INFB=0&act=avis-add&id="+idQuizz+"¬es="+form.notes.value+"&confidentialite="+confidentialite+"&message="+escapeMe(txtMessage),"barre_reaction"); return false; } function checkSelectCat(select) { if(select.options[select.options.selectedIndex].value == "0") {alert("You have selected a theme, you mist choose a category inside this theme !"); return false; } else if(select.options[select.options.selectedIndex].value == "") {alert("Please select a category !"); return false; } return true; } function messageErreur(champ) { var inputName = champ; var message = "Warning, "+inputName+" is required"; return message; } // Convert smileys code to smileys img function convertToSmileys(message) { var image; var code; var tabSmileys = new Object(); tabSmileys[">:("] = "emo_narked"; tabSmileys[">:("] = "emo_narked"; tabSmileys[">:-("] = "emo_narked"; tabSmileys[">:-("] = "emo_narked"; tabSmileys[":-)"] = "smile"; tabSmileys[":-)"] = "smile"; tabSmileys[":-P"] = "tongue"; tabSmileys[":-P"] = "tongue"; tabSmileys[";-)"] = "wink"; tabSmileys[";-)"] = "wink"; tabSmileys[":-D"] = "biggrin"; tabSmileys[":-D"] = "biggrin"; tabSmileys["8-)"] = "cool"; tabSmileys["8-)"] = "cool"; tabSmileys["8)"] = "cool"; tabSmileys["8)"] = "cool"; tabSmileys["o.O"] = "confused"; tabSmileys["o.O"] = "confused"; tabSmileys["(y)"] = "ok"; tabSmileys["(y)"] = "ok"; tabSmileys["(Y)"] = "ok"; tabSmileys["(Y)"] = "ok"; tabSmileys["<3"] = "heart"; tabSmileys["<3"] = "heart"; tabSmileys[":)"] = "smile"; tabSmileys[":)"] = "smile"; tabSmileys[";)"] = "wink"; tabSmileys[";)"] = "wink"; tabSmileys[":D"] = "biggrin"; tabSmileys[":D"] = "biggrin"; tabSmileys[":upsidown:"] = "upsidown"; tabSmileys[":upsidown:"] = "upsidown"; tabSmileys[":p"] = "tongue"; tabSmileys[":p"] = "tongue"; tabSmileys[":ok:"] = "ok"; tabSmileys[":ok:"] = "ok"; tabSmileys[":cheerleader:"] = "cheerleader"; tabSmileys[":cheerleader:"] = "cheerleader"; tabSmileys[":supernice:"] = "supernice"; tabSmileys[":supernice:"] = "supernice"; tabSmileys[":yes:"] = "yes"; tabSmileys[":yes:"] = "yes"; tabSmileys[":cool:"] = "cool"; tabSmileys[":cool:"] = "cool"; tabSmileys[":confused:"] = "confused"; tabSmileys[":confused:"] = "confused"; tabSmileys[":o"] = "redface"; tabSmileys[":o"] = "redface"; tabSmileys[":rolleyes:"] = "rolleyes"; tabSmileys[":rolleyes:"] = "rolleyes"; tabSmileys[":rougir:"] = "rougir"; tabSmileys[":rougir:"] = "rougir"; tabSmileys[":sweatdrop:"] = "sweatdrop"; tabSmileys[":sweatdrop:"] = "sweatdrop"; tabSmileys[":eek:"] = "eek"; tabSmileys[":eek:"] = "eek"; tabSmileys[":("] = "frown"; tabSmileys[":("] = "frown"; tabSmileys[":surprise:"] = "surprise"; tabSmileys[":surprise:"] = "surprise"; tabSmileys[":emo_narked:"] = "emo_narked"; tabSmileys[":emo_narked:"] = "emo_narked"; tabSmileys[":hothead:"] = "hothead"; tabSmileys[":hothead:"] = "hothead"; tabSmileys[":drool:"] = "drool"; tabSmileys[":drool:"] = "drool"; tabSmileys[":no:"] = "no"; tabSmileys[":no:"] = "no"; tabSmileys[":-("] = "sad"; tabSmileys[":-("] = "sad"; tabSmileys[":'("] = "cry"; tabSmileys[":'("] = "cry"; tabSmileys[":dead:"] = "dead"; tabSmileys[":dead:"] = "dead"; tabSmileys[":bye:"] = "bye"; tabSmileys[":bye:"] = "bye"; tabSmileys[":-*"] = "kiss"; tabSmileys[":-*"] = "kiss"; tabSmileys[":snail:"] = "snail"; tabSmileys[":snail:"] = "snail"; tabSmileys[":frog:"] = "frog"; tabSmileys[":frog:"] = "frog"; tabSmileys[":frogg:"] = "frogg"; tabSmileys[":frogg:"] = "frogg"; tabSmileys[":et:"] = "et"; tabSmileys[":et:"] = "et"; tabSmileys[":chicken:"] = "chicken"; tabSmileys[":chicken:"] = "chicken"; tabSmileys[":chimp:"] = "chimp"; tabSmileys[":chimp:"] = "chimp"; tabSmileys[":cafe:"] = "cafe"; tabSmileys[":cafe:"] = "cafe"; tabSmileys[":vine:"] = "vine"; tabSmileys[":vine:"] = "vine"; tabSmileys[":light:"] = "light"; tabSmileys[":light:"] = "light"; tabSmileys[":gift:"] = "present"; tabSmileys[":gift:"] = "present"; tabSmileys[":baloon:"] = "baloon"; tabSmileys[":baloon:"] = "baloon"; tabSmileys[":cake:"] = "cake"; tabSmileys[":cake:"] = "cake"; tabSmileys[":heart:"] = "heart"; tabSmileys[":heart:"] = "heart"; tabSmileys[":night:"] = "night"; tabSmileys[":night:"] = "night"; tabSmileys[":stars:"] = "stars"; tabSmileys[":stars:"] = "stars"; tabSmileys[":sun:"] = "sun"; tabSmileys[":sun:"] = "sun"; tabSmileys[":champ:"] = "champ"; tabSmileys[":champ:"] = "champ"; for(var key in tabSmileys) { code = key; image = tabSmileys[key]; //alert(code+" "+image); message = Remplace(message,code,""); } return message; } function checkFormInscriptionComplete(scope) { var theform = document.forms['questionnaire']; var messageErreur2 = "The password confirmation has failed"; var messageErreur3 = "Please fill email correctly"; var messageErreur4 = "If you disagree with our conditions of use, you will not be registered"; var messageErreur5 = "To use our services, you must allow Quiz.biz to use your future quiz for commercial purposes"; var messageErreur6 = "Your login and password cannot be the same"; if(typeof scope === "undefined") { uploadImg_checkForm(theform); } // tests infos sur compte if(theform.pseudo.value == "") { alert(messageErreur("Username")); theform.pseudo.focus(); return false; } if(theform.pseudo.value.length < 2) { alert("Beware, your nickname is too small"); theform.pseudo.focus(); return false; } if(theform.pseudo.value.length > 20) { alert("Beware, your nickname is too long"); theform.pseudo.focus(); return false; } var exp=new RegExp("^[-.a-zA-Z0-9]*$","g"); if(!exp.test(theform.pseudo.value)) { alert("Beware, your nickname contains a character not allowed"); theform.pseudo.focus(); return false; } if(theform.password.value == "") { alert(messageErreur("Password")); theform.password.focus(); return false; } if(theform.password.value == theform.pseudo.value) { alert("Your login and password cannot be the same"); theform.password.focus(); return false; } if(theform.email.value == "") { alert(messageErreur("Email")); theform.email.focus(); return false; } if (!convertEmail(theform.email.value)) { alert(messageErreur3); theform.email.focus(); return false; } if((scope != 'resultats-quizz') && theform['code']) { if(theform.code.value == "") { alert("Please fill code with the 4 numbers displayed"); theform.code.focus(); return false; } } if( (typeof theform.charte !== 'undefined') && (theform.charte.checked == false) ) { alert(messageErreur4); theform.charte.focus(); return false; } if(document.getElementById('fichierImage_1')) { if(!checkMultiFile()) {return false;} } // tout est bon, envoi des infos return true } function openCharte() { window.open('https://www.quiz.biz/langs/en_charte.html','charte','width=700,height=500,scrollbars=yes') } function delFavoris(nom,id,type) { if(window.confirm('Are you sure you want to remove '+nom+' from your favorites ?')) document.location='https://www.quiz.biz/compte/favoris.php?act=del&id='+id+'&type='+type; } function cacherAvis(idQuizz,idAvis,act,off,theOption) { var div='barre_result'; if(idQuizz != 0) div='barre_reaction'; if(act == 'avis-del') ajaxMe('/ajax/getBarre.php','INFB='+INFB+'&act='+act+'&id_avis='+idAvis+'&id='+idQuizz+'&off='+off+'&option='+theOption,div); else if(window.confirm('Do you really want to hide this reaction ?')) ajaxMe('/ajax/getBarre.php','INFB='+INFB+'&act='+act+'&id_avis='+idAvis+'&id='+idQuizz+'&off='+off+'&option='+theOption,div); } function supprimerReply(idQuizz,idReply) { ajaxMe('/ajax/getBarre.php','INFB='+INFB+'&act=del-reply&id_reply='+idReply+'&id='+idQuizz,'reply_'+idReply); }