function GoToBottom(x) { xx=document.body.scrollHeight window.scrollTo(0,xx-x) } function ValNotEmail(field) { if (field.value=="") {return false} if (!field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.info)|(\.mobi)|(\.biz)|(\.org)|(\..{2,2}))$)\b/gi)) { field.className ="FormBack" field.focus() return (true) } return(false) } function GoToPage(newpage,url) { location=url+"&page="+newpage } function ValNotEmpty(field) { field.value=field.value.replace(/^\s*|\s*$/g,"") if (field.value=="") { field.focus() field.className ="FormBack" return (true) } return(false) } function ValidateForm(form) { form.error.value='' if (ValNotEmpty(form.SenderName)) { form.error.value='Zadejte jméno.' return(false) } if (ValNotEmpty(form.SenderSubj)) { form.error.value='Zadejte předmět.' return(false) } if (ValNotEmpty(form.SenderMail)==0) { if (ValNotEmail(form.SenderMail)) { form.error.value='Zadejte korekntě e-mail nebo údaj nevyplňujte.' return(false) } } if (ValNotEmpty(form.Contents)) { form.error.value='Zadejte text zprávy.' return(false) } if (ValNotEmpty(form.cinput)) { form.error.value='Zadejte kontrolní kód.' return(false) } form.action.value='saveItem' form.submit() return (true) }