var openclose var i=1 var pos=17 var tearnumb=145 function readcookie() { if (document.cookie.length>0) { var mcookie=document.cookie.split("=") mvalue=mcookie[1].split("/") mname=unescape(mvalue[0]) mmail=unescape(mvalue[1]) document.riddle.realname.value=mname document.riddle.email.value=mmail } } function checkRequired() { var moptional=document.getElementById("optional"); var mnoanswer=document.getElementById("noanswer"); var myesanswer=document.getElementById("yesanswer"); var msubmit_answer=document.getElementById("submit_answer"); if (document.riddle.riddle_answer.value=="") { mnoanswer.style.display='inline'; myesanswer.style.display='none'; moptional.style.display='none'; return false; } else { var mdate=new Date("December 31, 2017"); var expiredate=mdate.toGMTString(); var mcookie="name="+escape(document.riddle.realname.value)+"/"+escape(document.riddle.email.value)+";expires="+expiredate; document.cookie=mcookie; mnoanswer.style.display='none'; moptional.style.display='none'; msubmit_answer.style.display='none'; myesanswer.style.display='block'; document.riddle.spamfltr.value=""; return true; } } function showform() { document.riddle.riddle_answer.value="" var msubmit_anc=document.getElementById("submit_anc"); msubmit_anc.blur(); var msubmit_answer=document.getElementById("submit_answer"); var msubmitans=document.getElementById("submitans"); var form=document.riddle; var moptional=document.getElementById("optional"); var mnoanswer=document.getElementById("noanswer"); var myesanswer=document.getElementById("yesanswer"); form.spamfltr.value=""; mnoanswer.style.display='none'; moptional.style.display='inline'; if ((msubmit_answer.style.display=='block')|| (myesanswer.style.display=='block')) { msubmit_answer.style.display='none'; msubmitans.src="images/submit_answer.png"; } else { msubmit_answer.style.display='block'; msubmitans.src="images/close_form.png"; if (document.cookie.length>0) { form.riddle_answer.focus(); } else { form.realname.focus(); } } myesanswer.style.display='none'; } function showyesterday() { var myest_anc=document.getElementById("yest_anc"); myest_anc.blur(); var myesterday=document.getElementById("yesterday"); var mshowans=document.getElementById("showans"); if (myesterday.style.display=='block') { myesterday.style.display='none'; stop_mp3(); mshowans.src="images/view_answer.png"; clearTimeout(c) clearTimeout(p) clearTimeout(d) clearTimeout(e) clearTimeout(f) clearTimeout(g) clearTimeout(h) clearTimeout(i) clearTimeout(j) clearTimeout(k) clearTimeout(l) clearTimeout(m) clearTimeout(n) clearTimeout(o) clearTimeout(d1) clearTimeout(e1) clearTimeout(f1) clearTimeout(g1) clearTimeout(h1) clearTimeout(i1) clearTimeout(j1) clearTimeout(k1) clearTimeout(l1) clearTimeout(m1) //hidepict() StopSound('sound1'); // StopSound('sound2'); } else { myesterday.style.display='block'; mshowans.src="images/hide_answer.png"; document.getElementById('whistlejpg').src="images/holiday/referee.jpg"; changeOpac(100,'whistlejpg') //play_mp3() //EvalSound('sound1') c=setTimeout("EvalSound('sound1')",400); p= setTimeout("refOpac()",2100); // c=setTimeout("EvalSound('sound2')",900); } } function txtarea_focus() { var moptional=document.getElementById("optional"); var mnoanswer=document.getElementById("noanswer"); var myesanswer=document.getElementById("yesanswer"); mnoanswer.style.display='none'; myesanswer.style.display='none'; moptional.style.display='inline'; } function email_change() { // check that Email address is in proper format var minvalidemail=document.getElementById("invalidemail"); var form = document.riddle; var the_at = form.email.value.indexOf("@"); var the_dot = form.email.value.lastIndexOf("."); var a_space = form.email.value.indexOf(" "); var a_comma = form.email.value.indexOf(","); if (form.email.value=="") { minvalidemail.style.display='none' } else { if ((the_at == -1) || // if there's no '@' (the_at == 0) || // or it's at position 0 (the_dot == -1) || // or there's no '.' (the_dot <= the_at + 1) || // or the '@' is after '.' (the_dot > form.email.value.length - 3) || // there is less than 2 char after the '.' (a_space !== -1) || // or there's a space (a_comma !== -1)) // or there's a comma { minvalidemail.style.display='inline'; } } } function closeform() { var msubmit_answer=document.getElementById("submit_answer"); msubmit_answer.style.display='none'; } function EvalSound(soundobj) { var thissound=document.getElementById(soundobj); thissound.Play(); } function StopSound(soundobj) { var thissound=document.getElementById(soundobj); thissound.Stop() } function play_mp3() { document.getElementById("mp3_span").innerHTML='
'; } function stop_mp3() { document.getElementById("mp3_span").innerHTML="" } function hidepict() { document.getElementById('pict').style.display="none"; changeOpac(5, 'pict') } function changeOpac(opacity, id) { var object = document.getElementById(id).style; object.opacity = (opacity / 100); object.MozOpacity = (opacity / 100); object.KhtmlOpacity = (opacity / 100); object.filter = "alpha(opacity=" + opacity + ")"; } function refOpac() { d=setTimeout("changeOpac(90,'whistlejpg')",100); e=setTimeout("changeOpac(80,'whistlejpg')",150); f=setTimeout("changeOpac(70,'whistlejpg')",200); g=setTimeout("changeOpac(60,'whistlejpg')",250); h=setTimeout("changeOpac(50,'whistlejpg')",300); i=setTimeout("changeOpac(40,'whistlejpg')",350); j=setTimeout("changeOpac(30,'whistlejpg')",400); k=setTimeout("changeOpac(20,'whistlejpg')",450); l=setTimeout("changeOpac(10,'whistlejpg')",500); m=setTimeout("changeOpac(0,'whistlejpg')",550); n=setTimeout("chagewhistle()",550); o=setTimeout("whistleOpac()",550); } function whistleOpac() { d1=setTimeout("changeOpac(10,'whistlejpg')",100); e1=setTimeout("changeOpac(20,'whistlejpg')",150); f1=setTimeout("changeOpac(30,'whistlejpg')",200); g1=setTimeout("changeOpac(40,'whistlejpg')",250); h1=setTimeout("changeOpac(50,'whistlejpg')",300); i1=setTimeout("changeOpac(60,'whistlejpg')",350); j1=setTimeout("changeOpac(70,'whistlejpg')",400); k1=setTimeout("changeOpac(80,'whistlejpg')",450); l1=setTimeout("changeOpac(90,'whistlejpg')",500); m1=setTimeout("changeOpac(100,'whistlejpg')",550); } function chagewhistle() { document.getElementById('whistlejpg').src="images/holiday/whistle.jpg"; }