function updateHTML(id, val)
{ var elem = document.getElementById(id);
elem.innerHTML = val;
}
function firstword(v)
{ return v.split(" ")[0];
}
function choose_format(cellid)
{ elem=document.getElementById(cellid);
d=elem.innerHTML;
previd=document.getElementById('selcell').value;
prevcell=document.getElementById(previd);
if (!(prevcell==null))
prevcell.style.background='white';
document.getElementById(cellid).style.background='orange';
document.getElementById('selcell').value=cellid;
// get row and column from cellid
p=cellid.indexOf('R');
col=cellid.substr(0,p);
row=cellid.substr(p);
sc='C0'+row;
fmt=firstword(document.getElementById(sc).innerHTML);
if (row<'R4')
sc=col+'R0';
else
sc=col+'R4';
psize=firstword(document.getElementById(sc).innerHTML);
// try to match this specification
var t=fmt+' '+psize+' cm';
optlist=document.getElementById('item-options');
i=0;
while ( (i=0)
return false;
if (str.indexOf(",")>=0)
return false;
ereg=new RegExp("^.+@.+\\..+$");
return ereg.test(str);
}
function postit(form,flag)
{ switch (flag)
{ case 2:
if (form.fromemail.value.length==0)
{ alert("Please enter your email address");
form.fromemail.focus();
return false;
}
if (!check_email(form.fromemail.value))
{ alert("Please check your email address");
form.fromemail.focus();
return false;
}
if (form.fullname.value.length==0)
{ alert("Please tell us your name");
form.fullname.focus();
return false;
}
form.action="utils/galmailer.php";
reveal('sendbutton',false);
reveal('ack',true);
break;
default: return;
}
form.method="post"
form.submit();
}