var popupLinkConfig = new Array; var popupLinkConfig = new Array; popupLinkConfig["tellafriend"] = new Array("", "scrollbars=yes,status=no, resizable,width=566,height=615"); popupLinkConfig["customerservice"] = new Array("", "scrollbars=yes,status=yes,resizable,width=600,height=615"); popupLinkConfig["faq"] = new Array("", "scrollbars=yes,status=no, resizable,width=566,height=615"); popupLinkConfig["signup"] = new Array("", "scrollbars=yes,status=yes,resizable,width=600,height=615"); popupLinkConfig["login"] = new Array("", "scrollbars=yes,status=yes,resizable,width=600,height=615"); popupLinkConfig["help"] = new Array("", "scrollbars=yes,status=yes,resizable,width=600,height=615"); popupLinkConfig["tariffnotice"] = new Array("", "scrollbars=no,status=no,resizable,width=350,height=400"); popupLinkConfig["preselect"] = new Array("", "scrollbars=no,status=no,resizable,width=350,height=400"); popupLinkConfig["comments"] = new Array("", "scrollbars=no,status=no,resizable,width=350,height=400"); popupLinkConfig["preselectinfo"] = new Array("", "scrollbars=no,status=no,resizable,width=350,height=400"); var fault_mac = 'Functionality does not work on MAC: \n Please bookmark the site manually.'; var fault_no_mie = 'Functionality requires Microsoft Internet Explorer V4.0 (or higher): \n Please bookmark the site manually.'; function initPopupLinks() { if (!document.getElementsByTagName) { return true; } var pageLinks = document.getElementsByTagName("a"); for (var i = 0; i < pageLinks.length; i++) { if ( ((pageLinks[i].className != null) && (pageLinks[i].className != "") ) || ((pageLinks[i].parentNode.className != null) && (pageLinks[i].parentNode.className != ""))) { var linkClass = " " + pageLinks[i].className + " "; if ((linkClass == " ") && (pageLinks[i].parentNode.className != "")) { linkClass = " " + pageLinks[i].parentNode.className + " "; } for (var theKey in popupLinkConfig) { if (linkClass.indexOf(" " + theKey + " ") > -1) { if ((pageLinks[i].target == "") || (pageLinks[i].target == null)) { pageLinks[i].target = (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : theKey; } pageLinks[i].settings = popupLinkConfig[theKey][1]; pageLinks[i].onclick = popUp; } } } } return true; } window.onload = initPopupLinks; function popUp() { newWin = window.open(this.href, this.target, this.settings); newWin.focus(); return false; } function bookmark(website, title) { /*Note: bookmarking is only allowed with IE 4.0 or higher and not on a MAC var website must start with 'http://' in order to work properly!!! */ var ver = navigator.appVersion; ver = ver.substr(0, ver.indexOf('(')-1); var num = parseFloat(ver); if ((navigator.platform!="MacPPC") && (navigator.appName=="Microsoft Internet Explorer") && (num>=4)) { window.external.addFavorite(website,title); } else { if (navigator.platform=="MacPPC") { alert(fault_mac); } if ((navigator.appName!="Microsoft Internet Explorer") || (navigator.appVersion<4)) { alert(fault_no_mie); } } } function open_customerservice() { window.open('customerservice/customerservice_index.php', 'Customer Services','toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no,width=480,height=360,top=100,left=200'); return false; } function open_faq() { window.open('customerservice/customerservice_question_index.php?frominfo=true', 'FAQ','toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no,width=480,height=360,top=100,left=200'); return false; } function open_tellafriendemail() { window.open('tellafriend_email.php', 'Vertelhetdoor','toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no,width=480,height=360,top=100,left=200'); return false; } function open_tellafriendphone() { window.open('tellafriend/tellafriend_phone.php', 'Vertelhetdoor','toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no,width=600,height=500,top=100,left=200'); return false; } function open_tellafriendsms() { window.open('tellafriend/tellafriend_sms.php', 'Vertelhetdoor','toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no,width=600,height=500,top=100,left=200'); return false; } function open_printrates() { window.open('printrates.php','tarife','scrollbars=yes, status=yes, menubar=yes, toolbar=yes, location=no, resizable=yes, width=700,height=450'); return false; } function open_pop_callcharges() { window.open('tariffnotice.php','tariffnotice','toolbar=no,directories=no,status=no,scrollbars=no,resize=no,menubar=no,width=480,height=360,top=100,left=200'); } function isEmail(address) { var isValid = false; // basic checks (relying on lazy evaluation for correct behaviour!) // not empty // at least 7 characters (x@yy.zz) // has @ // has only 1 @ // has at least one . (domain.ext) isValid = (address!=null) && (address.length >= 7) && (address.indexOf('@')!=-1) && (address.indexOf('@') == address.lastIndexOf('@')) && (address.indexOf('.')!=-1) ; if (isValid) { var parts = address.split('@'); var name = parts[0].split('.'); var host = parts[1].split('.'); var regName = new RegExp("^([!#$%&'*+-/0-9=?A-Z^_a-z{}~]+)$"); // at least length 1 var regLabel = new RegExp("^(^[-0-9A-Za-z][-0-9A-Za-z]+)$"); // at least length 2 var regExt = new RegExp("^([A-Za-z]{2,63})$"); // at least length 2 var i; for (i=0; i < name.length; i++) { isValid = isValid && (name[i].search(regName) != -1); } for (i=0; i < host.length-1; i++) { isValid = isValid && (host[i].search(regLabel) != -1) && (host[i].length <= 63); } isValid = isValid && (host[host.length-1].search(regExt) != -1); } return isValid; } function noenter() { return !(window.event && window.event.keyCode == 13); } function checkNews() { var emailaddress = document.newslettersub.email.value; if (isEmail(emailaddress)) document.newslettersub.submit(); else { alert('Your emailaddress is incorrect'); return false; } } function checkNewsOff(thisform) { var emailaddress = document.newslettersuboff.email.value; if (isEmail(emailaddress)) document.newslettersuboff.submit(); else { alert('Your emailaddress is incorrect'); return false; } } function checkEmail2(thisform) { var emailaddress = thisform.email.value; if (isEmail(emailaddress)) return true; else { alert('Your emailaddress is incorrect'); return false; } } function CheckTellafriendForm() { var InputName = document.tellafriend_form.name.value; var InputEmail = document.tellafriend_form.email.value; var InputFriend1 = document.tellafriend_form.emailfriend1.value; var InputFriend2 = document.tellafriend_form.emailfriend2.value; var InputFriend3 = document.tellafriend_form.emailfriend3.value; if ((InputName!='') && (InputEmail!='') && (InputFriend1!='')) { if (isEmail(InputEmail)){ if (isEmail(InputFriend1)) { if ((InputFriend2=='') || isEmail(InputFriend2)) { if ((InputFriend3=='') || isEmail(InputFriend3)) { document.tellafriend_form.submit(); } else { alert('The entered email address for friend ' + ' 3 ' + 'is incorrect.'); } } else { alert('The entered email address for friend ' + ' 2 ' + 'is incorrect.'); } } else { alert('The entered email address for friend ' + ' 1 ' + 'is incorrect.'); } } else { alert ('Your emailaddress is incorrect.'); } } else { alert ('Please fill out all mandatory fields.'); } }