function get_wnd(path) { window.open(path,'','width=700,height=600,scrollbars=yes,resizable=yes'); } function get_wnd1(path) { path = "window.html?win="+path; window.open(path,'','width=700,height=600,scrollbars=yes,resizable=yes'); } function linkjumpto() { tmp=document.references.services.options[document.references.services.selectedIndex].value; document.location.href=tmp; } function linkjumpto2() { tmp=document.allreferences.allservices.options[document.allreferences.allservices.selectedIndex].value; document.location.href=tmp; } function game_fct(id,lang) { Rep=0; if(document.game_frm.Rep[0].checked){Rep=document.game_frm.Rep[0].value;} if(document.game_frm.Rep[1].checked){Rep=document.game_frm.Rep[1].value;} if(document.game_frm.Rep[2].checked){Rep=document.game_frm.Rep[2].value;} tmp="site/game.html?lang=&Rep="+Rep+"&id="+id; window.open(tmp,'','resizable=1,toolbar=no,status=no,scrollbars=yes,location=no,menubar=no,width=550,height=450'); } function pop_print() { tmp="print.html"; window.open(tmp,'','resizable=no,toolbar=no,status=no,scrollbars=no,location=no,menubar=no,width=1,height=1,top=500000,left=500000'); } function popLawyer(id) { tmp = "findLawyer.html?law="+id; get_wnd(tmp); } function subform() { if(document.formsearch.search.value.length <= 0) { alert('Please encode a keyword !'); return false; } else { document.formsearch.submit(); } } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function onSubmitSupport() { var hError = "There was error with some fields;\nPlease make the following corrections:\n\n"; var sError = ""; sError = sError + CheckEmail("mail_support","E-Mail Address"); if(sError.length > 0) { alert(hError+sError); return false; } return true; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function checkFormNews18() { var hError = "There was error with some fields;\nPlease make the following corrections:\n\n"; var sError = ""; sError = sError + CheckInputText("lastname","Name"); sError = sError + CheckInputText("firstname","Firstname"); sError = sError + CheckEmail("mail","E-Mail Address"); if(sError.length > 0) { alert(hError+sError); return false; } return true; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function checkFormPage41() { var hError = "There was error with some fields;\nPlease make the following corrections:\n\n"; var sError = ""; sError = sError + CheckInputText("name","Name"); sError = sError + CheckInputText("firstname","Firstname"); sError = sError + CheckInputText("phone","Phone"); sError = sError + CheckInputText("question","Your question"); sError = sError + CheckEmail("mail","E-Mail Address"); if(sError.length > 0) { alert(hError+sError); return false; } return true; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function checkFormPage25() { return checkFormPage67(); } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function checkFormPage67() { var hError = "There was error with some fields;\nPlease make the following corrections:\n\n"; var sError = ""; sError = sError + CheckInputText("name","Name"); sError = sError + CheckInputText("firstname","Firstname"); sError = sError + CheckEmail("mail","E-Mail Address"); sError = sError + CheckInputText("phone","Phone"); if(sError.length > 0) { alert(hError+sError); return false; } return true; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function checkFormWin39() { var hError = "There was error with some fields;\nPlease make the following corrections:\n\n"; var sError = ""; sError = sError + CheckInputText("name","Name"); sError = sError + CheckInputText("firstname","Firstname"); sError = sError + CheckEmail("mail","E-Mail Address"); if(sError.length > 0) { alert(hError+sError); return false; } return true; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function CheckInputText(elem,label) { var input = document.getElementById(""+elem+""); var label = label; if(label.charAt(0) == '*') label = label.substring(1,label.length); if(input.value.length <= 0) return ' -The "'+label+'" field was empty.\n'; return ''; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function CheckEmail(elem,label) { var input = document.getElementById(""+elem+""); var label = label; if(!label) return ''; if(input.value.length <= 0) return ' -The "'+label+'" field was empty.\n'; var check_email = emailCheck(input.value); pos1=input.value.indexOf("@"); pos2=input.value.lastIndexOf("."); pos = pos2 - pos1; //if ( (pos1==-1||pos1==0||pos1==input.value.length-1) || (pos2==-1||pos2==0||pos2==input.value.length-1) || (pos < 2)) return ' -Wrong e-mail format for "'+label+'" (ex: info@4your.net).\n'; if(!check_email) return ' -Wrong e-mail format for "'+label+'" (ex: info@4your.net).\n'; return ''; } /* - - - - - - - - - - - - - - - - - - - - - - -*/ function emailCheck (emailStr) { /* The following pattern is used to check if the entered e-mail address fits the user@domain format. It also is used to separate the username from the domain. */ var emailPat=/^(.+)@(.+)$/ /* The following string represents the pattern for matching all special characters. We don't want to allow special characters in the address. These characters include ( ) < > @ , ; : \ " . [ ] */ var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]" /* The following string represents the range of characters allowed in a username or domainname. It really states which chars aren't allowed. */ var validChars="\[^\\s" + specialChars + "\]" /* The following pattern applies if the "user" is a quoted string (in which case, there are no rules about which characters are allowed and which aren't; anything goes). E.g. "jiminy cricket"@disney.com is a legal e-mail address. */ var quotedUser="(\"[^\"]*\")" /* The following pattern applies for domains that are IP addresses, rather than symbolic names. E.g. joe@[123.124.233.4] is a legal e-mail address. NOTE: The square brackets are required. */ var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/ /* The following string represents an atom (basically a series of non-special characters.) */ var atom=validChars + '+' /* The following string represents one word in the typical username. For example, in john.doe@somewhere.com, john and doe are words. Basically, a word is either an atom or quoted string. */ var word="(" + atom + "|" + quotedUser + ")" // The following pattern describes the structure of the user var userPat=new RegExp("^" + word + "(\\." + word + ")*$") /* The following pattern describes the structure of a normal symbolic domain, as opposed to ipDomainPat, shown above. */ var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$") /* Finally, let's start trying to figure out if the supplied address is valid. */ /* Begin with the coarse pattern to simply break up user@domain into different pieces that are easy to analyze. */ var matchArray=emailStr.match(emailPat) if (matchArray==null) { /* Too many/few @'s or something; basically, this address doesn't even fit the general mould of a valid e-mail address. */ alert("Email address seems incorrect (check @ and .'s)") return false } var user=matchArray[1] var domain=matchArray[2] // See if "user" is valid if (user.match(userPat)==null) { // user is not valid alert("The username doesn't seem to be valid.") return false } /* if the e-mail address is at an IP address (as opposed to a symbolic host name) make sure the IP address is valid. */ var IPArray=domain.match(ipDomainPat) if (IPArray!=null) { // this is an IP address for (var i=1;i<=4;i++) { if (IPArray[i]>255) { alert("Destination IP address is invalid!") return false } } return true } // Domain is symbolic name var domainArray=domain.match(domainPat) if (domainArray==null) { alert("The domain name doesn't seem to be valid.") return false } /* domain name seems valid, but now make sure that it ends in a three-letter word (like com, edu, gov) or a two-letter word, representing country (uk, nl), and that there's a hostname preceding the domain or country. */ /* Now we need to break up the domain to get a count of how many atoms it consists of. */ var atomPat=new RegExp(atom,"g") var domArr=domain.match(atomPat) var len=domArr.length if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) { // the address must end in a two letter or three letter word. alert("The address must end in a three-letter domain, or two letter country.") return false } // Make sure there's a host name preceding the domain. if (len<2) { var errStr="This address is missing a hostname!" alert(errStr) return false } // If we've gotten this far, everything's valid! return true; } function get_wnd(path) { window.open(path,'','width=700,height=600,scrollbars=yes,resizable=yes'); } function linkjumpto() { tmp=document.references.services.options[document.references.services.selectedIndex].value; document.location.href=tmp; } function linkjumpto2() { tmp=document.allreferences.allservices.options[document.allreferences.allservices.selectedIndex].value; document.location.href=tmp; }