// PREDEFINE SHORTWRITING VARIABLES var w, d, db, da; // QUICK BROWSER CHECK var NaviUserAgent = (navigator && navigator.userAgent ? navigator.userAgent.toLowerCase() : ''); var opera = (self.opera ? true : false); var chrome = (NaviUserAgent.indexOf('chrome') != -1); var ie = (NaviUserAgent.indexOf('msie') != -1); var firefox = (NaviUserAgent.indexOf('firefox') != -1); var safari = (navigator && navigator.vendor && navigator.vendor.toLowerCase().indexOf('apple') != -1); function onDOMReady( args ){ // onDOMReady - Copyright (c) 2009 Ryan Morr (ryanmorr.com) // Additions (c) Martijn Smit (www.yomarty.nl) // // onReady :: (required) function to call onDOMReady // useThis :: (optional) define this for within calling function // scriptsRequired :: (optional) (array) list of scripts required (not full path and without ?...) if (!args && !args.onReady) return; var fn = args.onReady; var ctx = (args.useThis ? args.useThis : null); var src = (args.scriptsRequired ? args.scriptsRequired : null); var ready = 0, scriptsreq = 0, timer, i, j, scripts, srcstring; var d = document, w = window; var safeEval = function(s) { try{ eval(s); } catch(e){ return false; }; return true; }; var onStateChange = function(e) { if (e && e.type == "DOMContentLoaded") { ready = 1; fireReady(); } else if (e && e.type == "load") { ready = 1; fireReady(); } else if(d.readyState) { if (d.readyState == "loaded" || d.readyState == "complete") { ready = 1; fireReady(); } else if (!!d.documentElement.doScroll) { try{ ready || d.documentElement.doScroll('left'); } catch(e){ return; } ready = 1; fireReady(); } } if (src) { scripts = d.getElementsByTagName("script"); for (i = 0; i < src.length; i++) { if (src[i].ready == false) { for (j = 0; j < scripts.length; j++) if (scripts[j].src.indexOf(src[i].src) != -1) { src[i].ready = true; scriptsreq--; fireReady(); safeEval(scripts[j].innerHTML); } } } } }; var fireReady = function() { if (ready == 1 && scriptsreq <= 0) { d.onreadystatechange = null; // first to clear w.onload = null; // first to clear clearInterval(timer); timer = null; // first to clear if(d.removeEventListener) d.removeEventListener("DOMContentLoaded", onStateChange, false); d._DOMREADY = true; fn = (fn.call(ctx || w) ? null: null); // last to execute //alert('ready: ' + ready + ' , scriptsreq: ' + scriptsreq); } }; d._DOMREADY = false; if (src) for (i = 0; i < src.length; i++) { src[i] = { src: src[i], ready: false }; scriptsreq++; } // add to required scripts if(d.addEventListener) d.addEventListener("DOMContentLoaded", onStateChange, false); d.onreadystatechange = onStateChange; timer = setInterval(onStateChange, 10); w.onload = onStateChange; } function safe_eval(str) { try{ eval(str); } catch(err){ return false; }; return true; } function EXECifDomReady() { var objs = document.getElementsByTagName("img"); for (var i = 0; i < objs.length; i++) { if ((objs[i].className+'').toUpperCase() == 'EXECIFDOMREADY') { try{ objs[i].onload = (objs[i].onload() ? null: null); } catch(err){ continue; }; // execute, wait till function done, and kill function afterwards } } } function attachEventListener(obj, evt, func) { if (obj && evt && func) { if (obj.addEventListener) obj.addEventListener(evt, func, false); if (obj.attachEvent) obj.attachEvent(evt, func); } } function detachEventListener(obj, evt, func) { if (obj && evt && func) { if (obj.removeEventListener) obj.removeEventListener(evt, func, false); if (obj.detachEvent) obj.detachEvent(evt, func); } } function exif_Initialize(fid) { if (!window.execFlash) window.execFlash = {}; // only once var io = window.execFlash[fid] = {}; // new interface object inside execFlash // trace reference to flash object inside window if (document[fid]) io._obj = document[fid]; else if (frames && frames.length > 0) { for (var f, i = 0; i < frames.length; i++) { f = frames[i]; if (f.document[fid]) { io._obj = f.document[fid]; break; } } } io.id = fid; // save name of flash object io.send = function(o) { this._obj.receiveFromFlash(o); }; // create function if (ie && !window.execFlash.available) window.onbeforeunload = function() { __flash_savedUnloadHandler = null; } // IE MULTIPLE EXT.INTERFACE 'OUT OF MEM' FIX window.execFlash.available = true; if (fid == 'swf_exif') setTimeout(EXECifExifReady, 100); // settimeout for Firefox to jump out of cycle } function EXECifExifReady( ) { var d = document; d._EXIFREADY = false; // start false d._EXEC_EXIF_TRY = (d._EXEC_EXIF_TRY > 0 ? d._EXEC_EXIF_TRY + 1 : 1); // add another try if (d._DOMREADY == true && execFlash && execFlash.available && execFlash['swf_exif'] && execFlash['swf_exif'].send) { d._EXIFREADY = true; // EXIF is ready too var objs = document.getElementsByTagName("img"); for (var i = 0; i < objs.length; i++) { if ((objs[i].className+'').toUpperCase() == 'EXECIFEXIFREADY') { try{ objs[i].onload = (objs[i].onload() ? null: null); } catch(err){ continue; }; // execute and kill function at same time } } } if (d._EXIFREADY == false) { if (d._EXEC_EXIF_TRY > 0 && d._EXEC_EXIF_TRY < 25) { setTimeout(EXECifExifReady, 200); return; } // try again alert('U heeft geen (juiste) Flash versie geïnstalleerd!'); // it didn't work } } function exifStatement( args ) { //console.log(args); return false; if (!args) return; var tryExif = function( args ) { try { window.execFlash['swf_exif'].send( args ); } catch(err){ return false; } return true; } var swf = document.getElementById('exifObjectWrapper'); // object reference var exifFound = tryExif( args ); if (exifFound === true) { if (swf) swf.style.top = ''; return; } // found yet? // now bring exifObjectWrapper in viewport range (mostly Firefox and Opera need this) if (swf) { var w = window, de = document.documentElement, db = document.body; var scrollTop = (de && de.scrollTop ? de.scrollTop : (db && db.scrollTop ? db.scrollTop : (w.pageYOffset ? w.pageYOffset : (w.scrollY ? w.scrollY : 0)))); swf.style.top = (scrollTop + 150) + 'px'; // bring in view exifFound = tryExif( args ); if (exifFound === true) { swf.style.top = ''; return; } // check again (if found; break cycle) setTimeout( (function(){exifStatement(args);}) , 250); // not found, timeout and run again } } function exif_unescape(x) { return unescape(decodeURI(x)); } // very slow in ie (old way preserving unicode characters) //function exif_unescape(x) { return x.split('').reverse().join(''); } // faster function exif_receiveExternalData(args) { //startTime=new Date().getTime(); // start processing speed if (args.exif_data) { var x = args.exif_data, y = ''; for (var i = 0, n = x.length; i < n; i++) y+= x[i].split('').reverse().join(''); // join array chunks & reverse back string args.exif_data = y; } //endTime=new Date().getTime(); args.exif_data = ((endTime-startTime)/1000) + ' seconds.
' + args.exif_data; // end and show processing speed if (args.exif_onload) window[args.exif_onload](args); // if onload } function embedFlashOrAlternate(a) { // bugfix (IE): to prevent "object doesn't support.." error, don't give a flash object the same name/id as other objects (like divs etc..) // version 1.1: incl. menu and base properties if (a && a.src && a.target) { a.name = (a.name ? a.name : 'flashmovie'); // name property or nothing a.id = a.name; // id property (copy of name) a.width = (a.width ? 'width:' + a.width + ';' : ''); // width (style) or nothing a.height = (a.height ? 'height:' + a.height + ';' : ''); // height (style) or nothing a.quality = (a.quality ? a.quality : 'HIGH'); // quality, default is HIGH a.bgcolor = (a.bgcolor ? a.bgcolor : '#ffffff'); // bgcolor, default is #ffffff a.flashvars = (a.flashvars ? a.flashvars : ''); // flashvars, default is '' a.wmode = (a.wmode ? a.wmode : 'window'); // wmode, transparent or window (default) a.base = (a.base ? a.base : '.'); // base, default is '.' path var str = '' + '' + '' + '' + '' + '<\/embed><\/object>'; a.target.innerHTML = str; } } function isDom(o) { try { return typeof o === "object" && o.nodeType === 1; } catch (e) { return false; } } // (object) true / false function getDom(io) { var o = document.getElementById(io); return (isDom(o) ? o : (isDom(io) ? io : false)); } // (object|object.id) object / false function domStyle(o, p, s) { try { return (getDom(o).style[p] = (s ? s : '')) !== null; } catch (e) { return false; } } // (object|object.id, property, string) true / false function domHTML(o, s) { try { return (getDom(o).innerHTML = (s ? s : '')) !== null; } catch (e) { return false; } } // (object|object.id, property, string) true / false function AS3FirefoxStatusBarFix() { try { document.getElementById('AS3FirefoxStatusBarFix').src = 'dummy.gif'; } catch (e) { } } // needs with this id function convertMultiTableFieldToArray(a, d) { // convert string ( '[+a+]1[+b+]2' ) back to object array { a: 1, b: 2 } // d is for default value if (!a || a.toString().length == 0) return []; d = (d ? d : null); var dat1 = trim(a.toString()).split('[+'), dat2, arr = []; for (var i in dat1) { dat2 = dat1[i].split('+]'); if (dat2[0] && dat2[0].length > 0) arr[dat2[0]] = (dat2[1] && dat2[1].length > 0 ? dat2[1] : d); } return arr; } function convertMultiTableFieldToString(a, d) { // convert object array { a: 1, b: 2 } to string ( '[+a+]1[+b+]2' ) // d is for default value var s = ''; if (!a) return s; d = (d ? d : null); for (var i in a) s+= '[+' +i+ '+]' + a[i]; return s; } function setAndGetNextHighestDepth(x) { return (!x && document._zIndex && document._zIndex > 0 ? document._zIndex+= 1 : document._zIndex = (x ? x : 1001)); } function getFirstChildElement(elm) { if (elm && elm.childNodes) { for (var i = 0; i < elm.childNodes.length; i++) if (elm.childNodes[i].nodeType === 1) return elm.childNodes[i]; } return null; } function getChildElements(elm) { var arr = []; if (elm && elm.childNodes) { for (var i = 0; i < elm.childNodes.length; i++) if (elm.childNodes[i].nodeType === 1) arr.push(elm.childNodes[i]); } return arr; } function getNextSibling(elm) { if (elm && elm.nextSibling) { do elm = elm.nextSibling; while (elm && elm.nodeType != 1); return elm; } return null; } function getPreviousSibling(elm) { if (elm && elm.previousSibling) { do elm = elm.previousSibling; while (elm && elm.nodeType != 1); return elm; } return null; } function scrollToAnchor(n,diff) { var obj = document.getElementById(n); if (obj) { var top = getTop(obj) + (diff ? diff : 0) - 25; if (top > 0) window.scrollTo(0, top); } } function scrollToTop() { window.scrollTo(0, 0); } function layerShow(n) { var obj = document.getElementById(n); if (obj && obj.style) obj.style.display = "block"; } function layerHide(n) { var obj = document.getElementById(n); if (obj && obj.style) obj.style.display = "none"; } function popupNewBrowserWindow(args) { if (!args || !args.url) return null; var left = (args.left ? args.left : 0); var top = (args.top ? args.top : 0); var width = (args.width ? args.width : 1024); var height = (args.height ? args.height : 768); popUpWin = open(args.url, '_blank', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width='+width+',height='+height+',left=0, top=0,screenX='+left+',screenY='+top+''); //popUpWin.resizeTo(screen.availWidth,screen.availHeight); //popUpWin.moveTo(0,0); } function focusElement(o) { var obj = document.getElementById(o); obj = (o && o.focus ? o : (obj && obj.focus ? obj : null)); if (obj) obj.focus(); } function onKeyEvent(evt, codes, arguments, focusNext) { // // added on 25-01-2011: focusNext // example: onKeyEvent(event, {9: null, 13: mijnprofiel_inloggen}, {id: 'hoi'}, 'inlog_email'); // (functions are references) evt = (evt) ? evt : event; var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode); if (!evt || !charCode) return; var func = (codes && codes[charCode] ? codes[charCode] : null); if (func) func(arguments); // if function, execute it if (charCode == 9 || charCode == 13) { // 9 = tab, 13 = enter if (hasValue(focusNext)) { var elm = document.getElementById(focusNext); if (elm) setTimeoutLiteral(1, function(elm){elm.focus();}, elm); // if (elm) elm.focus(); // new focus } evt.cancelBubble = true; evt.returnValue = false; if (evt.preventDefault) evt.preventDefault(); // firefox if (evt.stopPropagation) evt.stopPropagation(); // firefox return false; } } function textAreaMaximizeInput(obj) { if (!obj) return true; var len = parseInt(obj.getAttribute('maxlength')); if (isNaN(len)) return true; obj.onkeypress = setTimeoutClosure(function(x) { if (x.o.value.length >= x.l) x.o.value = x.o.value.substr(0,x.l); }, 10, { o: obj, l: len }); // useable with 'onkeypress' if (obj.value.length >= len) obj.value = obj.value.substr(0,len); // usable with 'onkeyup' } function setTimeoutClosure(f, m, a) { return function() { setTimeout(function(){f(a);}, m); }; } // function must be reference not a string (f = function, m = milliseconds, a = argument) function setOpacity(obj, opacity) { if (!obj) return; var clear = (!opacity || opacity == 100 ? true : false); obj.style.filter = (clear ? '' : 'progid:DXImageTransform.Microsoft.Alpha(opacity=' +opacity+ ')'); // IE (Win) obj.style.opacity = (clear ? '' : opacity/100); // Safari 1.2, newer Firefox and Mozilla, CSS3 obj.style.KHTMLOpacity = (clear ? '' : opacity/100); // Safari<1.2, Konqueror obj.style.MozOpacity = (clear ? '' : opacity/100); // Older Mozilla and Firefox } function checkFormFieldsByArray( args ) { if (!args || !args.array || !args.header) return null; // array example: new Array("", { id: "KLANTvoorletters", titel: "Voorletter(s)" }, { id: "KLANTachternaam", titel: "Achternaam" }, etc... ) var result = true; // start off true var error = args.header + "
"; var evaluated; var array = args.array; var row, value; var obj_field; for (var i = 1; i < array.length; i++) { row = array[i]; value = wizard[row.id].tekst; // get it from var, not from actual field, cause sometimes fields are not on screen evaluated = evaluateFormInput( { id: row.id, value: value, space: document } ); obj_field = document.getElementById(row.id); if (is(obj_field)) obj_field.value = evaluated.result; // set 'changed' value in form field, if there is a form field present wizard[row.id].tekst = (evaluated.result).toString(); // set 'changed' value in wizard var (.toString is a 'BUG!?!' fix) if (evaluated.okee == false) { result = false; // set it to false error+= '
* ' + row.titel + '' + (row.tekst ? ', ' + row.tekst + '
' : ''); } } return { okee: result, text: error }; // okee or not okee } // -------------------------------------------------------------------------------------------------------------- function getBrowserDimensions( srcDocument ) { srcDocument = (srcDocument) ? srcDocument : document; // source document (ex. parent, top), (default = document) var w = window, de = srcDocument.documentElement, db = srcDocument.body; // set shortcuts var documentWidth = (db && db.clientWidth ? db.clientWidth : (de && de.clientWidth ? de.clientWidth : (w.innerWidth ? w.innerWidth : 0))); var documentHeight = (db && db.clientHeight ? db.clientHeight : (de && de.clientHeight ? de.clientHeight : (w.innerHeight ? w.innerHeight : 0))); var scrollLeft = (de && de.scrollLeft ? de.scrollLeft : (db && db.scrollLeft ? db.scrollLeft : (w.pageXOffset ? w.pageXOffset : (w.scrollX ? w.scrollX : 0)))); var scrollTop = (de && de.scrollTop ? de.scrollTop : (db && db.scrollTop ? db.scrollTop : (w.pageYOffset ? w.pageYOffset : (w.scrollY ? w.scrollY : 0)))); var viewportWidth = (w.innerWidth ? w.innerWidth - 18 : (de && de.clientWidth ? de.clientWidth : (db && db.clientWidth ? db.clientWidth : 0))); var viewportHeight = (w.innerHeight ? w.innerHeight - 18 : (de && de.clientHeight ? de.clientHeight : (db && db.clientHeight ? db.clientHeight : 0))); var viewportRight = viewportWidth + scrollLeft; var viewportBottom = viewportHeight + scrollTop; return { documentWidth : documentWidth, documentHeight : documentHeight, viewportWidth : viewportWidth, viewportHeight : viewportHeight, viewportLeft : scrollLeft, viewportRight : viewportRight, viewportTop : scrollTop, viewportBottom : viewportBottom, scrollLeft : scrollLeft, scrollTop : scrollTop } } function isNull(v) { return (v === null || typeof(v) === 'undefined'); } function hasValue(v) { return (v !== null && typeof(v) !== 'undefined'); } function is(v) { var w = (typeof(v)+'').toLowerCase(); return (w != 'undefined' ? (w == 'object' && v == null ? false : true) : false); } function isnot(v) { return !is(v); } function getLeft(i) { if (i) { if (i.offsetParent) { return (i.offsetLeft + getLeft(i.offsetParent)); } else { return (i.offsetLeft); } } } function getTop(i) { if (i) { if (i.offsetParent) { return (i.offsetTop + getTop(i.offsetParent)); } else { return (i.offsetTop); } } } function convert_TextareaValueToString(str, del) { return (str && str.length ? ((((str+'').split('\r')).join('')).split('\n')).join(del ? del : '
') : ''); } // ie, firefox & opera function convert_StringToTextareaValue(str, del) { return (str ? ((str+'').split(del ? del : '
')).join('\n') : ''); } // ie, firefox & opera function antiCacheString() { var d = new Date(); return d.getTime(); } function floorToFixed(a, d) { var factor = Math.pow(10, d); return Math.floor(a * factor) / factor; } function ceilToFixed(a, d) { var factor = Math.pow(10, d); return Math.ceil(a * factor) / factor; } function roundToFixed(a, d) { var factor = Math.pow(10, d); return Math.round(a * factor) / factor; } function isRoundNumber(x) { return (Math.ceil(x) == x); } function zeroFillLeft(a, n) { if (!a) return ""; a = a.toString(); if (a.length >= n) return a; return new Array(n - (a.length - 1)).join("0") + a; // return leftside zerofilled value as string } function zeroFillAndFloat(a, n, v, s) { // a = value, n = positions after decimal, v = valuta sign, s= decimal seperator v = (v && v == "euro") ? "€ " : ""; s = (s) ? s : "."; if (isNaN(parseFloat(a))) return v + "??" + s + "??"; var b = roundToFixed(a,n).toString().split("."); var c = (b[1] ? b[0] : b); var d = (b[1] ? (b[1]).substring(0,2) : ""); return v + c + s + d + new Array(n - (d.length - 1)).join("0"); // return rightside (after dot) zerofilled value as string } function floatToDecimal(a, n) { a = parseFloat(a); if (!a || isNaN(a)) return 0; n = (n) ? (n < 0 ? 0 : n) : 2; // .00 default var d = parseInt('1' + new Array(n + 1).join("0")); // example: 100 --> .00 return Math.round(a * d) / d; // round to n decimals } function percentageOf(v, p) { v = parseFloat(v); p = parseFloat(p); return (isNaN(v + p)) ? 0 : (v / 100) * p; } function setTimeoutLiteral(msecs, func, v1, v2, v3, v4, v5, v6) { setTimeout((function(){func(v1,v2,v3,v4,v5,v6)}) , msecs); } function makeFunctionLiteral(func, v1, v2, v3, v4, v5, v6) { return (function(){return func(v1,v2,v3,v4,v5,v6)}); } function count(x) { return (is(x) && x.length ? x.length - 1 : 0); } function arraySplice(a, x, y) { // a == array, x == begin (zero-based), y == how much // ie fix: array.splice does not work inside iframe, NOT multi-dimensional! if (!a || isNaN(parseInt(a.length))) return []; if (isNaN(parseInt(y)) || y < 1) return a; var b = [], cnt = 0; for (var i = 0; i < (a.length); i++) { if (i >= x && i < x + y) continue; b[cnt] = a[i]; cnt++; } return b; } function arrayPush(a, x) { // ie fix: array.push does not work inside iframe, NOT multi-dimensional! //if ( !a || !isArray(a) ) return []; // return empty array if (!a || isNaN(parseInt(a.length))) return []; a[(a.length == -1 ? 0 : a.length)] = x; return a; } function onTextSelect(evt) { evt = (evt) ? evt : event; if (evt) { var srcObj = (evt.target ? evt.target : evt.srcElement); if (srcObj && srcObj.tagName && !srcObj.tagName.match(/^(input|textarea)$/i)) { evt.cancelBubble = true; evt.returnValue = false; if (evt.preventDefault) evt.preventDefault(); if (evt.stopPropagation) evt.stopPropagation(); document.body.focus(); // enable removing focus return false; } } } function getViewportWidth(src) { src = (src) ? src : document; var dd = src.documentElement, db = src.body; if ( top.innerWidth ) { return top.innerWidth; } else if ( dd && dd.clientWidth ) { return dd.clientWidth; } else if ( db && db.clientWidth ) { return db.clientWidth; } return 0; // instead of undefined } function getViewportHeight(src) { src = (src) ? src : document; var dd = src.documentElement, db = src.body; if ( top.innerHeight ) { return top.innerHeight; } else if ( dd && dd.clientHeight ) { return dd.clientHeight; } else if ( db && db.clientHeight ) { return db.clientHeight; } return 0; // instead of undefined } function getScrollTop(src) { src = (src) ? src : document; var dd = src.documentElement, db = src.body; if( dd && dd.scrollTop ) { return dd.scrollTop; } else if( db && db.scrollTop ) { return db.scrollTop; } return 0; // instead of undefined } function focusNext(elemName, evt, func) { var evt = (evt) ? evt : event; var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode); if (charCode == 13 || charCode == 9) { var elm = getElementById(elemName); elm.focus(); if (func) func(); // if function, execute it return false; } return true; } function resetTab(elemName, evt) { var evt = (evt) ? evt : event; var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode); if (charCode == 9) { evt.cancelBubble = true; evt.returnValue = false; if (evt.preventDefault) evt.preventDefault(); if (evt.stopPropagation) evt.stopPropagation(); var elm = getElementById(elemName); elm.focus(); return false; } return true; } function findRowInArrayByUniqueKey( args ) { if (!args || !args.array || !args.key || !args.needle ) return; var result = null; for (var x in args.array) { if (args.array[x]) { if (args.array[x][args.key] == args.needle) { result = x; break; } } } return result; } function mRepl(txt, str, wit) { return txt.split(str).join(wit); } // multi replace function mRepli(txt, str, wit, f) { var regex = new RegExp(str, (f ? f : 'gim')); return txt.toString().replace(regex, wit); } // multi replace (case INsensitive) function removeNewLines(_s) { var _t = ""; for (_i=0;_i<_s.length;_i++) { if (_s.charCodeAt(_i) != 13 && _s.charCodeAt(_i) != 10) _t += _s.charAt(_i); } return _t; } function getElementById(id) { return document.getElementById(id); } function fileToFullPath(args) { if (!args) return null; if (!args.filename) return null; if (!args.path) args.path = ""; var url = mRepl("./img/" + args.path + "/" + args.filename, "//", "/"); return url; } function getObjectFromArrayById(args) { if (!args) return null; if (!args.key) return null; if (!args.array) return null; var key = args.key; var array = args.array; var i, el, x; for (i = 0; i < array.length; i++) { el = array[i]; for (var x in el) { if (el[x] == key && x == args.keyname) return el; } } return null; } function convertToGrid(r,cols,mod,align, cellpadding, tablewidth) { // r: array of content (to be divided over the cells) // cols: number of columns, before breaking to new row (1 or more) // mod: 'lefttoright' or 'toptobottom' // align: 'left' , 'center' or 'right' var total = r.length-1; var from = 0; var to = 0; var i, j, x = '', y; if (!total || total < 1) return ""; // quit here if (!align) align = 'left'; // if none, default to 'left' cols*= 1; // make always a number (if not a number, cols becomes NaN) if (!cols || cols <= 0) cols = 1; // if no cols or NaN, zero or less, then default to 1 if (!mod || cols == 1 || total == cols) mod = 'lefttoright'; // if none, default to 'lrtb', faster too if (!cellpadding) cellpadding = '0px'; tablewidth = (tablewidth) ? 'width:' + tablewidth + ';' : ''; switch (mod) { // left to right case 'lefttoright': for (j = 0; j < Math.ceil(total / cols); j++) { // run (total / cols) times from = to + 1; // calculate 'from' to = (total < to + cols) ? total : to + cols; // calculate 'to' y = ""; for (i = from; i <= to; i++) { // run (cols) times y+= '' + r[i] + ''; } if (y != "") x+= '' + y + ''; // if not empty } x = '' + x + '
'; break; // top to bottom case 'toptobottom': for (j = 0; j < cols; j++) { // run (cols) times from = to + 1; // calculate 'from' to+= Math.ceil((total - to) / (cols - j)); // calculate 'to' y = ''; for (i = from; i <= to; i++) { // run (cols) times y+= '' + r[i] + ''; } if (y != '') x+= '' + y + '
'; // if not empty } x = '' + x + '
'; break; } return x; } // ---------------- function browseThroughFormAndEvaluate( args ) { if (!args || !args.id) return; var newValues = [], obj, element, result, dd_name, type, value_original; var csdropdown, elementId; var obj = document.getElementById(args.id); // form object if (!obj || !obj.elements) return; // browse through form elements for (i = 0; i < obj.elements.length; i++) { element = obj.elements[i]; if (element.tagName && element.tagName.match(/^(object|embed)$/i)) continue; elementId = element.id; type = element.type; // find out if element is just a csdropdown tag csdropdown = element.getAttribute('csdropdown'); if (csdropdown) { csdropdown = document.getElementById(csdropdown); if (csdropdown && csdropdown.options) { element = csdropdown.options[csdropdown.selectedIndex]; elementId = csdropdown.id; } } dd_name = element.getAttribute('dd_name'); if (!dd_name || dd_name.toString().length == 0) dd_name = null; // dd_name is custom element title value_original = element.getAttribute('value_original'); if (!value_original || value_original.toString().length == 0) value_original = null; // value_org is original value result = evaluateFormInput( { id: elementId, value: element.value } ); // evaluate element if (hasValue(result)) { newValues[elementId] = { title: dd_name, value: result['copy'], value_original: value_original, id: elementId, warning: !result['okee'] }; if (!csdropdown) element.value = result['copy']; // set new value also in form element } } return newValues; } function evaluateOneFormField(obj) { if (obj && obj.id) { var evaluateBy = obj.getAttribute('evaluateBy'); var result = evaluateFormInput( { id: (evaluateBy ? evaluateBy : obj.id), value: obj.value } ); if (hasValue(result)) { obj.value = result['copy']; // make new value also visible in form return (result['okee'] ? result['copy'] : false); // return value (if needed) } } } function evaluateFormInput(args) { if (!args || !args.id ) return; // not '|| args.value', could be empty and thus not there var value = trim(isNull(args.value) ? '' : args.value); var copy = "", copy1 = "", copy2 = "", copy3 = "", copy4 = "", okee = false, okee1 = false, okee2 = false; var pattern_common = "[ A-Za-z0-9\-\.\,\!\?\&\+\=\:\;ßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ]"; // space, alpha, numeric, foreign chars, -.,!?&+=:; NEWLINE (\n\r) var pattern_common_newline = "[ A-Za-z0-9\-\.\,\!\?\&\+\=\:\;ßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ\n\r]"; // space, alpha, numeric, foreign chars, -.,!?&+=:; NEWLINE (\n\r) var pattern_alpha_nospace = "[A-Za-zßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ\-]"; // alpha, foreign chars, - var pattern_alpha_num_space = "[ A-Za-z0-9ßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ\-]"; // space, alpha, numeric, foreign chars, - var pattern_num = "[0-9]"; // numeric switch( args.id ) { case "shop_email": case "inlog_email": case "inlog_email2": case "aanmelden_email": case "webshop_inlog_email": case "profiel_email": copy = remove_spaces(value.toLowerCase()); copy1 = copy.substr(copy.indexOf('@')+1); // everything after @ if (copy.indexOf('@') == -1) okee = false; // whole string contains no @ else if (copy1.indexOf('@') != -1) okee = false; // another @ found else if (copy1.indexOf('.') == -1) okee = false; // no . found else if (countString(copy) <= 5) okee = false; // less than 5 characters else okee = true; break; case "inlog_wachtwoord": case "inlog_wachtwoord2": case "aanmelden_wachtwoord": case "webshop_inlog_wachtwoord": case "profiel_wachtwoord": copy = myRegExp(value.toLowerCase(), '[a-z0-9]'); okee = (countString(copy) >= 5 && countString(copy) <= 10) ? true : false; break; case "aanmelden_schermnaam": case "profiel_schermnaam": copy = myRegExp(value, '[A-Za-z0-9ßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ_-]'); okee = (countString(copy) >= 3 && countString(copy) <= 15) ? true : false; break; // case "shop_bedrijfsnaam": case "shop_contactpersoon": copy = myRegExp(value, pattern_common); copy = ucWords(copy); // make first character of every word uppercase okee = (countString(copy) > 0) ? true : false; break; case "profiel_contactpersoon": copy = myRegExp(value, pattern_common); copy = ucWords(copy); // make first character of every word uppercase okee = true; // always true break; case "shop_adres": copy = remove_spaces(value); copy4 = myRegExp(copy, pattern_alpha_nospace); // only the alpha's copy = copy.substr(copy.indexOf(copy4.charAt(0))); // if start's with numbers, remove them copy3 = myRegExp(copy, pattern_num); // only the numbers copy1 = copy.substr(0, copy.indexOf(copy3.charAt(0))); // first part copy2 = copy.substr(copy.indexOf(copy3.charAt(0))); // second part copy = ucWords(countString(copy1 + copy2) > 0 ? copy1 + " " + copy2 : ""); okee = (countString(copy) > 0) ? true : false; // if all true, then true break; case "shop_woonplaats": copy = myRegExp(value, pattern_alpha_num_space); copy = ucWords(copy); // make first character of every word uppercase okee = (countString(copy) > 0) ? true : false; break; case "shop_postcode": copy = myRegExp(value.toUpperCase(), '[A-Za-z0-9ßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ]'); copy4 = myRegExp(copy, pattern_num); // only the number's copy = copy.substr(copy.indexOf(copy4.charAt(0))); // if start's with alpha's, remove them copy3 = myRegExp(copy, pattern_alpha_nospace); // only the alpha's copy1 = copy.substr(0, copy.indexOf(copy3.charAt(0))); // first part copy2 = copy.substr(copy.indexOf(copy3.charAt(0))); // second part copy = (countString(copy1 + copy2) > 0 ? copy1 + " " + copy2 : ""); // // merge with space inbetween okee = (countString(value) >= 4) ? true : false; break; case "shop_website": case "website": copy = remove_spaces(value.toLowerCase()); copy = removeHttpFromUrl(copy); okee = (copy.indexOf('.') == -1 || countString(copy) < 4) ? false : true; break; case "shop_telefoon": copy = myRegExp(value, pattern_alpha_num_space); okee = (countString(copy) > 0) ? true : false; break; case "shop_opmerking": copy = myRegExp(value, pattern_common_newline); okee = true; // always true break; default: copy = value; okee = true; } return { copy: (okee === true ? copy : value), okee: okee }; // true (GOOD) or false (BAD) } function isArray() { if (typeof arguments[0] == 'object') { var criterion = arguments[0].constructor.toString().match(/array/i); return (criterion != null); } else { return false; } } function isValid(parm,val) { if (!parm || parm.length < 1) return false; for (var i = 0, parm = parm.toString(); i < parm.length; i++) { if (val.indexOf(parm.charAt(i),0) == -1) return false; } return true; } function isAlpha(str) { return isValid(str, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); } function isNumber(v) { return (parseInt(v).toString() == v.toString()) ? true : false; } function isEmpty(v) { return (v.toString().length < 1) ? true : false; } function isString() { if (typeof arguments[0] == 'string') return true; if (typeof arguments[0] == 'object') { var criterion = arguments[0].constructor.toString().match(/string/i); return (criterion != null); } else { return false; } } function isStringAlpha(v) { return (isString(v) && isNaN(parseInt(v))) ? true : false; } function makeNumber(v) { return (v) ? parseInt(v) : 0; } function makeString(v) { return (v) ? v.toString() : ""; } function countArray(v) { return (v && isArray(v) && v.length > 0) ? v.length - 1 : 0; } function countString(v) { return (v && isString(v) && v.length > 0) ? v.length : 0; } function countWords(v) { v = v.match(/\S+/g); return (v && v.length ? v.length : 0); } // count number of words in a string function ucFirst(v) { return v.charAt(0).toUpperCase() + v.substring(1); } function ucWords(v) { return v.toLowerCase().replace( /^(.)|\s(.)|\-(.)/gim, function ($1) {return $1.toUpperCase();} ); } function remove_spaces(str, onlyDuplicates) { return str.replace(/\s+/g, (onlyDuplicates == true ? ' ' : '')); } // remove all spaces or (if onlyDuplicates == true, only duplicates) function trim(str) { str = str.replace( /^\s+/g, "" ); return str.replace( /\s+$/g, "" ); } // strip leading, then strip trailing function stripHtmlTags(str, except) { str = str.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,'"').replace(/'/g,"'").replace(/"/g,'"').replace(/"/g,'"').replace(/’/g,"'"); // convert some entities first if (!except) return str.replace(/<[^>]*>?/g, ''); except = except.split(','); var regex, i; for (i = 0; i < except.length; i++) { regex = new RegExp('<' + except[i], 'gi'); str = str.replace(regex, '~3' +except[i]+ '|~'); regex = new RegExp('', 'gi'); str = str.replace(regex, '~3/' +except[i]+ '|~'); } str = str.replace(/<[^>]*>?/g, ''); // strip all tags for (i = 0; i < except.length; i++) { str = str.split('~3' +except[i]+ '|~').join('<' + except[i]); str = str.split('~3/' +except[i]+ '|~').join(''); } return str; } // remove all html tags from string (except == comma seperated string) function stripQuotes(str) { return str.replace(/["']+/g, ''); } // strip ' and " from string //function stripHtmlTags(str) { return str.replace(/<[^>]*>?/g, ''); } // remove all html tags from string function removeHttpFromUrl(str) { return str.replace(/^[^:/.]*[:/]+/i, ''); } // remove any kind of http:// from url function myRegExp(str, pattern, flags) { flags = (is(flags)) ? flags : "gim"; // standard; global, case-insensitive, multi-line var regex = new RegExp(pattern, flags); var array = str.toString().match(regex); if (array && isArray(array)) { return array.join(""); } else { return ""; } } function imgOver(obj) { var layer = document.getElementById('blogtest'); if (!layer) return; if (obj) { layer.style.left = obj.style.left; layer.style.top = obj.style.top; layer.style.width = obj.offsetWidth + 'px'; layer.style.height = obj.offsetHeight + 'px'; setOpacity(layer, 40); layer.parentNode.setAttribute('href', obj.parentNode.href); layer.parentNode.setAttribute('target', obj.parentNode.target); layer.style.display = 'block'; } } function imgOut(layer) { if (layer) { setOpacity(layer, 1); layer.style.display = 'none'; } } function pagina_niet_toegankelijk() { var html = ''; html+= ''; showPopup( { html: html, width: '490px', centerOn: 'screen' } ); } function pagina_niet_gevonden() { var html = '
Whoops!?
'; html+= ''; showPopup( { html: html, width: '540px', centerOn: 'screen' } ); } function niet_meer_nieuwsitems() { var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); } function uitleg_ingelogd_blijven() { var html = ''; html+= ''; showPopup( { html: html, width: '560px', centerOn: 'screen' } ); } function toon_algemene_voorwaarden(lod) { var html = '
'; html+= ''; html+= '
'; if (lod === true) importHTML( { url: 'template/import/voorwaarden.php', post: null, target: 'popup_de_voorwaarden' } ); else showPopup( { html: html, width: '700px', centerOn: 'screen', onLoad: function(){ toon_algemene_voorwaarden(true); } } ); } function let_op_met_inloggegevens() { var html = ''; html+= ''; showPopup( { html: html, width: '430px', centerOn: 'screen', onCloseClicked: (safari ? function(){ profilePhoto_display('show'); hidePopup(); } : null) } ); if (safari) profilePhoto_display('hide'); } function sociaal_netwerk_prive() { var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); } // -------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------- function addToFavorites(url, name) { if (firefox) window.sidebar.addPanel(name, url, ""); // firefox else if (ie) window.external.AddFavorite(url, name); // ie else { var html = ''; html+= ''; showPopup( { html: html, width: '460px', centerOn: 'screen' } ); } } function lid_snel_inloggen( args ) { var obj = document.getElementById('inlog_html_code'); if (obj) { var xPos = (args && args.xPos ? args.xPos : '-140px'); var yPos = (args && args.yPos ? args.yPos : '-20px'); obj.style.display = 'block'; obj.style.width = ""; // clean width style obj.style.height = ""; // clean height style obj.style.margin = yPos + ' 0px 0px ' + xPos; // set margins obj.style.zIndex = setAndGetNextHighestDepth(); // set on top obj = document.getElementById('inlog_email'); if (obj) obj.focus(); // focus on first form element } } function mijnprofiel_inloggen( args ) { var id = (args && args.id ? args.id : 'inloggen_mijnprofiel'); var aktie = (args && args.aktie ? args.aktie : null); var emailObj = document.getElementById((id == 'inloggen_mijnprofiel' ? 'inlog_email2' : 'inlog_email')); if (!emailObj) return null; var wachtwoordObj = document.getElementById((id == 'inloggen_mijnprofiel' ? 'inlog_wachtwoord2' : 'inlog_wachtwoord')); if (!wachtwoordObj) return null; var keepaliveObj = document.getElementById((id == 'inloggen_mijnprofiel' ? 'inlog_bewaren2' : 'inlog_bewaren')); switch (aktie) { // login succeeded case 'inloggen_gelukt': var form = document.getElementById(id); if (form) { form.submit(); } else { form = document.getElementById('inloggen_popup'); if (form) form.submit(); } // reload page break; // login failed case 'inloggen_mislukt': var html = ''; html+= '
Probeer het nogmaals.
'; html+= ''; showPopup( { html: html, width: '350px', centerOn: 'screen' } ); break; // login failed (not activated) case 'inloggen_mislukt_activeren': var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); break; // check fields and login default: var keepalive = (keepaliveObj && keepaliveObj.checked == true ? 1 : 0); var email = evaluateOneFormField(emailObj); if (email == false) { mijnprofiel_inloggen( { aktie: 'inloggen_mislukt', id: id } ); return; } var wachtwoord = evaluateOneFormField(wachtwoordObj); if (wachtwoord == false) { mijnprofiel_inloggen( { aktie: 'inloggen_mislukt', id: id } ); return; } var post = { inlog_email: email, inlog_wachtwoord: wachtwoord, inlog_keepalive: keepalive, sessie: wizard.sessionID, actie: null, id: id }; exifStatement( { action: "exif_lidInloggen", post: post } ); } } function mijnprofiel_uitloggen( args ) { var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { // logout member case 'uitloggen': var post = { sessie: wizard.sessionID }; exifStatement( { action: "exif_lidUitloggen", post: post } ); break; // redirect page after logout case 'bevestigen': self.location.href = './'; break; // ask confirmation before logout default: var html = ''; html+= ''; showPopup( { html: html, width: '440px', centerOn: 'screen' } ); } } function mijnprofiel_wachtwoord_vergeten( args ) { var id = (args && args.id ? args.id : 'inloggen_mijnprofiel'); var aktie = (args && args.aktie ? args.aktie : null); var emailObj = document.getElementById((id == 'inloggen_mijnprofiel' ? 'inlog_email2' : 'inlog_email')); if (!emailObj) return null; switch (aktie) { // sending login codes succeeded case 'versturen_gelukt': if (emailObj.vergetenObj) { var o = emailObj.vergetenObj; if (o.onclick) { o.onclick = null; o.style.cursor = ''; o.style.color = '#eee'; } } // ghost 'Vergeten?..' object var html = ''; html+= ''; showPopup( { html: html, width: '650px', centerOn: 'screen' } ); break; // sending login codes failed (email not valid) case 'versturen_mislukt_email_onjuist': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // sending login codes failed case 'versturen_mislukt': var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); break; // check fields and login default: var email = evaluateOneFormField(emailObj); if (email == false) { mijnprofiel_wachtwoord_vergeten( { aktie: 'versturen_mislukt_email_onjuist', id: id } ); return; } var post = { inlog_email: email, sessie: wizard.sessionID, actie: null, id: id }; exifStatement( { action: "exif_lidWachtwoordVergeten", post: post } ); if (args && args.src) emailObj.vergetenObj = args.src; // remember src object var html = '
'; html+= ''; html+= ''; html+= '
'; showPopup( { html: html, width: '430px', centerOn: 'screen', closeButton: false } ); } } function mijnprofiel_aanmelden( args ) { var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { // signup now case 'nu_aanmelden': var result = browseThroughFormAndEvaluate( { id: 'aanmelden_mijnprofiel' } ); if (!result) return; var geboortedatum = zeroFillLeft(result['aanmelden_geboortedag'].value, 2) + '-' + zeroFillLeft(result['aanmelden_geboortemaand'].value, 2) + '-' + zeroFillLeft(result['aanmelden_geboortejaar'].value, 2); var post = { email: result['aanmelden_email'].value, wachtwoord: result['aanmelden_wachtwoord'].value, schermnaam: result['aanmelden_schermnaam'].value, geboortedatum: geboortedatum, geslacht: result['aanmelden_geslacht'].value, sessie: wizard.sessionID }; exifStatement( { action: "exif_lidAanmelden", post: { lid: post } } ); break; // signup successful case 'aanmelding_gelukt': var html = ''; html+= '
Nu nog de aanmelding activeren!
'; html+= ''; //showPopup( { html: html, width: '550px', centerOn: 'screen' } ); showPopup( { html: html, width: '550px', centerOn: 'screen', onCloseClicked: function(){ self.location.replace('./mijnprofiel'); } } ); break; // signup failed (general) case 'aanmelding_mislukt': var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // signup failed (email exists) case 'aanmelding_mislukt_email_bestaat': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // signup failed (email not valid) case 'aanmelding_mislukt_email_onjuist': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // signup failed (schermnaam exists) case 'aanmelding_mislukt_schermnaam': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // check fields and signup default: var warning = 'Het veld is niet juist ingevuld.'; // default var result = browseThroughFormAndEvaluate( { id: 'aanmelden_mijnprofiel' } ); if (!result) return; for (var el in result) { if (result[el].warning === true) { if (result[el].id == 'aanmelden_schermnaam') warning = 'Hoofdletters, kleine letters, cijfers en streepje zijn toegestaan.
Minimaal 3 tekens en maximaal 15 tekens lang.'; else if (result[el].id == 'aanmelden_email') warning = 'Belangrijk! Het e-mail adres is ook om in te loggen.'; else if (result[el].id == 'aanmelden_wachtwoord') warning = 'Alleen kleine letters en cijfers toegestaan.
Minimaal 5 tekens en maximaal 10 tekens lang.'; var html = ''; html+= ''; showPopup( { html: html, width: '450px', centerOn: 'screen' } ); return; } } // check if logged in if (wizard.sessionIDLocked === true) { var html = ''; html+= '
Graag eerst even uitloggen!
'; html+= '
'; html+= ''; html+= '
'; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); return; } // signup conditions var obj = document.getElementById('aanmelden_voorwaarden'); if (obj && obj.checked != true) { var html = ''; html+= '
'; html+= ''; html+= '
'; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); return; } var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); } } function mijnprofiel_wijzigen( args ) { var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { // change profile now case 'nu_wijzigen': var result = browseThroughFormAndEvaluate( { id: 'wijzigen_mijnprofiel' } ); if (!result) return; var geboortedatum = zeroFillLeft(result['profiel_geboortedag'].value, 2) + '-' + zeroFillLeft(result['profiel_geboortemaand'].value, 2) + '-' + zeroFillLeft(result['profiel_geboortejaar'].value, 2); var netwerken = [], netwerk, url; for (var el in result) { try{ if (el.indexOf('profiel_social_status_') == -1) continue; netwerk = el.split('profiel_social_status_').join(''); if (countString(netwerk) == 0) continue; url = result['profiel_social_url_' + netwerk].value; if (countString(url) == 0 || url.indexOf('[accountnaam]') != -1 || url.indexOf(netwerk) == -1) continue; netwerken.push(netwerk + '{++}' + url + '{++}' + result[el].value); } catch(e){ continue; }; } var post = { schermnaam: result['profiel_schermnaam'].value, geslacht: result['profiel_geslacht'].value, geboortedatum: geboortedatum, email: result['profiel_email'].value, wachtwoord: result['profiel_wachtwoord'].value, netwerken: netwerken.join('{,,,}'), sessie: wizard.sessionID }; exifStatement( { action: "exif_profielWijzigen", post: { lid: post } } ); disablePopup(); // temporarely disable clicking in popup break; // changes successful & logout case 'wijziging_gelukt_uitloggen': mijnprofiel_uitloggen( { aktie: 'uitloggen' } ); break; // changes successful case 'wijziging_gelukt': self.location.replace('./mijnprofiel'); return; break; // changes failed (general) case 'wijziging_mislukt': var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // changes failed (email exists) case 'wijziging_mislukt_email_bestaat': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // changes failed (email not valid) case 'wijziging_mislukt_email_onjuist': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // changes failed (schermnaam exists) case 'wijziging_mislukt_schermnaam': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // check fields and save changes default: var warning = 'Het veld is niet juist ingevuld.'; // default var result = browseThroughFormAndEvaluate( { id: 'wijzigen_mijnprofiel' } ); if (!result) return; for (var el in result) { if (result[el].warning === true) { if (result[el].id == 'profiel_schermnaam') warning = 'Hoofdletters, kleine letters, cijfers en streepje zijn toegestaan.
Minimaal 3 tekens en maximaal 15 tekens lang.'; else if (result[el].id == 'profiel_email') warning = 'Belangrijk! Het e-mail adres is ook om in te loggen.'; else if (result[el].id == 'profiel_wachtwoord') warning = 'Alleen kleine letters en cijfers toegestaan.
Minimaal 5 tekens en maximaal 10 tekens lang.'; var html = ''; html+= ''; showPopup( { html: html, width: '450px', centerOn: 'screen' } ); return; } } // check if login has changed var email_old = result['profiel_email'].value_original; var email_new = result['profiel_email'].value; var email_has_changed = (email_old != email_new ? true : false); var wachtwoord_old = result['profiel_wachtwoord'].value_original; var wachtwoord_new = result['profiel_wachtwoord'].value; var wachtwoord_has_changed = (wachtwoord_old != wachtwoord_new ? true : false); var html = ''; html+= ''; if (email_has_changed || wachtwoord_has_changed) { html+= ''; } showPopup( { html: html, width: '440px', centerOn: 'screen' } ); return; } } function mijnprofiel_wissen( args ) { var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { // delete member case 'wissen': var post = { sessie: wizard.sessionID }; exifStatement( { action: "exif_lidVerwijderen", post: post } ); break; // redirect page after deleting member case 'bevestigen': self.location.href = './'; break; // deleting failed (general) case 'wissen_mislukt': var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); break; // ask confirmation before deleting default: var html = ''; html+= ''; showPopup( { html: html, width: '480px', centerOn: 'screen' } ); } } function shop_aanmelden( args ) { var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { // signup shop now case 'nu_aanmelden': var result = browseThroughFormAndEvaluate( { id: 'shop_aanmelden' } ); if (!result) return; var post = { aanhef: result['shop_aanhef'].value, contactpersoon: result['shop_contactpersoon'].value, bedrijfsnaam: result['shop_bedrijfsnaam'].value, adres: result['shop_adres'].value, postcode: result['shop_postcode'].value, woonplaats: result['shop_woonplaats'].value, land: result['shop_land'].value, website: result['shop_website'].value, email: result['shop_email'].value, telefoon: result['shop_telefoon'].value, opmerking: trim(convert_TextareaValueToString(result['shop_opmerking'].value, ' ')), sessie: wizard.sessionID }; exifStatement( { action: "exif_shopAanmelden", post: { shop: post } } ); break; // signup shop successful case 'aanmelding_gelukt': var html = ''; html+= '
Plaatsing kan enkele weken duren!
'; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen', onCloseClicked: function(){ self.location.href = './'; } } ); break; // signup shop failed (general) case 'aanmelding_mislukt': var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // signup failed (email exists) case 'aanmelding_mislukt_email_bestaat': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // signup failed (email not valid) case 'aanmelding_mislukt_email_onjuist': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // check fields and signup shop default: var warning = 'Het veld is niet juist ingevuld.'; // default var result = browseThroughFormAndEvaluate( { id: 'shop_aanmelden' } ); if (!result) return; for (var el in result) { if (result[el].warning === true) { if (result[el].id == 'shop_contactpersoon') warning = 'Voornaam en achternaam niet ingevuld.'; else if (result[el].id == 'shop_bedrijfsnaam') warning = 'Bedrijfsnaam is niet ingevuld.'; else if (result[el].id == 'shop_adres') warning = 'Adres is niet juist ingevuld.'; else if (result[el].id == 'shop_postcode') warning = 'Postcode is niet op de juiste manier ingevuld.'; else if (result[el].id == 'shop_woonplaats') warning = 'Woonplaats is niet ingevuld.'; else if (result[el].id == 'shop_website') warning = 'Website adres is niet goed ingevuld.'; else if (result[el].id == 'shop_email') warning = 'Het e-mail adres is niet goed ingevuld.'; else if (result[el].id == 'shop_telefoon') warning = 'Telefoonnummer is niet ingevuld.'; var html = ''; html+= ''; showPopup( { html: html, width: '450px', centerOn: 'screen' } ); return; } } // signup conditions var obj = document.getElementById('shop_voorwaarden'); if (obj && obj.checked != true) { var html = ''; html+= '
'; html+= ''; html+= '
'; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); return; } var shop_email = result['shop_email'].value; if (!shop_email) shop_aanmelden( { aktie: 'aanmelding_mislukt' } ); var html = ''; html+= '
Klopt het e-mail adres?
'; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); } } function shop_inloggen( args ) { var id = (args && args.id ? args.id : 'inloggen_webshop'); var aktie = (args && args.aktie ? args.aktie : null); var emailObj = document.getElementById('webshop_inlog_email'); if (!emailObj) return null; var wachtwoordObj = document.getElementById('webshop_inlog_wachtwoord'); if (!wachtwoordObj) return null; var keepaliveObj = document.getElementById('webshop_inlog_bewaren'); switch (aktie) { // login succeeded case 'inloggen_gelukt': var form = document.getElementById(id); if (form) form.submit(); // reload page break; // login failed case 'inloggen_mislukt': var html = ''; html+= '
Probeer het nogmaals.
'; html+= ''; showPopup( { html: html, width: '350px', centerOn: 'screen' } ); break; // check fields and login default: var keepalive = (keepaliveObj && keepaliveObj.checked == true ? 1 : 0); var email = evaluateOneFormField(emailObj); if (email == false) { shop_inloggen( { aktie: 'inloggen_mislukt', id: id } ); return; } var wachtwoord = evaluateOneFormField(wachtwoordObj); if (wachtwoord == false) { shop_inloggen( { aktie: 'inloggen_mislukt', id: id } ); return; } var post = { inlog_email: email, inlog_wachtwoord: wachtwoord, inlog_keepalive: keepalive, shopSessionID: wizard.shopSessionID, actie: null, id: id }; self.location.href = './shops_admin?s=1'; break; exifStatement( { action: "exif_shopInloggen", post: post } ); } } function shop_uitloggen( args ) { var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { // logout member case 'uitloggen': var post = { shopSessionID: wizard.shopSessionID }; exifStatement( { action: "exif_shopUitloggen", post: post } ); break; // redirect page after logout case 'bevestigen': self.location.href = './shops'; break; // ask confirmation before logout default: var html = ''; html+= ''; showPopup( { html: html, width: '560px', centerOn: 'screen' } ); } } function shop_wachtwoord_vergeten( args ) { var id = (args && args.id ? args.id : 'inloggen_webshop'); var aktie = (args && args.aktie ? args.aktie : null); var emailObj = document.getElementById('webshop_inlog_email'); if (!emailObj) return null; switch (aktie) { // sending login codes succeeded case 'versturen_gelukt': if (emailObj.vergetenObj) { var o = emailObj.vergetenObj; if (o.onclick) { o.onclick = null; o.style.cursor = ''; o.style.color = '#eee'; } } // ghost 'Vergeten?..' object var html = ''; html+= ''; showPopup( { html: html, width: '650px', centerOn: 'screen' } ); break; // sending login codes failed (email not valid) case 'versturen_mislukt_email_onjuist': var html = ''; html+= ''; showPopup( { html: html, width: '550px', centerOn: 'screen' } ); break; // sending login codes failed case 'versturen_mislukt': var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); break; // check fields and login default: var email = evaluateOneFormField(emailObj); if (email == false) { shop_wachtwoord_vergeten( { aktie: 'versturen_mislukt_email_onjuist', id: id } ); return; } var post = { inlog_email: email, sessie: wizard.sessionID, actie: null, id: id }; exifStatement( { action: "exif_shopWachtwoordVergeten", post: post } ); if (args && args.src) emailObj.vergetenObj = args.src; // remember src object var html = '
'; html+= ''; html+= ''; html+= '
'; showPopup( { html: html, width: '430px', centerOn: 'screen', closeButton: false } ); } } function lid_shopFavorietMaken( args ) { var shopId = (args && args.shopId ? args.shopId : null); var shopNaam = (args && args.shopNaam ? args.shopNaam : null); var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { case 'favoriet_maken': // make this shop a favourite if (!shopId) return; var post = { id: shopId, sessie: wizard.sessionID }; exifStatement( { action: "exif_shopFavorietMaken", post: post } ); break; case 'succesvol': // making shop favourite succesful hidePopup(); // first hide popup embedFlashOrAlternate( { target: document.getElementById("swf_hartjes"), src: "./flash/hearts/hearts.swf?build=" + top.build, name: "shop_hearts", flashvars: "maxHearts=15&JSObjectName=shop_hearts" , width: "250px", height: "400px", wmode: "transparent" } ); var objButton = document.getElementById('favoriettekst'); if (objButton) { objButton.innerHTML = ''; objButton.onclick = function(){ lid_shopFavorietMaken( { aktie: "is_al_favoriet" } ); }; } var obj = document.getElementById('import_favorieten'); if (obj) obj.importHTML(); break; case 'mislukt': // making shop favourite failed var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '650px', centerOn: 'screen' } ); break; case 'is_al_favoriet': // already a favourite shop var html = ''; html+= '
'; html+= '
KLIK HIER voor een overzicht van al jouw favorieten.
'; html+= '
'; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); break; case 'timer': // hearts timer var obj = document.getElementById('swf_hartjes'); if (obj.countdown) { obj.countdown = null; obj.innerHTML = ' '; obj.style.width = '1px'; obj.style.height = '1px'; } else { setTimeout( function(){ lid_shopFavorietMaken( { aktie: 'timer' } ); } , 7500 ); // 7,5 sec AS3FirefoxStatusBarFix(); obj.style.width = ''; obj.style.height = ''; obj.countdown = true; } break; default: // ask before making favourite if (wizard.sessionIDLocked !== true) { var html = ''; html+= '
'; html+= '
Als je een shop aan je favorieten wilt toevoegen moet je ingelogd zijn.
KLIK HIER om in te loggen of wordt gratis lid.
'; html+= '
'; showPopup( { html: html, width: '650px', centerOn: 'screen' } ); return; } if (!shopId || !shopNaam) return; var html = ''; html+= ''; showPopup( { html: html, width: '540px', centerOn: 'screen' } ); } } function lid_shopFavorietWissen( args ) { var shopId = (args && args.shopId ? args.shopId : null); var shopNaam = (args && args.shopNaam ? args.shopNaam : null); var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { case 'nu_wissen': // remove shop favourite if (!shopId) return; var post = { id: shopId, sessie: wizard.sessionID }; exifStatement( { action: "exif_shopFavorietWissen", post: post } ); break; case 'succesvol': // remove shop favourite successful self.location.replace('./mijnprofiel'); return; //hidePopup(); // first hide popup //var obj = document.getElementById('import_favorieten'); //if (obj) obj.importHTML(); break; case 'mislukt': // remove shop favourite failed var html = ''; html+= ''; showPopup( { html: html, width: '500px', centerOn: 'screen' } ); break; default: // ask before following shop if (!shopId || !shopNaam) return; var html = ''; html+= ''; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); } } function lid_reactiePlaatsen( args ) { var shopId = (args && args.shopId ? args.shopId : null); var shopNaam = (args && args.shopNaam ? args.shopNaam : null); var dagaanbiedingId = (args && args.dagaanbiedingId ? args.dagaanbiedingId : null); var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { case 'reactie_plaatsen': // save shop reply if (!dagaanbiedingId && !shopId) return; var obj = document.getElementById('reactie_plaatsen'); // textarea object if (obj) { var tekst = myRegExp(obj.value, '[ A-Za-z0-9\-\.\,\!\?\&\+\=\:\;ßeéèêënñoòóôõöaàáâãäåiìíîïuùúûüyýÿ\n\r]'); obj.value = tekst = trim(ucFirst(tekst)); // also rewrite textarea value // too little input, focus again and do nothing if (countString(tekst) < 15) { var errorObj = document.getElementById('lid_reactie_error'); if (errorObj) errorObj.innerHTML = 'Minimaal een reactie van 15 tekens lang.'; focusElement(obj); return; } var optie = (dagaanbiedingId ? 'dagaanbieding' : 'shop'); var id = (dagaanbiedingId ? dagaanbiedingId : shopId); var post = { optie: optie, id: id, tekst: tekst, sessie: wizard.sessionID }; exifStatement( { action: "exif_reactiePlaatsen", post: post } ); } break; case 'succesvol': // saving shop reply succesful hidePopup(); // first hide popup var obj = document.getElementById('import_reacties'); if (obj) obj.importHTML(); break; case 'mislukt': // saving shop reply failed var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '650px', centerOn: 'screen' } ); break; case 'al_geplaatst': // already posted a reply today for this shop var html = ''; html+= '
'; html+= '
Je mag op elke pagina maar één reactie per dag plaatsen.
'; html+= '
'; showPopup( { html: html, width: '650px', centerOn: 'screen' } ); break; default: // first login, then type reply if (wizard.sessionIDLocked !== true) { var html = ''; html+= '
'; html+= '
Als je op deze pagina een reactie wilt plaatsen moet je ingelogd zijn.
KLIK HIER om in te loggen of om gratis lid te worden.
'; html+= '
'; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); return; } if (!dagaanbiedingId && (!shopId || !shopNaam)) return; var inputMaxLength = 140; var html = ''; html+= ''; html+= '
'; html+= ''; html+= '
(minimaal 15 en nog maximaal ' +inputMaxLength+ ' tekens te gaan)
'; html+= '
'; html+= '
'; html+= '1 wij behouden ons het recht voor reacties te wijzigen of te verwijderen.
2 zijn er echt klachten over een shop? Stuur ons dan liever een e-mail!'; html+= '
'; html+= '
 
'; if (dagaanbiedingId) html+= ''; else if (shopId) html+= ''; else return; scrollToAnchor('reactiesANCHOR', -40); // jump to anchor showPopup( { html: html, width: '500px', centerOn: 'screen', onLoad: function(){ focusElement('reactie_plaatsen'); } } ); } } function lid_tipEenVriend( args ) { var shopId = (args && args.shopId ? args.shopId : null); var shopNaam = (args && args.shopNaam ? args.shopNaam : null); var dagaanbiedingId = (args && args.dagaanbiedingId ? args.dagaanbiedingId : null); var aktie = (args && args.aktie ? args.aktie : null); var errorObj = document.getElementById('lid_tip_error'); switch (aktie) { case 'tip_versturen': // send lead e-mail now var zenderNaamObj = document.getElementById('zender_naam'); var zenderEmailObj = document.getElementById('zender_email'); var ontvangerNaamObj = document.getElementById('ontvanger_naam'); var ontvangerEmailObj = document.getElementById('ontvanger_email'); if (zenderNaamObj && zenderEmailObj && ontvangerNaamObj && ontvangerEmailObj) { var zenderNaam = zenderNaamObj.value; if (countString(zenderNaam) == 0) { lid_tipEenVriend( { aktie: 'zender_naam_onjuist' } ); return; } var zenderEmail = evaluateOneFormField(zenderEmailObj); if (zenderEmail == false) { lid_tipEenVriend( { aktie: 'zender_email_onjuist' } ); return; } var ontvangerNaam = ontvangerNaamObj.value; if (countString(ontvangerNaam) == 0) { lid_tipEenVriend( { aktie: 'ontvanger_naam_onjuist' } ); return; } var ontvangerEmail = evaluateOneFormField(ontvangerEmailObj); if (ontvangerEmail == false) { lid_tipEenVriend( { aktie: 'ontvanger_email_onjuist' } ); return; } var optie = (dagaanbiedingId ? 'dagaanbieding' : (shopId ? 'shop' : null)); var id = (dagaanbiedingId ? dagaanbiedingId : (shopId ? shopId : null)); var post = { optie: optie, id: id, zender_naam: zenderNaam, zender_email: zenderEmail, ontvanger_naam: ontvangerNaam, ontvanger_email: ontvangerEmail, sessie: wizard.sessionID }; exifStatement( { action: "exif_tipEenVriend", post: post } ); disablePopup(); // temporarely disable clicking in popup } else { lid_tipEenVriend( { aktie: 'mislukt' } ); return; } break; case 'succesvol': // lead e-mail send succesful var html = ''; html+= ''; showPopup( { html: html, width: '350px', centerOn: 'screen' } ); break; case 'mislukt': // sending lead e-mail failed if (errorObj) errorObj.innerHTML = 'Door onbekende reden is het versturen niet gelukt.'; enablePopup(); focusElement('zender_naam'); break; case 'zender_naam_onjuist': // name sender field failed if (errorObj) errorObj.innerHTML = 'Jouw naam is niet ingevuld.'; enablePopup(); focusElement('zender_naam'); break; case 'ontvanger_naam_onjuist': // name receiver field failed if (errorObj) errorObj.innerHTML = 'Naam ontvanger is niet ingevuld.'; enablePopup(); focusElement('ontvanger_naam'); break; case 'zender_email_onjuist': // e-mail sender field failed if (errorObj) errorObj.innerHTML = 'Jouw e-mail adres is niet (juist) ingevuld.'; enablePopup(); focusElement('zender_email'); break; case 'ontvanger_email_onjuist': // e-mail receiver field failed if (errorObj) errorObj.innerHTML = 'E-mail adres ontvanger is niet (juist) ingevuld.'; enablePopup(); focusElement('ontvanger_email'); break; default: // send lead e-mail about shop var html = ''; if (shopId && shopNaam) { html+= '
'; html+= 'Vind je ' +shopNaam+ ' helemaal leuk? Stuur een e-mailtje naar je beste vriend(in) en deel jouw blijdschap over deze webshop.'; html+= '
'; } else if (dagaanbiedingId) { html+= '
'; html+= 'Vind jij deze dagaanbieding een topper? Tip dan nu je beste vriend(in) doormiddel van een leuk e-mailtje.'; html+= '
'; } else { html+= '
'; html+= 'Vind je Shopdiva helemaal te gek? Stuur een e-mailtje naar je beste vriend(in) en deel jouw blijdschap over ons.'; html+= '
'; } html+= '
'; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= '
jouw naam
jouw e-mail adres
'; html+= '
'; html+= ''; html+= '
'; html+= '
'; html+= '
ontvanger naam
ontvanger e-mail adres
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
* wij zijn wettelijk verplicht deze gegevens eenmalig te vragen
'; if (dagaanbiedingId) html+= '
'; else if (shopId) html+= '
'; else html+= '
'; html+= '
'; html+= '
 
'; showPopup( { html: html, width: '500px', centerOn: 'screen', onLoad: function(){ focusElement('zender_naam'); } } ); } } function lid_prijsvraagVersturen( args ) { var prijsvraagId = (args && args.prijsvraagId ? args.prijsvraagId : null); var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { case 'succesvol': // participating succesful var html = ''; html+= '
'; html+= '
Bedankt voor het meedoen met onze prijsvraag.
En veel succes met winnen.
'; html+= '
'; showPopup( { html: html, width: '500px', centerOn: 'screen', onCloseClicked: function(){ self.location.replace('./prijsvraag'); } } ); break; break; case 'mislukt': // participating failed var html = ''; html+= '
Neem per e-mail contact met ons op
'; html+= ''; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); break; case 'al_meegedaan': // already participated var html = ''; html+= '
'; html+= '
Je mag aan elke prijsvraag maar één keer meedoen.
'; html+= '
'; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); break; case 'niet_ingelogd': // not logged in var html = ''; html+= '
'; html+= '
Je bent om één of andere reden niet meer ingelogd!
Klik HIER om in te loggen.
'; html+= '
'; showPopup( { html: html, width: '600px', centerOn: 'screen' } ); break; default: // participate if (!prijsvraagId) return; var antwoord = null; var obj = document.getElementsByName('prijsvraag_meerkeuze'); if (!obj) return; for (var i = 0; i < obj.length; i++) if (obj[i].checked == true) antwoord = i + 1; if (!antwoord) return; var post = { prijsvraag_id: prijsvraagId, antwoord: antwoord, sessie: wizard.sessionID }; exifStatement( { action: "exif_lidPrijsvraagVersturen", post: post } ); } } // -------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------- function profilePhoto_display(s) { var o = document.getElementById('PROFILE_PHOTO_EDITOR_swf'); if (o) o.style.width = (s == 'hide' ? '0px' : ''); } function profilePhoto_failure( args ) { var foutmelding = (args && args.message ? args.message : 'Onbekende fout tijdens het uploaden.'); var html = ''; html+= '
'; html+= '
' +foutmelding+ '
'; html+= '
'; showPopup( { html: html, width: '500px', centerOn: 'screen', onCloseClicked: (safari ? function(){ profilePhoto_display('show'); hidePopup(); } : null) } ); if (safari) profilePhoto_display('hide'); } function profilePhoto_complete( args ) { if (args && args.updateFoto == true) { if (safari) profilePhoto_display('show'); var obj_profielfoto = document.getElementById('profiel_profielfoto'); if (obj_profielfoto) { var imgSrc = obj_profielfoto.getAttribute('imgSrc'); if (imgSrc) obj_profielfoto.src = imgSrc + '?cache=' + antiCacheString(); } return; } var melding = (args && args.message ? args.message : 'Hartstikke leuk hoor.. je staat er weer helemaal te gek op!'); var html = ''; html+= '
'; html+= '
' +melding+ '
'; html+= '
'; showPopup( { html: html, width: '550px', centerOn: 'screen', onCloseClicked: function(){ profilePhoto_complete( { updateFoto: true } ); hidePopup(); } } ); if (safari) profilePhoto_display('hide'); } function profilePhoto_import( args ) { if (isNull(args)) return false; var target = (args.target ? args.target : null); if (isNull(target)) return false; var lidId = (args.lidId ? args.lidId : null); if (isNull(lidId)) return false; var lidPhoto = (args.lidPhoto ? args.lidPhoto : null); if (isNull(lidPhoto)) return false; var flashObjId = target + '_swf'; var flashVars = 'JSObjectName=' + flashObjId; flashVars+= '&sessie=' + wizard.sessionID; flashVars+= '&upload_max_filesize=' + wizard.upload_max_filesize; flashVars+= '&fileslot=' + lidId; // prefix flashVars+= '&lidPhoto=' + lidPhoto; var wmode = (safari ? 'window' : 'transparent'); // safari wmode hit bug (apple sucks) embedFlashOrAlternate( { target: document.getElementById(target), src: "./flash/profilePhoto/profilePhoto.swf?build=" + top.build, name: flashObjId, flashvars: flashVars , width: "100%", height: "100%", wmode: wmode } ); // prevent outside flash dragging failure var mouseUpMethod = function() { try{ execFlash[flashObjId].send( { action: "jsMouseUpEvent" } ); } catch(e){ return false; }; }; // mouse event method if (ie) document.onmouseup = mouseUpMethod; else attachEventListener( document, 'mouseup', mouseUpMethod); // prevent text selections while dragging in flash ie & opera (firefox via css, chrome & safari don't need it) if (ie) { document.onmousedown = onTextSelect; document.ondragstart = function() { return false; }; document.onselectstart = onTextSelect; } if (opera) { attachEventListener( document, 'mousedown', onTextSelect); } } function news_switchArchive(e) { e = (e ? e : event); var obj = document.getElementById('import_nieuws_archief'); if (!obj) return; if (obj.archiveOpen == true) { obj.archiveOpen = false; obj.style.height = obj.oldHeight; obj.scrollTop = 0; // reset obj.style.overflowY = 'hidden'; return; } var eSource = (e.target ? e.target : e.srcElement); if (eSource && eSource.id == 'importNewsDDEvent') { obj.archiveOpen = true; var openHeight = obj.getAttribute('openHeight'); obj.oldHeight = obj.style.height; obj.style.height = (openHeight ? openHeight : ''); obj.style.overflowY = 'auto'; } } function search_autoComplete( args ) { if (!args) return; if (args.onkey) { importHTML( { url: 'php/search_keywords.php', post: { string: trim(args.input) }, target: 'shop_zoeken_resultaat', onFinished: search_autoComplete } ); return; } if (args.exif_data) { var obj = document.getElementById('shop_zoeken'); if (obj) obj.style.color = (args.exif_data_empty !== true || countString(trim(obj.value)) == 0 ? '#555' : '#f89039'); return; } if (args.autoComplete) { var obj = document.getElementById('shop_zoeken'); if (obj) { obj.value = args.autoComplete; obj.focus(); } return; } if (args.onbutton) { var obj = document.getElementById('shop_zoeken'); // no input yet if (obj.value == 'zoek een shop..' || countString(trim(obj.value)) == 0) { var html = ''; html+= '
'; html+= '
Wij willen natuurlijk graag weten wat je wilt gaan zoeken.
Dus vul snel iets in en begin met zoeken!
'; html+= '
'; showPopup( { html: html, width: '430px', centerOn: 'screen' } ); return; } // go search if (obj) self.location.href = wizard.websiteBaseURL + 'zoeken/' + obj.value.split('&').join('EN'); // convert temporarely & to EN (uppercase only) //if (obj) self.location.href = './zoeken/' + obj.value; return; } } function importHTML( args ) { // target object will be hidden if there is no data (or .onEmptyHide must be set to false) // if .onFinished has been set, it will execute after importHTML has finished (data or no data) var obj = (args && args.target ? document.getElementById(args.target) : null); if (!obj) return; if (args.exif_finished) { if (args.exif_data_empty == true) { obj.style.display = (obj.onEmptyHide == true ? 'none' : 'block'); } // if no data else if (args.exif_data) { var html = args.exif_data.toString(); obj.style.display = 'block'; obj.innerHTML = html; } // if data if (obj.importHtmlExec) { var onFinished = obj.importHtmlExec; obj.importHtmlExec = null; onFinished(args, obj); } // execute onFinished AS3FirefoxStatusBarFix(); // fix status bar after AS3 load } else { if (args.url) { obj.importHtmlExec = (args.onFinished ? args.onFinished : null); obj.onEmptyHide = (args.onEmptyHide == false ? false : true); exifStatement( { action: "exif_loadExternalData", url: args.url, target: args.target, post: args.post, onload: 'importHTML'} ); } } } function shop_KortingscouponTonen( args ) { var errorObj = document.getElementById('shop_coupon_error'); var couponId = (args && args.couponId ? args.couponId : null); var aktie = (args && args.aktie ? args.aktie : null); switch (aktie) { case 'coupon_versturen': // send coupon now var zenderNaamObj = document.getElementById('zender_naam'); var zenderEmailObj = document.getElementById('zender_email'); var ontvangerNaamObj = document.getElementById('ontvanger_naam'); var ontvangerEmailObj = document.getElementById('ontvanger_email'); if (zenderNaamObj && zenderEmailObj && ontvangerNaamObj && ontvangerEmailObj) { var zenderNaam = zenderNaamObj.value; if (countString(zenderNaam) == 0) { shop_KortingscouponTonen( { aktie: 'zender_naam_onjuist' } ); return; } var zenderEmail = evaluateOneFormField(zenderEmailObj); if (zenderEmail == false) { shop_KortingscouponTonen( { aktie: 'zender_email_onjuist' } ); return; } var ontvangerNaam = ontvangerNaamObj.value; if (countString(ontvangerNaam) == 0) { shop_KortingscouponTonen( { aktie: 'ontvanger_naam_onjuist' } ); return; } var ontvangerEmail = evaluateOneFormField(ontvangerEmailObj); if (ontvangerEmail == false) { shop_KortingscouponTonen( { aktie: 'ontvanger_email_onjuist' } ); return; } var post = { id: couponId, zender_naam: zenderNaam, zender_email: zenderEmail, ontvanger_naam: ontvangerNaam, ontvanger_email: ontvangerEmail, sessie: wizard.sessionID }; exifStatement( { action: "exif_shopKortingscouponTonen", post: post } ); disablePopup(); // temporarely disable clicking in popup } else { shop_KortingscouponTonen( { aktie: 'mislukt' } ); return; } break; case 'succesvol': // lead e-mail send succesful var html = ''; html+= ''; showPopup( { html: html, width: '400px', centerOn: 'screen' } ); break; case 'mislukt': // sending lead e-mail failed if (errorObj) errorObj.innerHTML = 'Door onbekende reden is het versturen niet gelukt.'; enablePopup(); focusElement('zender_naam'); break; case 'zender_naam_onjuist': // name semder field failed if (errorObj) errorObj.innerHTML = 'Jouw naam is niet ingevuld.'; enablePopup(); focusElement('zender_naam'); break; case 'ontvanger_naam_onjuist': // name receiver field failed if (errorObj) errorObj.innerHTML = 'Naam ontvanger is niet ingevuld.'; enablePopup(); focusElement('ontvanger_naam'); break; case 'zender_email_onjuist': // e-mail sender field failed if (errorObj) errorObj.innerHTML = 'Jouw e-mail adres is niet (juist) ingevuld.'; enablePopup(); focusElement('zender_email'); break; case 'ontvanger_email_onjuist': // e-mail receiver field failed if (errorObj) errorObj.innerHTML = 'E-mail adres ontvanger is niet (juist) ingevuld.'; enablePopup(); focusElement('ontvanger_email'); break; default: // send lead e-mail about shop var srcObj = (args && args.srcObj ? args.srcObj : null); if (!srcObj) return; var shopNaam = (args && args.shopNaam ? args.shopNaam : null); var couponCode = (args && args.couponCode ? args.couponCode : null); var couponVoorwaarden = (args && args.couponVoorwaarden ? args.couponVoorwaarden : ''); var html = ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= '
'; html+= ''; html+= ''; html+= '
' + shopNaam + '
' + (couponCode ? 'kortingscode: ' + couponCode + '
' : '') + '' + couponVoorwaarden + '
'; html+= '
'; html+= '
'; html+= '
Maak iemand anders ook blij met deze coupon!
Stuur jouw vriend(in) direct een e-mail.
'; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= ''; html+= '
jouw naam
jouw e-mail adres
'; html+= '
'; html+= ''; html+= '
'; html+= '
'; html+= '
ontvanger naam
ontvanger e-mail adres
'; html+= '
'; html+= '
'; html+= '
'; html+= '
'; html+= '
* wij zijn wettelijk verplicht deze gegevens eenmalig te vragen
'; html+= '
'; html+= '
'; html+= '
 
'; showPopup( { html: html, width: '520px', centerOn: 'screen', onLoad: function(){ focusElement('zender_naam'); } } ); } } function csDropDownInitialize( args ) { if (!args || !args.object) return; // register and check objects var d = document; var objSelect = args.object; var objParent = objSelect.parentNode; if (!objParent) return; // class="csDropDownPackage" var objSelected = getFirstChildElement(objSelect); if (!objSelected) return; var optionsObj = getFirstChildElement(objParent); if (!optionsObj) return; objSelect.options = {}; // start with empty object objSelect.packageParent = objParent; // give handle to package objSelect.optionsObj = optionsObj; // give handle to optionsObj objSelect.onChange = (args.onChange ? args.onChange : false); // onChange callback function? objSelect.onHover = (args.onHover ? args.onHover : false); // onHover callback function? objSelect.visible = (function(b) { this.parentNode.style.display = (b == true ? 'block' : 'none'); }); // custom function objSelect.changeIndex = (function(i) { if (this.options && this.options[i]) csDropDownChangeSelection( this.options[i], true); }); // custom function objSelect.optionMouseOver = function() { if (this.selected != true && this.clickable != false) this.style.background = '#eaf0fb'; //if (this.clickable == false) this.style.cursor = 'default'; //if (this.selected != true) this.style.background = '#eaf0fb'; if (this.optionParent.onHover) this.optionParent.onHover(this); var abc = this.getAttribute('dd_voorbeeld'); if (hasValue(abc)) { var hoihoi = document.getElementById('hoihoi666'); if (hoihoi) { hoihoi.innerHTML = ''; hoihoi.style.left = (getLeft(this) + this.offsetWidth - 8) + 'px'; hoihoi.style.top = (getTop(this) + 16) + 'px'; hoihoi.style.zIndex = setAndGetNextHighestDepth(); // update zIndex hoihoi.style.display = "block"; } //var def = getNextSibling(this); if (def) def.style.display = 'block'; } }; // mouseover objSelect.optionMouseOut = function() { if (this.selected != true) this.style.background = ''; var abc = this.getAttribute('dd_voorbeeld'); if (hasValue(abc)) { var hoihoi = document.getElementById('hoihoi666'); if (hoihoi) { hoihoi.innerHTML = ''; //hoihoi.style.left = (getLeft(option) + option.offsetWidth) + 'px'; //hoihoi.style.top = (getTop(option) + 10) + 'px'; hoihoi.style.display = "none"; } //var def = getNextSibling(this); if (def) def.style.display = 'none'; } }; // mouseout //objSelect.optionMouseOver = function() { if (this.selected != true) this.style.background = '#eaf0fb'; }; // mouseover //objSelect.optionMouseOut = function() { if (this.selected != true) this.style.background = ''; }; // mouseout optionsObj.optionsParent = objSelect; // register parent object of this optionsObj.packageParent = objParent; // register package parent object of this optionsObj.onmouseover = function() { this.style.cursor = 'pointer'; }; // mouseover optionsObj.onmouseout = function() { this.style.cursor = ''; }; // mouseout var maxLines = (args.maxLines > 0 ? args.maxLines : false); // determine if maxLines is set var mouseWheelEventName = (firefox ? 'DOMMouseScroll' : (ie ? 'onmousewheel' : 'mousewheel')); // determine correct event name var mouseClickEventName = (ie ? 'onclick' : 'click'); // determine correct event name // attach document mousewheel event (but only once) if (d.csDropDownHandlersInstall != true) { d.csDropDownHandlersInstall = true; // remember setting it if (ie) d[mouseWheelEventName] = csDropDownOnScrollWheelDocument; else attachEventListener( d, mouseWheelEventName, csDropDownOnScrollWheelDocument); // IE specific attachEventListener(d, mouseClickEventName, clickSelect); // all browsers } // attach optionsObj mousewheel event if (ie) optionsObj[mouseWheelEventName] = csDropDownOnScrollWheel; // IE only so 'this' will be correct in callback else attachEventListener( optionsObj, mouseWheelEventName, csDropDownOnScrollWheel); // all other browsers // attach objSelect mousewheel event (targeted at optionsObj) if (ie) objSelect[mouseWheelEventName] = csDropDownOnScrollWheel; // IE only so 'this' will be correct in callback else attachEventListener( objSelect, mouseWheelEventName, csDropDownOnScrollWheel); // all other browsers var optionSelected = false; // start off false var optionsObjNodes = getChildElements(optionsObj); // get all options var optionCount = count(optionsObjNodes); // count them var optionVisibleCount = 0; // start of zero // register values and set events for all options for (var i = 0; i <= optionCount; i++) { obj = optionsObjNodes[i]; if (!obj) continue; // shortcut objSelect.options[i] = obj; // create options object obj.optionParent = objSelect; // register parent object of option obj.value = obj.getAttribute('value'); // register option value from attribute (not .innerHTML) obj.index = i; // register option index obj.visible = ('NO|FALSE|0'.indexOf((obj.getAttribute('visible')+'').toUpperCase()) != -1 ? false : true); // mark as visible / not visible obj.style.width = (objParent.offsetWidth - 9) + 'px'; // adjust width to parent if (obj.visible) { obj.clickable = true; optionVisibleCount++; obj.onmouseover = objSelect.optionMouseOver; obj.onmouseout = objSelect.optionMouseOut; } else { obj.clickable = false; obj.style.display = 'none'; } // count visible only obj.style.margin = (i > optionVisibleCount ? 0 : 2)+ 'px 2px ' +(i < optionCount ? 0 : 2)+ 'px 2px'; // adjust margin according to position in list obj.style.padding = (i > optionVisibleCount ? 2 : 1)+ 'px 0px ' +(i < optionCount ? 3 : 2)+ 'px 3px'; // adjust padding according to position in list if ('YES|TRUE|1'.indexOf((obj.getAttribute('selected')+'').toUpperCase()) != -1) optionSelected = obj; // if true mark this option as selected } if (optionSelected == false) optionSelected = optionsObjNodes[0]; // if none pre-selected, then select first // calculate dropdown height if maxLines is set if (maxLines) { if (optionSelected.visible == false) optionSelected.style.display = 'block'; // temporarely make visible for maxLines calculation (NEW CODE) optionsObj.optionHeight = optionSelected.offsetHeight + 2; // remember optionHeight if (optionSelected.visible == false) optionSelected.style.display = 'none'; // set visibility again (if needed) (NEW CODE) var maxHeight = (optionsObj.optionHeight * maxLines) + 2; // maximum height according to maxLines if (maxHeight > 0 && optionsObj.offsetHeight > maxHeight) optionsObj.style.height = maxHeight + 'px'; // if necessary set fixed height } if (optionsObj.scrollHeight > optionsObj.offsetHeight) { optionsObj.style.overflowX = 'hidden'; optionsObj.style.overflowY = 'scroll'; } // make it scrollable else { optionsObj.style.overflowX = 'hidden'; optionsObj.style.overflowY = 'hidden'; optionsObj.style.height = ''; } // no fixed height, not scrollable optionsObj.style.visibility = 'visible'; // now make dropdown visible (when not visible you can still do calculations) optionsObj.style.display = 'none'; // but do not yet display dropdown // if only one (visible) option available if (optionVisibleCount <= 1) { objSelected.style.color = '#777'; // make the text grey var objSelectNodes = getChildElements(objSelect); // get child elements var objSelectIcon = objSelectNodes[1]; // select the icon child element if (objSelectIcon && objSelectIcon.src) objSelectIcon.src = './img/page_icon_select_grey.png'; // make the dropdown icon a grey one } else { objSelect.onmouseover = setTimeoutClosure(function(x) { x.padding = '0px'; x.border = '2px solid #f9b73a'; x.cursor = 'pointer'; }, 10, objSelect.style); // mouse over objSelect.onmouseout = setTimeoutClosure(function(x) { x.border = '0px'; x.padding = '2px'; x.cursor = ''; }, 10, objSelect.style); // mouse out } objSelect.clickable = (optionVisibleCount > 1 ? true : false); // determine if dropdown select is clickable objSelect.style.visibility = (optionVisibleCount == 0 ? 'hidden' : 'visible'); // just now make select body visible (if at least one option available) csDropDownChangeSelection(optionSelected, true); // change marked selected, but do not fire onChange event yet objParent.style.display = (args.visible === false ? 'none' : 'block'); // set whole select as visible or not visible (if given as argument) } function csDropDownOnScrollWheel( evt ) { var obj = this; // current target if (obj.optionsObj) obj = obj.optionsObj; // optionsObj or objSelect if (obj != document.csDropDownActive) return; // not from active dropdown document.noMouseWheel = true; // set temporarely true var evt = (evt) ? evt : event; // get event if (evt) { var wheelData = (evt.detail ? evt.detail * -1 : evt.wheelDelta); // get wheelData (positive or negative) obj.scrollTop-= (obj.optionHeight ? obj.optionHeight * (wheelData > 0 ? 3 : -3) : wheelData / 2); // scroll up or down if (ie) { evt.cancelBubble = true; evt.returnValue = false; } // cancel event IE if (evt.stopPropagation) evt.stopPropagation(); // cancel event W3C if (evt.preventDefault) evt.preventDefault(); // cancel event W3C return false; // return false } } function csDropDownOnScrollWheelDocument( evt ) { if (document.noMouseWheel == true) { document.noMouseWheel = false; // set false again if (ie) { evt.cancelBubble = true; evt.returnValue = false; } // cancel event IE if (evt.stopPropagation) evt.stopPropagation(); // cancel event W3C if (evt.preventDefault) evt.preventDefault(); // cancel event W3C return false; // return false } } function clickSelect(e) { e = (e ? e : event); var eSource = (e.target ? e.target : e.srcElement); if (!eSource) return; var d = document, className, option = false, obj = false; //var CSDDDEFERCLICK = eSource.getAttribute('CSDDDEFERCLICK'); // if (CSDDDEFERCLICK) CSDDDEFERCLICK = d.getElementById(CSDDDEFERCLICK); // if (CSDDDEFERCLICK) obj = CSDDDEFERCLICK; // browse for classNames (but only need to go through 5 parentNodes) for (var i = 0; i != 10; i++) { //for (var i = 0; i != 5; i++) { className = (eSource.className ? eSource.className.toString().toUpperCase() : ''); if (className == 'CSDROPDOWNDISPLAY') { obj = eSource; break; } if (className == 'CSDROPDOWNLISTOPTION') { option = eSource; obj = option.optionParent; break; } if (eSource.parentNode) eSource = eSource.parentNode; } if (obj) { var objSelect = obj; if (objSelect.clickable === false) return; var objParent = objSelect.parentNode; if (!objParent) return; var objSelected = getFirstChildElement(objSelect); if (!objSelected) return; var optionsObj = getFirstChildElement(objParent); if (!optionsObj) return; } var selectOpen = (d.csDropDownActive ? true : false); // select open or closed var selectClick = (obj ? true : false); // select box clicked or not if (option) { //if (option.clickable !== false) csDropDownChangeSelection(option); // if option selected then change selection if (option.clickable === false) return; // !!?!?!?!?!?!?!? else csDropDownChangeSelection(option); // if option selected then change selection } //if (option) csDropDownChangeSelection(option); // if option selected then change selection if (selectOpen) { d.csDropDownActive.style.display = 'none'; } // if something open then close first if (selectClick && optionsObj != d.csDropDownActive && !option) { d.csDropDownActive = optionsObj; // remember current opened dropdown options optionsObj.style.display = 'block'; // open up this selects dropdown options object csDropDownSetPosition(optionsObj); // position new opened dropdown options object } else { d.csDropDownActive = null; // remember there is no current opened dropdown options } // temporarely var hoihoi = document.getElementById('hoihoi'); if (hoihoi) hoihoi.style.display = 'none'; } function csDropDownSetPosition(obj) { if (!obj || !obj.style || !obj.parentNode) return; var objParent = obj.parentNode; var objParentTop = getTop(objParent); var objSelect = obj.optionsParent; obj.style.left = (getLeft(objParent) + 0) + 'px'; obj.style.top = (objParentTop + 28) + 'px'; var objHeight = obj.offsetHeight; var objBottom = getTop(obj) + objHeight; var viewportBottom = getViewportHeight(document) + getScrollTop(document); var objTop = (objBottom > viewportBottom ? objParentTop - objHeight : objParentTop + 28); if (objTop > getScrollTop(document)) obj.style.top = objTop + 'px'; obj.style.zIndex = setAndGetNextHighestDepth(); // set on top // position scrollTop of optionObj (if scrollable) so option is nicely on top if (objSelect) { var option = objSelect.options[objSelect.selectedIndex]; if (option) { var scrTop = option.offsetTop - 2; obj.scrollTop = (scrTop > 0 ? scrTop : 0); } } } function csDropDownChangeSelection(option, noEvent) { if (!option) return; var objSelect = option.optionParent; if (!objSelect) return; var objSelected = getFirstChildElement(objSelect); if (!objSelected) return; var optionParent = option.optionParent; if (!optionParent) return; var optionPrev = objSelect.options[objSelect.selectedIndex]; if (optionPrev) { optionPrev.selected = false; optionPrev.style.background = ''; } // previous selected option.selected = true; option.style.background = '#eaf0fb'; // now selected // var temp = option.getAttribute('cstitle'); if (isNull(temp)) temp = option.innerHTML; //var temp = option.innerHTML; // temp = temp.split(''); //var temp2 = temp[1].split(''); // temp = temp[0] + temp2[1]; // objSelected.innerHTML = temp; // update selected option by .innerHTML //objSelected.innerHTML = option.innerHTML; // update selected option by .innerHTML // objSelect.previousIndex = objSelect.selectedIndex; // save previous selected index objSelect.previousValue = objSelect.selectedValue; // save previous selected value // objSelect.selectedIndex = option.index; // update option index number objSelect.selectedValue = option.value; // update option value (shortcut to current selected value) if (option.parentNode) option.parentNode.style.cursor = ''; // remove cursor style on options object if (noEvent != true && objSelect.onChange) { try{ objSelect.onChange(objSelect); } catch(err){ return true; }; }; // fire onChange event } function csDropDown_lockOptionObject( src ) { // lock option and add lock icon if (isNull(src) || src.clickable == false) return; src.clickable = false; src.style.color = "#ccc"; src.style.fontStyle = "italic"; src.innerHTML = src.getAttribute('dd_html') + ''; } function csDropDown_unlockOptionObject( src ) { // unlock option and remove lock icon if (isNull(src) || src.clickable == true) return; src.clickable = true; src.style.color = ""; src.style.fontStyle = ""; src.innerHTML = src.getAttribute('dd_html'); } function csDropDown_rewriteOptionObject( src, args ) { // rewrite (independantly) option.value, option.html or/and attribute of option if (isNull(args)) return false; if (isNull(src) || isNull(src.optionParent)) return false; var objSelect = src.optionParent; // parent object var value = (hasValue(args.value) ? args.value : null); var html = (hasValue(args.html) ? args.html : null); var attribute = (hasValue(args.attribute) ? args.attribute : null); if (value) { src.value = value; } // rewrite option value if (html) { src.innerHTML = html; } // rewrite option html if (attribute) {if (hasValue(attribute.name) && hasValue(attribute.value)) if (ie) src[attribute.name] = attribute.value; else src.setAttribute(attribute.name, attribute.value); } // rewrite option attribute if (src.index == objSelect.selectedIndex) { csDropDownChangeSelection( objSelect.options[objSelect.selectedIndex], true ); } // update if option currently selected } function csDropDown_getSelectedOptionByObjectOrId( src ) { if (src) { var obj = document.getElementById(src); if (!obj) obj = src; return (obj && obj.options && hasValue(obj.selectedIndex) ? obj.options[obj.selectedIndex] : null); } return null; } function csDropDown_getSelectedIndexByObjectOrId( src ) { if (src) { var obj = document.getElementById(src); if (!obj) obj = src; return (obj && hasValue(obj.selectedIndex) ? obj.selectedIndex : null); } return null; } function csDropDown_getSelectedValueByObjectOrId( src ) { if (src) { var obj = document.getElementById(src); if (!obj) obj = src; if (obj && obj.options && hasValue(obj.selectedIndex)) { var option = obj.options[obj.selectedIndex]; return (option && hasValue(option.value) ? option.value : null); } } return null; } function csDropDown_getPreviousIndexByObjectOrId( src ) { if (src) { var obj = document.getElementById(src); if (!obj) obj = src; return (obj && hasValue(obj.previousIndex) ? obj.previousIndex : null); } return null; } function csDropDown_getPreviousValueByObjectOrId( src ) { if (src) { var obj = document.getElementById(src); if (!obj) obj = src; if (obj && obj.options && hasValue(obj.previousIndex)) { var option = obj.options[obj.previousIndex]; return (option && hasValue(option.value) ? option.value : null); } } return null; } function csDropDown_setOptionByOptionValue( src, value ) { // set dropdown option by options' value if (!value) return null; if (src) { var obj = document.getElementById(src); if (!obj) obj = src; var optionsObj = obj.optionsObj; if (!optionsObj) return null; // get handle var optionsObjNodes = getChildElements(optionsObj); // get all options var optionCount = count(optionsObjNodes); // count them var option = null; for (var i = 0; i <= optionCount; i++) { option = obj.options[i]; if (option.value == value) { csDropDownChangeSelection(option, true); return true; } } } return null; } function showPopup( args ) { if (!args || !args.html) return; var popup = document.getElementById("page_popup"); if (!popup) return; var popup_content = document.getElementById("page_popup_content"); if (!popup_content) return; var padding = (args.noPadding == true ? '0px 0px 0px 0px' : '12px 20px 12px 15px'); // padding or not dimmerOn(22); popup.closeButton = true; popup.centerOn = (args.centerOn == 'content' ? 'content' : 'screen'); // save this choice if (args.warning == true) { var html = ''; html+= ''; html+= ''; html+= '
' + args.html + '
'; args.html = html; } if (args.confirm == true) { popup.confirmYes = args.confirmYes; popup.confirmYesArgs = args.confirmYesArgs; popup.confirmNo = args.confirmNo; popup.confirmNoArgs = args.confirmNoArgs; args.html+= '
AkkoordNiet akkoord
'; } if (args.ok == true) { popup.closeButton = false; args.html+= '
Verder gaan
'; } if (args.reloadPage == true) { popup.closeButton = false; popup.confirmYes = function() { self.location.replace( self.location.href ); }; args.html+= '
Verder gaan
'; } if (args.clickPopupClose == true) { popup.onclick = function(){ hidePopup(); }; popup.style.cursor = 'pointer'; } else { popup.onclick = null; popup.style.cursor = ''; } // whole popup as close button if (args.closeButton == false) popup.closeButton = false; // if given false, no close button in any case if (args.sound) execFlash['swf_exif'].send( { action: "exif_playSound", sound: args.sound } ); // play sound //popup.onLoadExec = (args.onLoad ? args.onLoad : null); popup.isActive = true; popup.style.display = "block"; // display popup.style.zIndex = setAndGetNextHighestDepth(); // update zIndex popup.style.left = "0px"; // off screen popup.style.top = "0px"; // off screen popup.style.width = ""; // clean width style popup.style.height = ""; // clean height style enablePopup(); // shrink disabler showPopupRecalculate(); popup_content.innerHTML = '
' +args.html+ '
'; popup_content.style.width = (args.width ? args.width : ""); // set or clean width style var popupcloseButton = document.getElementById("page_popup_close_button"); if (popupcloseButton) { popupcloseButton.style.display = (popup.closeButton == false ? 'none' : 'block'); if (args.onCloseClicked) popupcloseButton.onclick = args.onCloseClicked; // if close event set } showPopupRecalculate( { onLoadExec: args.onLoad } ); } function showPopup_confirm_yes() { dimmerOff(); // first this off .. var popup = document.getElementById("page_popup"); if (popup && popup.confirmYes) popup.confirmYes(popup.confirmYesArgs); hidePopup( { notDimmer: true } ); // .. then popup off } function showPopup_confirm_no() { dimmerOff(); // first this off .. var popup = document.getElementById("page_popup"); if (popup && popup.confirmNo) popup.confirmNo(popup.confirmNoArgs); hidePopup( { notDimmer: true } ); // .. then popup off } function showPopupRecalculate( args ) { var popup = document.getElementById("page_popup"); var browser = getBrowserDimensions(document); // get browser object var content = document.getElementById("content_column"); if (!popup || !browser || !content) return; if (popup.isActive === true) popup.style.left = (popup.centerOn == 'screen' ? Math.round(((browser.viewportWidth - popup.offsetWidth) / 2) + browser.scrollLeft) -20 : Math.round((content.offsetWidth - popup.offsetWidth) / 2) + getLeft(content)) + 'px'; if (popup.isActive === true) popup.style.top = Math.round(((browser.viewportHeight - popup.offsetHeight) / 2) + browser.scrollTop + 20) + 'px'; if (args && args.onLoadExec) args.onLoadExec(); } function hidePopup( args ) { var popup = document.getElementById("page_popup"); var popup_content = document.getElementById("page_popup_content"); if (!popup || !popup_content) return; if (popup.isActive == false) return; // already hidden popup_content.innerHTML = " "; // empty content popup.confirmYes = null; popup.confirmYesArgs = null; popup.confirmNo = null; popup.confirmNoArgs = null; popup.style.width = '1px'; // 1px popup.style.height = '1px'; // 1px popup.style.left = "-1000px"; // off screen popup.style.top = "-1000px"; // off screen popup.isActive = false; enablePopup(); // shrinks disabler popup.style.display = "none"; if (!args || args.notDimmer !== true) dimmerOff(); } function disablePopup() { var popup = document.getElementById("page_popup"); if (!popup) return; var popup_content = document.getElementById("page_popup_content"); if (!popup_content) return; var disabler = document.getElementById("page_popup_disabler"); if (!disabler) return; if (popup.isActive == false) return; // already hidden setOpacity(disabler, 1); // set opacity disabler.style.display = 'block'; // display disabler.style.width = popup_content.clientWidth + 'px'; disabler.style.height = (popup_content.clientHeight - 30) + 'px'; } function enablePopup() { var popup = document.getElementById("page_popup"); if (!popup) return; var disabler = document.getElementById("page_popup_disabler"); if (!disabler) return; if (popup.isActive == false) return; // already hidden disabler.style.width = '0px'; disabler.style.height = '0px'; disabler.style.display = 'none'; } function showPopup_warning( args ) { if (!args || !args.text) return; var html = (args.title ? '
' +args.title+ '
' : '') + '
' +args.text+ '
'; showPopup( { html: html, width: '450px', warning: true, ok: (args.confirm == true ? false : (hasValue(args.ok) ? args.ok : true)), closeButton: (hasValue(args.closeButton) ? args.closeButton : true), centerOn: 'screen', confirm: (args.confirm == true ? true : false), confirmYes: args.confirmYes, confirmYesArgs: args.confirmYesArgs, confirmNo: args.confirmNo, confirmNoArgs: args.confirmNoArgs } ); } // ------------------------------------------------------------------------------------------------------------------------- function dimmerOnAndShowHourglass() { showHourglass(); dimmerOn(22); } function dimmerOffAndHideHourglass() { hideHourglass(); dimmerOff(); } function hideHourglassAndWait(t) { setTimeoutLiteral((t ? t : 1000), dimmerOffAndHideHourglass); } function dimmerOn(x) { var dimmer = document.getElementById("page_dimmer"); if (!dimmer) return; dimmer.style.display = "block"; // show dimmer obj dimmer.style.zIndex = setAndGetNextHighestDepth(); // update zIndex setOpacity(dimmer, (x*1 > 1 ? x : 22)); // set opacity var browser = getBrowserDimensions(); // get browser object dimmer.style.width = (browser.documentWidth) + 'px'; dimmer.style.height = (browser.documentHeight) + 'px'; } function dimmerOff() { var dimmer = document.getElementById("page_dimmer"); if (!dimmer) return; dimmer.style.width = '1px'; dimmer.style.height = '1px'; dimmer.style.display = "none"; // hide dimmer obj } function showHourglass(x,y) { var hourglass = document.getElementById("page_hourglass"); if (!hourglass) return; var browser = getBrowserDimensions(document); // get browser object hourglass.style.display = "block"; hourglass.style.zIndex = setAndGetNextHighestDepth(); // update zIndex hourglass.style.left = (x > 0 ? (x + browser.scrollLeft) : Math.round(((browser.viewportWidth - hourglass.offsetWidth) / 2) + browser.scrollLeft)) + 'px'; hourglass.style.top = (y > 0 ? (y + browser.scrollTop) : Math.round(((browser.viewportHeight - hourglass.offsetHeight) / 2) + browser.scrollTop)) + 'px'; } function hideHourglass() { var hourglass = document.getElementById("page_hourglass"); if (!hourglass) return; hourglass.style.left = '0px'; hourglass.style.top = '0px'; hourglass.style.display = "none"; } var allscriptsLoaded = function() { preInit2 = true; pre_init1(); }();