/* --- desktomodel.com (c) 2001 January --- */ function checkchars() { var name = document.search.query.value; if (name.length < 3) { alert ("Please enter at least 3 symbols"); document.search.query.focus(); return false; } document.search.submit(); } var submittimes = 1; function checkmoresubmit() { submittimes = submittimes + 1; if ( submittimes > 2 ) return false; document.frmvote.subvote.submit(); } function emailcheck(email) { // illegal chars invalidchars = " /:,;" // not null if (email == "") { return false } // don't have illegal chars for (i = 0; i < invalidchars.length; i++) { badchar = invalidchars.charAt(i) if (email.indexOf(badchar, 0) != -1) { return false } } // where is place of "@" char? atpos = email.indexOf("@", 1) // @ char place must be more 1 position of email // require "@" char if (atpos == -1) { return false } // second "@" char not require if (email.indexOf("@", atpos + 1) != -1) { return false } // "." char not require after "@" char if (email.charAt(atpos + 1) == ".") { return false } // ".." chars not require after "@" char for (i = atpos; i < email.length; i++) { if ((email.charAt(i) == ".") && (email.charAt(i + 1) == ".")) { return false } } // finding last "." char for (i = atpos; i < email.length; i++) { if (email.charAt(i) == ".") { atpos = i } } // place of last "." char periodpos = email.indexOf(".", atpos) // require "." char if (periodpos == -1) { return false } // require 2 or 3 chars for first level domain if (periodpos + 3 > email.length) { return false } // require 2 or 3 chars for first level domain if (email.length > periodpos + 4 ) { return false } return true } function loadform() { var title = document.ecard.title.value; var sname = document.ecard.sname.value; var semail = document.ecard.semail.value; var yname = document.ecard.yname.value; var yemail = document.ecard.yemail.value; var message = document.ecard.message.value; if (title == "") { alert ("Please input Title"); document.ecard.title.focus(); document.ecard.title.select(); return ; } if (message == "") { alert ("Please input Message"); document.ecard.message.focus(); document.ecard.message.select(); return ; } if (yname == "") { alert ("Please input your name"); document.ecard.yname.focus(); document.ecard.yname.select(); return ; } if (yemail == "") { alert ("Please input your e-mail"); document.ecard.yemail.focus(); document.ecard.yemail.select(); return ; } if (sname == "") { alert ("Please input recipient name"); document.ecard.sname.focus(); document.ecard.sname.select(); return ; } if (semail == "") { alert ("Please input recipient e-mail"); document.ecard.semail.focus(); document.ecard.semail.select(); return ; } if (!emailcheck(yemail)) { alert ("Please input correct e-mail"); document.ecard.yemail.focus(); document.ecard.yemail.select(); return ; } if (!emailcheck(semail)) { alert ("Please input correct e-mail"); document.ecard.semail.focus(); document.ecard.semail.select(); return ; } document.ecard.submit(); } }