function insert_home(){ document.write(''); document.write(''); } function insert_top(){ document.write(''); document.write(''); } function validate(){ var num=document.form_convert.conv_amt.value; if (isNaN(num)) { alert('Number only, please!'); document.form_convert.conv_amt.focus(); return false; } else if (isNaN(parseFloat(num))){ alert('Number only, please!'); document.form_convert.conv_amt.focus(); return false; } } function check_login(){ var user=document.form_login.l_user; var pass=document.form_login.l_pass; if (user.value.length==0){ alert('Please enter a valid username!'); user.focus(); return false; } if (pass.value.length==0){ alert('Please enter a valid password!'); pass.focus(); return false; } } function check_form(){ var form=document.form_reg; if (form.r_name.value==''){ alert('Please fill in your name!'); form.r_name.focus(); return false; } if (form.r_contact.value==''){ alert('Please fill in your handphone no.!'); form.r_contact.focus(); return false; } if (form.r_email.value==''){ alert('Please fill in a valid email!'); form.r_email.focus(); return false; } var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; if (filter.test(form.r_email.value)){ testresults=true } else { alert('Please fill in a valid email!') form.r_email.focus() return false } } function display_create() { var body=document.getElementById('create'); if (body) { if (body.style.display == 'none') { try { body.style.display = 'block'; } catch(e) { body.style.display='table-row'; } } else { body.style.display = 'none'; } } } function display_ele(ele) { var body=document.getElementById(ele); if (body) { if (body.style.display == 'none') { try { body.style.display = 'block'; } catch(e) { body.style.display='table-row'; } } else { body.style.display = 'none'; } } } function check_create(){ var cname=document.form_create.c_name; if (cname.value.length==0){ alert('Please enter new currency name!'); cname.focus(); return false; } var csymbol=document.form_create.c_symbol; if (csymbol.value.length==0){ alert('Please enter new currency symbol!'); csymbol.focus(); return false; } var cbuy=document.form_create.c_buy; if (cbuy.value.length==0){ alert('Please enter buy rate!'); cbuy.focus(); return false; } var csell=document.form_create.c_sell; if (csell.value.length==0){ alert('Please enter sell rate!'); csell.focus(); return false; } if (confirm('Confirm to create this new currency?')){ return true; } else { return false; } } function setid(val){ document.form_edit_curr.editid.value=val; document.form_edit_curr.submit(); } function setall(){ document.form_edit_curr.editall.value='all'; document.form_edit_curr.submit(); } function setmid(val){ document.form_newm.midn.value=val; document.form_newm.submit(); } function setmidc(val){ document.form_memc.midc.value=val; document.form_memc.submit(); } function set_apid(val){ document.form_app.apid.value=val; document.form_app.submit(); } function print_page(){ text=document; print(text); } function set_enid(val){ document.form_news.enid.value=val; document.form_news.submit(); } function set_dnid(val){ if (confirm('Confirm to delete this news?')){ document.form_news.enid.value=val; document.form_news.submit(); } else { return false; } }