// JavaScript Document function uitloggen() { url = 'customer.asp?action=logout' fdoAjaxText(url, 'end_uitloggen'); } function end_uitloggen() { document.location.href=document.location.href } function header_aanmelden() { $('headerlogin_div').hide(); var login, pass login = $F('hl_login'); pass = $F('hl_password'); if ((login =='') || (pass=='')) { ShowLightBox('headerlogin_div',''); // $('headerlogin_div').show(); $('headerlogin_error').innerHTML = 'I enter my user name and password below.' } else { var url= 'customer.asp?action=login&taal=en&gebruikersnaam=' + escape(login) + '&wachtwoord=' + escape(pass); fdoAjaxText(url,'header_endAanmelden') } } function header_endAanmelden() { var resp=responseText; if (resp=='OK') { // LightBox('headerlogin_div',''); // $('headerlogin_div').hide(); //document.location.href='bestel.asp?from=' document.location.href=document.location.href }else{ ShowLightBox('headerlogin_div',''); // $('headerlogin_div').show(); $('headerlogin_error').innerHTML = 'We could not log you on with the user name and password you supplied. Please try again. ' } } function aanmelden() { $('login_info').hide(); var login, pass login = $F('gebruikersnaam'); pass = $F('wachtwoord'); if ((login =='') || (pass=='')) { $('login_error').show(); $('login_error').innerHTML = 'I enter my user name and password below.' } else { var url= 'customer.asp?action=login&taal=en&gebruikersnaam=' + escape(login) + '&wachtwoord=' + escape(pass); fdoAjaxText(url,'endAanmelden') } } function endAanmelden() { var resp=responseText; if (resp=='OK') { $('login_error').hide(); document.location.href='bestel.asp?from=' }else{ $('login_error').show(); $('login_error').innerHTML = 'We could not log you on with the user name and password you supplied. Please try again. ' } } function lostPassword(bpopup) { pre = '' if (bpopup) { pre = 'ww_' } var email email = $F(pre + 'emailadres'); if (email =='') { $(pre + 'login_error').show(); $(pre + 'login_error').innerHTML = 'Please fill out your e-mail address.' } else if (! checkmail(email) ) { $(pre + 'login_error').show(); $(pre + 'login_error').innerHTML = 'Please enter a valid e-mail address' } else { var url= 'customer.asp?action=lostpassword&taal=en&email=' + escape(email) + '&popup=' + bpopup; fdoAjaxText(url,'endLostPassword') } } function endLostPassword() { var resp=responseText; var aresp = new Array(); aresp=resp.split("|||"); pre = '' if (aresp[1] == "true") pre = 'ww_' if (aresp[0]=='OK') { if (aresp[1]) { $('ww_mailed').show(); $('ww_content').hide(); $('ww_mailed_text').innerHTML = 'Your account information was sent to the e-mail address'; } else{ $('login_info').show(); $('login_info').innerHTML= 'Your account information was sent to the e-mail address'; } $(pre + 'login_error').hide(); $(pre + 'emailadres').value = ''; } else if (aresp[0] =='NOTFOUND'){ $(pre + 'login_error').show(); $(pre + 'login_error').innerHTML = 'No customer was found with the e-mail address you entered. Please try again. ' }else{ $(pre + 'login_error').show(); $(pre + 'login_error').innerHTML = 'The e-mail message could not be sent. Please try again.' } } function saveklant() { var voornaam = $F('wk_voornaam'); var naam = $F('wk_naam'); var adres = $F('wk_adres'); var postcode = $F('wk_postcode'); var woonplaats = $F('wk_woonplaats'); var land = $F('wk_land'); var telthuis = $F('wk_telthuis'); var telwerk = $F('wk_telwerk'); var gsm = $F('wk_gsm'); var fax = $F('wk_fax'); var firma = $F('wk_firma'); var btwland = $F('wk_btwland'); var btw = $F('wk_btw'); var gebruikersnaam = $F('wk_gebruikersnaam'); var wachtwoord = $F('wk_wachtwoord'); var email = $F('wk_email'); var refresh= $F('wk_refresh'); var err = ''; if ( (voornaam =='') || (naam == '') || (adres=='') || (postcode=='') || (woonplaats=='') || (land=='') || (email=='') || (telthuis=='') || (gebruikersnaam == '') || (wachtwoord == '') ) { $('wk_error').show(); $('wk_error').innerHTML = 'All fields marked with * are required.' } else if (! checkmail(email) ) { $('wk_error').show(); $('wk_error').innerHTML = 'Please enter a valid e-mail address' } else { var url= 'customer.asp?action=save&refresh=' + refresh + '&taal=en&email=' + escape(email) + '&voornaam=' + escape(voornaam) + '&naam=' + escape(naam) + '&adres=' + escape(adres) + '&postcode=' + escape(postcode) + '&woonplaats=' + escape(woonplaats) + '&land=' + escape(land) + '&telthuis=' + escape(telthuis) + '&telwerk=' + escape(telwerk) + '&gsm=' + escape(gsm) + '&fax=' + escape(fax) + '&firma=' + escape(firma) + '&btwland=' + escape(btwland) + '&btw=' + escape(btw) + '&gebruikersnaam=' + escape(gebruikersnaam) + '&wachtwoord=' + escape(wachtwoord) + '&id='; fdoAjaxPostText(url,'endSaveKlant') } } function changecountry_saveklant(obj) { if ($(obj).options[$(obj).selectedIndex].getAttribute('nodelivery')=='1') { $('wk_error').show() $('wk_error').innerHTML = 'Please note: Delivery is not possible in this country. You can choose to have the items delivered to another address.' }else{ $('wk_error').hide() } } function endSaveKlant() { var resp=responseText; if (resp=='OK') { $('wk_error').hide(); $('wk_content').hide(); $('wk_saved').show(); $('wk_savedtext').innerHTML = 'Thank you for registering.' } else if (resp=='OKREFRESH'){ CloseLightBox('wijzigklant'); document.location.href='bestel.asp?doorgaan=true&from=' }else{ $('wk_error').show(); if (resp=='USEREXISTS') { $('wk_error').innerHTML = 'This user already exists. Please choose another username.' }else if (resp=='EMAILEXISTS') { $('wk_error').innerHTML = 'There is already a user with this e-mail address. If you have forgotten your password, \\\'click here\\\' to recover it.' }else if (resp=='VERPLICHTEVELDEN'){ $('wk_error').innerHTML = 'All fields marked with * are required.' }else if (resp=='SESSIONTIMEOUT'){ $('wk_error').innerHTML = 'Your session has expired. Please login again.' }else{ $('wk_error').innerHTML = 'An unknown error occurred. Please try again.' } } } function ToonKlant(bexists,brefresh) { var url= 'customer.asp?action=savescreenshown&taal=en'; fdoAjaxText(url,'endToonKlant') if (bexists) { $('wk_intro1').hide(); $('wk_intro2').show(); } else { $('wk_intro2').hide(); $('wk_intro1').show(); } if (brefresh) { $('wk_refresh').value=1; }else{ $('wk_refresh').value=0; } $('wk_error').hide(); $('wk_content').show(); $('wk_saved').hide(); ShowLightBox('wijzigklant',''); } function endToonKlant() { } function ToonWWVergeten() { $('ww_mailed').hide(); $('ww_content').show(); $('ww_login_error').hide(); ShowLightBox('wwvergeten',''); } function ToonWWVergeten2() { CloseLightBox('wijzigklant'); ToonWWVergeten(); } function levering_doorgaan(frm) { var leverplaats = document.getElementById('lev_levering_o'); var betaling = document.getElementById('lev_betaling_o'); var opmerking = document.getElementById('lev_opmerking'); var verzekering = document.getElementById('lev_verzekering_o'); var adres2_naam, adres2_tel, adres2_plaats, adres2_postcode, adres2_adres, adres2_land; var error=''; var tmp = true; if (leverplaats.value == 'otheraddress') { adres2_naam = document.getElementById('adres2_naam_o').value; adres2_tel = document.getElementById('adres2_tel_o').value; adres2_plaats = document.getElementById('adres2_plaats_o').value; adres2_postcode = document.getElementById('adres2_postcode_o').value; adres2_adres = document.getElementById('adres2_adres_o').value; adres2_land = document.getElementById('adres2_land_o').value; if ((adres2_naam=='') || (adres2_tel=='') || (adres2_plaats=='') || (adres2_postcode=='') || (adres2_adres=='') || (adres2_land=='')) { error += '
- Please fill out all the address fields.'; tmp = false; } } if (leverplaats.value == '') { error += '
- Please indicate your delivery address.'; tmp = false; } if (betaling.value == ''){ error += '
- Please indicate your preferred payment method'; tmp = false; } if (verzekering.value == '') { error += '
- Please indicate your preferred insurance method'; tmp = false; } if (error != '') { $('lev_error').innerHTML = 'Your form could not be submitted:' + error ; $('lev_error').show(); tmp = false; } else { $('lev_error').hide(); } //return tmp; // (PB) check eerst of er geschenkverpakking is besteld, door te kijken of het element "hdn_ordernrstring" if (document.getElementById('hdn_ordernrstring') == null) { return tmp; } //voor de verschillende verpakkingen zelfde checken var orderlineids = document.getElementById('hdn_ordernrstring').value; var ids = new Array(); ids=orderlineids.split(","); for(var i=0; i < ids.length; i++) { var leverplaats = (document.getElementById(ids[i] + '_lev_levering').value); var verzekering = (document.getElementById(ids[i] + '_lev_verzekering').value); var adres2_naam, adres2_tel, adres2_plaats, adres2_postcode, adres2_adres, adres2_land var error=''; if (leverplaats == 'otheraddress') { adres2_naam = (document.getElementById(ids[i] + '_adres2_naam').value); adres2_tel = (document.getElementById(ids[i] + '_adres2_tel').value); adres2_plaats = (document.getElementById(ids[i] + '_adres2_plaats').value); adres2_postcode = (document.getElementById(ids[i] + '_adres2_postcode').value); adres2_adres = (document.getElementById(ids[i] + '_adres2_adres').value); adres2_land = (document.getElementById(ids[i] + '_adres2_land').value); if ((adres2_naam=='') || (adres2_tel=='') || (adres2_plaats=='') || (adres2_postcode=='') || (adres2_adres=='') || (adres2_land=='')) { error += '
- Please fill out all the address fields.' tmp = false; } } if (leverplaats == '') { error += '
- Please indicate your delivery address.' tmp = false; } if (verzekering == '') { error += '
- Please indicate your preferred insurance method' tmp = false; } if (error != '') { $(ids[i] + '_lev_error').innerHTML = 'Your form could not be submitted:' + error ; $(ids[i] + '_lev_error').show(); tmp = false; } else { $(ids[i] + '_lev_error').hide(); } } return tmp; } function saveproefnotitie() { var proefnotitie = $('pn_proefnotitie').value; var wineinfoid = $('pn_wineinfoid').value; var naam= $('pn_naam').value; var email= $('pn_email').value; var star = $('pn_star').value; if ((proefnotitie == '') || (naam == '') || (email == '')) { $('pn_error').show(); $('pn_error').innerHTML = 'Please fill out all the fields.' } else if(star==0){ $('pn_error').show(); $('pn_error').innerHTML = 'Please indicate a score.' }else{ var url= 'proefnotities.asp?action=add&taal=en&star=' + escape(star) + '&proefnotitie=' + escape(proefnotitie) + '&wineinfoid=' + escape(wineinfoid) + '&naam=' + escape(naam) + '&email=' + escape(email); fdoAjaxPostText(url,'endsaveproefnotitie') } } function showImage(img,titel) { $('imgtitle').innerHTML = titel; ShowLightBox('imglightbox',''); $('imgwijn').src = img; $('imgwijn').className = "resize_vertical" } var setstar=false; var star1; var star2; var currentstar = 0; var maxstars = 5; function losehighlight(x) { for (i=maxstars;i>currentstar;i--) { document.getElementById('star_' + i).src=star1.src; } for (i=currentstar;i>0;i--) { document.getElementById('star_' + i).src=star2.src; } } function highlight(x) { for (i=1;i<=x;i++) { document.getElementById('star_' + i).src= star2.src; } for (i=(x*1+1);i<=maxstars;i++) { document.getElementById('star_' + i).src= star1.src; } } function setStar(x) { currentstar = x $('pn_star').value = x; } function loadStars() { star1 = new Image(); star1.src = "/images/star1.gif"; star2 = new Image(); star2.src= "/images/star2.gif"; } function toonproefnotitie() { setStar(0) loadStars() ShowLightBox('addproefnotitie','') } function endsaveproefnotitie() { var resp = responseText; if(resp == "OK") { $('pn_content').hide(); $('pn_saved').show(); }else if (resp=="MISSINGFIELDS") { $('pn_error').show(); $('pn_error').innerHTML = 'Please fill out all the fields.' } } function toonproefnotities(pntaal, wineinfoid) { $('tasting_notes_loading').show(); $('tasting_notes_detail').hide(); var url = 'proefnotities.asp?action=toon&taal=en&pntaal=' + pntaal + '&wineinfoid=' + wineinfoid fdoAjaxText(url,endtoonproefnotities) } function endtoonproefnotities() { var resp = responseText; $('tasting_notes_detail').innerHTML = resp; $('tasting_notes_loading').hide(); $('tasting_notes_detail').show(); } function toonalgvwd() { $('vw_loading').show(); $('vw_content').hide(); ShowLightBox('divalgvwd',''); var url= 'orders.asp?action=toonalgvwd&taal=en'; fdoAjaxText(url,endtoonalgvwd) } function endtoonalgvwd() { var resp = responseText; $('vw_loading').hide(); $('vw_detail').innerHTML = resp; $('vw_content').show(); } var bcartchanged=false; function toonCart() { $('cart_error2').hide(); $('cart_info2').hide(); $('cart_content').hide(); $('cart_loading').show(); ShowLightBox('wijzigcart',''); var url='cart.asp?action=items&taal=en'; fdoAjaxText(url,endtoonCart) } function endtoonCart() { var resp = responseText; $('cart_loading').hide(); $('cart_detail').innerHTML = resp; $('cart_content').show(); } function hideCart() { if (bcartchanged) { document.location.href=document.location.href }else{ CloseLightBox('wijzigcart'); } } function deleteCart2(id) { if (confirm('Are you shure you want to remove this item from your shopping cart?')) { bcartchanged=true; $('cart_error2').hide(); $('cart_info2').hide(); var url= 'cart.asp?action=delorderline&taal=en&curr=EUR&id=' + escape(id) ; fdoAjaxText(url,'endDeleteCart2') } } function deleteCart2WineInVerp(id, aantal) { if (confirm('Are you shure you want to remove this item from your shopping cart?')) { bcartchanged=true; $('cart_error2').hide(); $('cart_info2').hide(); var url= 'cart.asp?action=delorderlinewineinverp&taal=en&curr=EUR&id=' + escape(id) + '&aantal=' + escape(aantal) ; fdoAjaxText(url,'endDeleteCart2') } } function deleteCartVerp2(id) { if (confirm('')) { bcartchanged=true; $('cart_error2').hide(); $('cart_info2').hide(); var url= 'cart.asp?action=delorderlineverp&taal=en&curr=EUR&id=' + escape(id) ; fdoAjaxText(url,'endDeleteCart2') } } function endDeleteCart2() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { $('cart_subtotaal').innerHTML = aresp[2]; $('cart_'+ aresp[1] ).hide(); $('cart_info2').show(); $('cart_info2').innerHTML = 'The item was removed from your shopping basket.' } } function updateOrderLine(id) { $('cart_info2').hide(); $('cart_error2').hide(); aantal = parseInt($('cart_aantal_' + id).value); if (aantal <= 0 || isNaN(aantal)) { $('cart_error2').innerHTML = 'You filled in an invalid quantity' $('cart_error2').show(); }else{ var url = 'cart.asp?action=updateorderline&taal=en&curr=EUR&id=' + escape(id) + '&aantal=' + escape(aantal) fdoAjaxText(url,'endUpdateOrderLine') } } function endUpdateOrderLine() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { bcartchanged=true; $('cart_subtotaal').innerHTML = aresp[2]; $('cart_prijs_' + aresp[1]).innerHTML = aresp[4]; $('cart_unitprijs_' + aresp[1]).innerHTML = aresp[3]; $('cart_info2').show(); $('cart_info2').innerHTML = 'The item was saved.' }else if (aresp[0] == "TEWEINIG"){ if (aresp[4]==1) $('cart_error2').innerHTML = 'You cannot order ' + aresp[3] + ' units from this item, because there is only 1 available.' else $('cart_error2').innerHTML = 'You cannot order ' + aresp[3] + ' units from this item, because there are only ' + aresp[4] + ' available.' $('cart_error2').show(); $('cart_aantal_' + aresp[1]).value = aresp[2]; }else if (aresp[0] == "TEWEINIGVERP"){ if (aresp[4] == 1) $('cart_error2').innerHTML = '' + aresp[4] + '' else $('cart_error2').innerHTML = 'There are still ' + aresp[4] + '' $('cart_error2').show(); $('cart_aantal_' + aresp[1]).value = aresp[2]; } else{ $('cart_error2').innerHTML = 'An unknown error occurred. Please try again.' $('cart_error2').show(); } } function IsNumeric(sText) { var ValidChars = "0123456789."; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } function addCart(wijnid) { var aantal= $F('aantal_' + wijnid); var aantalbeschikbaar = $F('aantalbeschikbaar_' + wijnid); $('cart_info').hide(); if ((aantal=='') || (!IsNumeric(aantal)) || (aantal <= 0)) { $('cart_error').show(); scroll(0,0) $('cart_error').innerHTML = 'You filled in an invalid quantity' }else if(parseInt(aantal) > parseInt(aantalbeschikbaar)) { $('cart_error').show(); scroll(0,0); if (aantalbeschikbaar==0) { $('cart_error').innerHTML = 'This item is no longer available.' } else if(aantalbeschikbaar==1) { $('cart_error').innerHTML = 'There is only 1 unit available of this item.' }else{ $('cart_error').innerHTML = 'There are only ' + aantalbeschikbaar + ' units available of this article' } }else{ //movecart(wijnid) 'disabled IE problems // add to cart var url= 'cart.asp?action=add&taal=en&curr=EUR&wijnid=' + escape(wijnid) + '&aantal=' + escape(aantal) ; fdoAjaxText(url,'endAddCart') $('aantal_' + wijnid).value=''; $('aantalbeschikbaar_' + wijnid).value = aantalbeschikbaar - aantal; } } function addCartVerpakking(verpakkingid) { var aantal= $F('aantal_' + verpakkingid); var aantalbeschikbaar = $F('aantalbeschikbaar_' + verpakkingid); $('cart_info').hide(); if ((aantal=='') || (!IsNumeric(aantal)) || (aantal <= 0)) { $('cart_error').show(); scroll(0,0) $('cart_error').innerHTML = 'You filled in an invalid quantity' }else if(parseInt(aantal) > parseInt(aantalbeschikbaar)) { $('cart_error').show(); scroll(0,0); if (aantalbeschikbaar==0) { $('cart_error').innerHTML = 'This item is no longer available.' } else if(aantalbeschikbaar==1) { $('cart_error').innerHTML = 'There is only 1 unit available of this item.' }else{ $('cart_error').innerHTML = 'There are only ' + aantalbeschikbaar + ' units available of this article' } }else{ //movecart(verpakkingid) 'disabled IE problems // add to cart var url= 'cart.asp?action=add&taal=en&curr=EUR&wijnid=&verpakkingid=' + escape(verpakkingid) + '&aantal=' + escape(aantal) ; fdoAjaxText(url,'endAddCartVerpakking') $('aantal_' + verpakkingid).value=''; $('aantalbeschikbaar_' + verpakkingid).value = aantalbeschikbaar - aantal; } } function endAddCart() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { pasbeschikbaaraan(aresp[1],aresp[2]); $('container_cart').innerHTML = aresp[3]; $('cart_error').hide(); $('cart_info').show(); $('cart_info').innerHTML = 'The article was added to your shopping basket.' }else if (aresp[0]=="TEWEINIG") { $('cart_error').show(); scroll(0,0) pasbeschikbaaraan(aresp[1], aresp[2]); $('cart_error').innerHTML = 'There are not enough units available anymore. Please try again.' } } function endAddCartVerpakking() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { pasbeschikbaarverpakkingaan(aresp[1],aresp[2]); $('container_cart').innerHTML = aresp[3]; $('cart_error').hide(); $('cart_info').show(); $('cart_info').innerHTML = 'The gift box has been added to your shopping basket. Click here to fill the gift box with wine from your shopping basket.' }else if (aresp[0]=="TEWEINIG") { $('cart_error').show(); scroll(0,0) pasbeschikbaarverpakkingaan(aresp[1], aresp[2]); $('cart_error').innerHTML = 'There are not enough units available anymore. Please try again.' } } function plaatswijninverpakking(wijnid, verpakkingid) { var url= 'verpakking.asp?action=vul&taal=en&curr=EUR&wijnid=' + escape(wijnid) + '&verpakkingid=' + escape(verpakkingid); fdoAjaxText(url,'endplaatswijninverpakking') } function endplaatswijninverpakking() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { $('gift_wine_div').innerHTML = aresp[1]; $('gift_packaging_div').innerHTML = aresp[2]; $('container_cart').innerHTML = aresp[3]; var $j = jQuery.noConflict(); $j( init ); } } function deleteWineFromVerp(wijnid, verpakkingid) { var url = 'verpakking.asp?action=eruit&taal=en&curr=EUR&wijnid=' + escape(wijnid) + '&verpakkingid=' + escape(verpakkingid); fdoAjaxText(url,'endDeleteWineFromVerp') } function endDeleteWineFromVerp() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { $('gift_wine_div').innerHTML = aresp[1]; $('gift_packaging_div').innerHTML = aresp[2]; $('container_cart').innerHTML = aresp[3]; var $j = jQuery.noConflict(); $j( init ); } } function deleteVerpakking(verpakkingid) { if (confirm('')) { var url = 'verpakking.asp?action=del&taal=en&curr=EUR&verpakkingid=' + escape(verpakkingid); fdoAjaxText(url,'endDeleteVerpakking') } } function endDeleteVerpakking() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { $('gift_wine_div').innerHTML = aresp[1]; $('gift_packaging_div').innerHTML = aresp[2]; $('container_cart').innerHTML = aresp[3]; var $j = jQuery.noConflict(); $j( init ); } } function deleteCart(wijnid) { if (confirm('Are you shure you want to remove this item from your shopping cart?')) { if ($('cart_info')) $('cart_info').hide(); var url= 'cart.asp?action=del&taal=en&curr=EUR&wijnid=' + escape(wijnid) ; fdoAjaxText(url,'endDeleteCart') } } function deleteCartVerpakking(orderlineid) { if (confirm('Are you shure you want to remove this item from your shopping cart?')) { if ($('cart_info')) $('cart_info').hide(); var url= 'cart.asp?action=delverp&taal=en&curr=EUR&orderlineid=' + escape(orderlineid) ; fdoAjaxText(url,'endDeleteCartVerpakking') } } function endDeleteCart() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { pasbeschikbaaraan(aresp[1],aresp[2]); $('container_cart').innerHTML = aresp[3]; if ($('cart_error')) $('cart_error').hide(); if ($('cart_info')) { $('cart_info').show(); $('cart_info').innerHTML = 'The wine was removed from your shopping basket.' } } } function endDeleteCartVerpakking() { var resp = responseText; var aresp = new Array(); aresp=resp.split("|||"); if(aresp[0] == "OK") { pasbeschikbaarverpakkingaan(aresp[1],aresp[2]); $('container_cart').innerHTML = aresp[3]; if ($('cart_error')) $('cart_error').hide(); if ($('cart_info')) { $('cart_info').show(); $('cart_info').innerHTML = 'The gift box has been removed from your shopping basket.' } } } function pasbeschikbaaraan(wijnid, aantal) { if ($('aantalbeschikbaar_' + wijnid) ) { $('aantalbeschikbaar_' + wijnid).value = aantal; if (aantal == 0) { if ($('aantalbeschikbaartekst_' + wijnid)) $('aantalbeschikbaartekst_' + wijnid).innerHTML = '0 units' $('bestelrow_' + wijnid).hide(); }else if (aantal==1) { if ($('aantalbeschikbaartekst_' + wijnid) ) $('aantalbeschikbaartekst_' + wijnid).innerHTML = '1 unit' $('bestelrow_' + wijnid).show() }else{ if ($('aantalbeschikbaartekst_' + wijnid)) $('aantalbeschikbaartekst_' + wijnid).innerHTML = aantal + ' units' $('bestelrow_' + wijnid).show() } } } function pasbeschikbaarverpakkingaan(verpakkingid, aantal) { if ($('aantalbeschikbaar_' + verpakkingid) ) { $('aantalbeschikbaar_' + verpakkingid).value = aantal; if (aantal == 0) { if ($('aantalbeschikbaartekst_' + verpakkingid)) $('aantalbeschikbaartekst_' + verpakkingid).innerHTML = '0 units' $('bestelrow_' + verpakkingid).hide(); }else if (aantal==1) { if ($('aantalbeschikbaartekst_' + verpakkingid) ) $('aantalbeschikbaartekst_' + verpakkingid).innerHTML = '1 unit' $('bestelrow_' + verpakkingid).show() }else{ if ($('aantalbeschikbaartekst_' + verpakkingid)) $('aantalbeschikbaartekst_' + verpakkingid).innerHTML = aantal + ' units' $('bestelrow_' + verpakkingid).show() } } } /* HOMEPAGE - SCROLL BLOCK FUNCTIONS */ var tblock = new Array; var adisable = new Array; function volgendeblock(blocktype, autoreload) { if (adisable[blocktype] !=true) { adisable[blocktype] = true; $('wijn_block2_' + blocktype).hide(); $('wijn_block1_' + blocktype).show(); if ($('blockid_' + blocktype)) { blockid = $('blockid_' + blocktype).value; }else{ blockid=0; } var url= 'wine.asp?action=shownextblock&blocktype=' + blocktype + "&blockid=" + blockid + "&taal=en" fdoAjaxText(url,'endvolgendeblock') if (! autoreload) { clearInterval(tblock[blocktype]) } } } function vorigeblock(blocktype) { if (adisable[blocktype] !=true) { adisable[blocktype] = true; $('wijn_block2_' + blocktype).hide(); $('wijn_block1_' + blocktype).show(); if ($('blockid_' + blocktype)) { blockid = $('blockid_' + blocktype).value; }else{ blockid=0; } var url= 'wine.asp?action=showprevblock&blocktype=' + blocktype + "&blockid=" + blockid + "&taal=en" fdoAjaxText(url,'endvolgendeblock') } } function endvolgendeblock() { //window.clearTimeout(t); var resp = responseText; aresp=resp.split("|||"); if(aresp[0] == "OK") { wb2 = 'wijn_block2_' + aresp[1] wb = 'wijn_block1_' + aresp[1] // zet nieuwe content in 2 $(wb2).innerHTML = aresp[2]; new Effect.Parallel([ new Effect.Appear(wb2,{sync:true, duration: 1}), new Effect.Fade(wb,{sync:true, duration: 1}) ],{afterFinish:function(){ // wissel content $(wb).innerHTML = $(wb2).innerHTML; $(wb).show(); $(wb2).innerHTML = ''; $(wb2).hide(); adisable[aresp[1]] = false; } }); }else{ adisable[aresp[1]] = false; } } /* email alerts */ function addEmailAlert() { $('ea_content').show(); $('ea_saved').hide(); $('ea_error').hide(); //$('ea_jaar').value=''; //$('ea_trefwoord').value=''; //$('ea_wijntype').selectedIndex=0; ShowLightBox('addemailalert',''); } function saveEmailAlert() { var email, jaar, trefwoord, wijntype email = $('ea_email').value; jaar = $('ea_jaar').value; trefwoord = $('ea_trefwoord').value; wijntype = $F('ea_wijntype'); var err=''; if (email == '') { err += '
- You did not enter an e-mail address.' } else if (! checkmail(email)){ err += '
- You entered an incorrect e-mail address.' } if ( (jaar == '') && (trefwoord== '') && (wijntype == '') ) { err += '
- Please enter at least one of 3 search criteria.' } if (err == '') { var url= 'emailalert.asp?action=add&taal=en&email=' + escape(email) + '&jaar=' + escape(jaar) + '&trefwoord=' + escape(trefwoord) + '&wijntype=' + escape(wijntype); fdoAjaxPostText(url,'endSaveEmailAlert') }else{ $('ea_error').show(); $('ea_error').innerHTML = 'Some information was not filled in correctly. Please correct any errors and try again:' + err; } } function endSaveEmailAlert() { var resp = responseText; if(resp == "OK") { $('ea_content').hide(); $('ea_saved').show(); }else { $('ea_error').show(); $('ea_error').innerHTML = 'An error has occurred. Please try again.' } }