function checkForMinimumInput(value, min) { if(value != "0.00") { if(value < min) { alert("Please fill in at least "+ min +" or 0.00"); return false; } else { return true; } } } /** * FlashObject v1.3c: Flash detection and embed - http://blog.deconcept.com/flashobject/ * * FlashObject is (c) 2006 Geoff Stearns and is released under the MIT License: * http://www.opensource.org/licenses/mit-license.php * */ if(typeof com == "undefined") var com = new Object(); if(typeof com.deconcept == "undefined") com.deconcept = new Object(); if(typeof com.deconcept.util == "undefined") com.deconcept.util = new Object(); if(typeof com.deconcept.FlashObjectUtil == "undefined") com.deconcept.FlashObjectUtil = new Object(); com.deconcept.FlashObject = function(swf, id, w, h, ver, c, useExpressInstall, quality, xiRedirectUrl, redirectUrl, detectKey){ if (!document.createElement || !document.getElementById) return; this.DETECT_KEY = detectKey ? detectKey : 'detectflash'; this.skipDetect = com.deconcept.util.getRequestParameter(this.DETECT_KEY); this.params = new Object(); this.variables = new Object(); this.attributes = new Array(); this.useExpressInstall = useExpressInstall; if(swf) this.setAttribute('swf', swf); if(id) this.setAttribute('id', id); if(w) this.setAttribute('width', w); if(h) this.setAttribute('height', h); if(ver) this.setAttribute('version', new com.deconcept.PlayerVersion(ver.toString().split("."))); this.installedVer = com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute('version'), useExpressInstall); if(c) this.addParam('bgcolor', c); var q = quality ? quality : 'high'; this.addParam('quality', q); var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location; this.setAttribute('xiRedirectUrl', xir); this.setAttribute('redirectUrl', ''); if(redirectUrl) this.setAttribute('redirectUrl', redirectUrl); } com.deconcept.FlashObject.prototype = { setAttribute: function(name, value){ this.attributes[name] = value; }, getAttribute: function(name){ return this.attributes[name]; }, addParam: function(name, value){ this.params[name] = value; }, getParams: function(){ return this.params; }, addVariable: function(name, value){ this.variables[name] = value; }, getVariable: function(name){ return this.variables[name]; }, getVariables: function(){ return this.variables; }, createParamTag: function(n, v){ var p = document.createElement('param'); p.setAttribute('name', n); p.setAttribute('value', v); return p; }, getVariablePairs: function(){ var variablePairs = new Array(); var key; var variables = this.getVariables(); for(key in variables){ variablePairs.push(key +"="+ variables[key]); } return variablePairs; }, getFlashHTML: function() { var flashNode = ""; if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "PlugIn"); flashNode = ' 0){ flashNode += 'flashvars="'+ pairs +'"'; } flashNode += '/>'; } else { // PC IE if (this.getAttribute("doExpressInstall")) this.addVariable("MMplayerType", "ActiveX"); flashNode = ''; flashNode += ''; var params = this.getParams(); for(var key in params) { flashNode += ''; } var pairs = this.getVariablePairs().join("&"); if(pairs.length > 0) {flashNode += '';} flashNode += ""; } return flashNode; }, write: function(elementId){ if(this.useExpressInstall) { // check to see if we need to do an express install var expressInstallReqVer = new com.deconcept.PlayerVersion([6,0,65]); if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) { this.setAttribute('doExpressInstall', true); this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl'))); document.title = document.title.slice(0, 47) + " - Flash Player Installation"; this.addVariable("MMdoctitle", document.title); } } else { this.setAttribute('doExpressInstall', false); } if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){ var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId; n.innerHTML = this.getFlashHTML(); }else{ if(this.getAttribute('redirectUrl') != "") { document.location.replace(this.getAttribute('redirectUrl')); } } } } /* ---- detection functions ---- */ com.deconcept.FlashObjectUtil.getPlayerVersion = function(reqVer, xiInstall){ var PlayerVersion = new com.deconcept.PlayerVersion(0,0,0); if(navigator.plugins && navigator.mimeTypes.length){ var x = navigator.plugins["Shockwave Flash"]; if(x && x.description) { PlayerVersion = new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")); } }else{ try{ var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash"); for (var i=3; axo!=null; i++) { axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i); PlayerVersion = new com.deconcept.PlayerVersion([i,0,0]); } }catch(e){} if (reqVer && PlayerVersion.major > reqVer.major) return PlayerVersion; // version is ok, skip minor detection // this only does the minor rev lookup if the user's major version // is not 6 or we are checking for a specific minor or revision number // see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/ if (!reqVer || ((reqVer.minor != 0 || reqVer.rev != 0) && PlayerVersion.major == reqVer.major) || PlayerVersion.major != 6 || xiInstall) { try{ PlayerVersion = new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(",")); }catch(e){} } } return PlayerVersion; } com.deconcept.PlayerVersion = function(arrVersion){ this.major = parseInt(arrVersion[0]) || 0; this.minor = parseInt(arrVersion[1]) || 0; this.rev = parseInt(arrVersion[2]) || 0; } com.deconcept.PlayerVersion.prototype.versionIsValid = function(fv){ if(this.major < fv.major) return false; if(this.major > fv.major) return true; if(this.minor < fv.minor) return false; if(this.minor > fv.minor) return true; if(this.rev < fv.rev) return false; return true; } /* ---- get value of query string param ---- */ com.deconcept.util = { getRequestParameter: function(param){ var q = document.location.search || document.location.hash; if(q){ var startIndex = q.indexOf(param +"="); var endIndex = (q.indexOf("&", startIndex) > -1) ? q.indexOf("&", startIndex) : q.length; if (q.length > 1 && startIndex > -1) { return q.substring(q.indexOf("=", startIndex)+1, endIndex); } } return ""; } } /* add Array.push if needed (ie5) */ if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }} /* add some aliases for ease of use/backwards compatibility */ var getQueryParamValue = com.deconcept.util.getRequestParameter; var FlashObject = com.deconcept.FlashObject; 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 formatCurrency(num) { num = num.toString().replace(/\$|\,/g,''); if(isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num*100+0.50000000001); cents = num%100; num = Math.floor(num/100).toString(); if(cents<10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++) num = num.substring(0,num.length-(4*i+3))+','+ num.substring(num.length-(4*i+3)); return (((sign)?'':'-') + '€ ' + num + '.' + cents); } /* Pepper Interactive Javascript Code (copyright Pepper Interactive) */ function loadpage(var1, var2) { //alert('var1='+var1+' en var2='+var2+'') switch (var1) { case 'home': window.status = "Busy with loading homepage"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=home\\index.xsl"; break; case 'nieuws': window.status = "Busy with loading news page."; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=algemeennieuws\\index.xsl" break; case 'sponsors': window.status = "Busy with loading sponsor page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=beasponsor\\index.xsl"; break; case 'contact': window.status = "Busy with loading contact page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=contact\\index.xsl"; break; case 'leden': switch (var2) { case 'games': window.status = "Busy with loading games page"; alert('De games pagina is nog in de maak'); //location.href = ""; break; case 'circuit': window.status = "Bezig met laden circuit pagina"; alert('De circuit pagina is nog in de maak'); //location.href = ""; break; } break; case 'jan': switch (var2) { case 'loopbaan': window.status = "Busy with loading carier page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=janlammers\\2_2_2_loopbaan\\loopbaan.xml&xslfile=janlammers\\2_2_2_loopbaan\\index.xsl"; break; case 'racing': window.status = "Busy with loading racing page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=lammersracing\\index.xsl"; break; case 'events': window.status = "Busy with loading events page"; //alert('De events pagina is nog in de maak'); location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=janlammers\\2_2_4_events\\index.xsl"; break; } break; case 'rfh': switch (var2) { case 'team': window.status = "Busy with loading team page"; //alert('De techniek pagina is nog in de maak'); location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\2_4_3_history\\history.xml&xslfile=racing-for-holland\\team\\index.xsl"; break; case 'techniek': window.status = "Busy with loading techndsad FOUT"; //alert('De techniek pagina is nog in de maak'); location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\2_4_3_history\\history.xml&xslfile=racing-for-holland\\techniek\\index.xsl"; break; case 'historie': window.status = "Busy with loading history page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\2_4_3_history\\history.xml&xslfile=racing-for-holland\\2_4_3_history\\index.xsl"; break; case 'gallery': window.status = "Busy with loading gallery page"; //alert('De gallery pagina is nog in de maak'); location.href = "http://www.janlammers.com/engels/XmlParser/index3.asp?xmlfile=racingforholland\\fotogallery\\gallery.xml&xslfile=racing-for-holland\\fotogallery\\index.xsl"; //location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\2_4_5_fotogallery\\gallery.xml&xslfile=racing-for-holland\\2_4_5_fotogallery\\index.xsl"; break; case 'video': window.status = "Busy with loading video page"; alert('De video pagina is nog in de maak'); //location.href = ""; break; case 'agenda': window.status = "Busy with loading calendar page"; //alert('De agenda pagina is nog in de maak'); location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\2_4_7_Agenda\\agenda.xml&xslfile=racing-for-holland\\2_4_7_Agenda\\index.xsl"; break; case 'lemans': window.status = "Busy with loading Le Mans page"; //alert('De agenda pagina is nog in de maak'); location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\2_4_7_Agenda\\agenda.xml&xslfile=racing-for-holland\\2_4_7_Agenda\\extradetails\\lemans.xsl"; break; case 'partners': window.status = "Bezig met laden partners pagina"; alert('De partners pagina is nog in de maak'); //location.href = ""; break; case 'sportscars': window.status = "Bezig met laden sportscars pagina"; alert('De sportscars pagina is nog in de maak'); //location.href = ""; break; case 'vraag': window.status = "Bezig met laden vraag pagina"; alert('De vraag pagina is nog in de maak'); //location.href = ""; break; case 'uitzendingen': window.status = "Bezig met laden uitzendingen pagina"; alert('De uitzendingen pagina is nog in de maak'); //location.href = ""; break; case 'shop': window.status = "Bezig met laden shop pagina"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=racing-for-holland\\live\\index.xsl"; break; case 'live': window.status = "Busy with loading live page"; //location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=racing-for-holland\\live\\index.xsl"; //location.href = "http://www.janlammers.com/engels/XmlParser/index3.asp?xmlfile=live\\standen.xml&xslfile=liveregistratie/indexuk.xsl&show=24"; OpenLivePopup(); break; case 'fun': window.status = "Busy with loading fun page"; alert('De fun pagina is nog in de maak'); //location.href = ""; break; case 'nieuws': window.status = "Busy with loading Racing For Holland news page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforhollandnews\\engels\\nieuwsuk.xml&xslfile=racingforhollandnews\\index.xsl"; break; case 'sponsors': window.status = "Busy with loading sponsor page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=beasponsor\\index.xsl"; break; case 'rijders': window.status = "Busy with loading drivers page"; location.href = "http://www.janlammers.com/engels/drivers/index.asp"; break; case 'pers': window.status = "Busy with loading press page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=algemeennieuws\\engels\\nieuwsuk.xml&xslfile=racing-for-holland\\pers\\index.xsl"; break; case 'standen': window.status = "Busy with loading standings page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racestanden\\file1.xml&xslfile=racestanden\\index.xsl"; break; case 'tv': window.status = "Busy with loading tv-broadcast page"; location.href = "http://www.janlammers.com/engels/XmlParser/index.asp?xmlfile=racingforholland\\tv-uitzendingen\\tv-uitzendingenuk.xml&xslfile=racing-for-holland\\tv-uitzendingen\\index.xsl"; break; case 'guestbook': window.status = "Bezig met loading guestbook"; location.href = "http://www.janlammers.com/engels/XmlParser/index3.asp?xmlfile=racingforholland\\gastenboek\\gastenboek_en.xml&xslfile=racing-for-holland\\guestbook\\index.xsl&page=0"; break; } break; } } function OpenLivePopup() { window.open('http://www.janlammers.com/livepopup/index.asp?action=home&lang=en', 'lammerspopup', 'width=778,height=580'); } function isEmpty(str){ strRE = new RegExp( ); strRE.compile( '^[\s ]*$', 'gi' ); return strRE.test( str.value ); } function isPhone(str){ /* strRE = new RegExp( ); strRE.compile( '^[0-9]{10,15}','gi'); return !(strRE.test( str.value )); */ } function notValidEmail( str ){ strRE = new RegExp( ); strRE.compile( '^[\._a-z0-9-]+@[\.a-z0-9-]+[\.]{1}[a-z]{2,4}$', 'gi' ); return !(strRE.test( str.value )); } //check all the values step by step function checkvalues(form) { if (isEmpty(form.achternaam)) { alert('You\'ve forgot to enter your last name.'); return false } else { if (isEmpty(form.adres)) { alert('You\'ve to enter a valid address.'); return false } else { if (isEmpty(form.adres)) { alert('DEZE CONTROLEERD HIJ NIET MEER, DIT IS BIJ DE NL DE CHECK VOOR HUISNR. DIE ZIT IN UK NIET IN'); return false } else { if (isEmpty(form.postcode)) { alert('You\'ve forgot to enter a postal/zip code.'); return false } else { if (isEmpty(form.vestigingsplaats)) { alert('You\'ve forgot to enter a valid city.'); return false } else { if (isEmpty(form.land)) { alert('You\'ve forgot to enter a valid country.'); return false } else { if (notValidEmail(form.email)) { alert('You haven\'t enter a valid e-mail address.'); return false } else { if (isEmpty(form.telefoon)) { alert('You\'ve forgot to enter a valid phone number.'); return false } else { if (isEmpty(form.uwilt)) { alert('You\'ve forgot to enter a valid value for some fields.'); return false } else { return true } } } } } } } } } }