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='