/************************* * - www.sinoxi.nl * ************************* Dit document bevat JavaScript codering. */ // jQuery document ready $(document).ready(function() { $('#navigation li').each(function() { $(this).attr('rel', $(this).attr('title')).attr('title', $(this).children('a').html()); }); $('#subnavigation ul').hide(); if($('#navigation ul li.selected').is(':visible')) { $('#sub' + $('#navigation ul li.selected').attr('rel') + '').show(); } /* $('#navigation li').click(function() { $('#navigation ul li').removeClass('selected'); $(this).addClass('selected'); $('#subnavigation ul').hide(); $('#sub' + $(this).attr('rel') + '').show(); }); $('.example').example(function() { return $(this).attr('title'); }); */ }); function dump(arr,level) { var dumped_text = ""; if(!level) level = 0; //The padding given at the beginning of the line. var level_padding = ""; for(var j=0;j \"" + value + "\"\n"; } } } else { //Stings/Chars/Numbers etc. dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; } return dumped_text; } function winkelmandjeBijwerken() { /* var artikel = new Array(); var aantal = new Array(); data = $('#bewerk_mandje').serializeArray(); data = data.reverse(); //alert(dump(data)); var max = (data[2]['value']) data = data.reverse(); for (i=0;i<=max;i++) { aantal[i] = $("input[name='product["+i+"][aantal]']").val(); artikel[i] = $("input[name='product["+i+"][artikel]']").val(); rand = Math.floor(Math.random()*1111); $.get("http://www.everstelecom.nl/modules/producten/requests/check_product_availability.php?id="+rand, { id: artikel[i], aantal: aantal[i] }, function(data) { if (data != '') { Shadowbox.open({ content: data, player: "html", height: 305, width: 633 }); } else { $.get("http://www.everstelecom.nl/modules/producten/requests/voeg_product_winkelmandje.php?cache="+rand, { id: artikel[i], aantal: aantal[i] }, function(data){ $("#response").fadeOut('slow',function() { $("#response").html(data); $("#response").fadeIn('slow'); }); $.get("http://www.everstelecom.nl/modules/producten/requests/get_cart_contents.php?id="+rand, function(data){ $("#cart_mini").html(data); $("#cart_mini").animate({backgroundColor: "#ffc4c4"}, "slow", function() { $("#cart_mini").animate({backgroundColor: "#eeeeee"}, "slow"); }); $("#basket_aantal").val("1"); }); }); } }); } */ document.bewerk_mandje.submit(); } function voegProductToe() { id = $("input[name='basket_artikel']").val(); aantal = $("input[name='basket_aantal']").val(); rand = Math.floor(Math.random()*1111); /* $.get("http://www.everstelecom/modules/producten/requests/check_product_availability.php?id="+rand, { id: id, aantal: aantal }, function(data) { if (data != '') { Shadowbox.open({ content: data, player: "html", height: 305, width: 633 }); } else { */ $.get("http://www.everstelecom.nl/modules/producten/requests/voeg_product_winkelmandje.php?cache="+rand, { id: id, aantal: aantal }, function(data){ $("#response").fadeOut('slow',function() { $("#response").html(data); $("#response").fadeIn('slow'); }); $.get("http://www.everstelecom.nl/modules/producten/requests/get_cart_contents.php?id="+rand, function(data){ $("#cart_mini").html(data); $("#cart_mini").animate({backgroundColor: "#ffc4c4"}, "slow", function() { $("#cart_mini").animate({backgroundColor: "#eeeeee"}, "slow"); }); $("#basket_aantal").val("1"); }); }); /* } }); */ } function voegProductToeVanBackorder(id,aantal,waarschuwing,melding) { rand = Math.floor(Math.random()*1111); van = 'backorder'; $.get("http://www.everstelecom.nl/modules/producten/requests/voeg_product_winkelmandje.php?randomnumber="+rand, { id: id, aantal: aantal, van: van }, function(data){ $("#response").fadeOut('slow',function() { $("#response").html(data); $("#response").fadeIn('slow'); }); $.get("http://www.everstelecom.nl/modules/producten/requests/get_cart_contents.php?id="+rand, function(data){ $("#cart_mini").html(data); $("#cart_mini").animate({backgroundColor: "#ffc4c4"}, "slow", function() { $("#cart_mini").animate({backgroundColor: "#eeeeee"}, "slow"); location.reload(); }); }); }); } function verwijderBackorder(id) { rand = Math.floor(Math.random()*1111); $.get("http://www.everstelecom.nl/modules/producten/requests/backorder_verwijder.php?rand="+rand, { id: id }, function(data){ location.reload(); }); } function voegProductToeLijst(id) { id = $("input[name='basket_artikel_"+id+"']").val(); aantal = $("input[name='basket_aantal_"+id+"']").val(); rand = Math.floor(Math.random()*1111); /* $.get("http://www.everstelecom.nl/modules/producten/requests/check_product_availability.php?id="+rand, { id: id, aantal: aantal }, function(data) { if (data != '') { Shadowbox.open({ content: data, player: "html", height: 305, width: 633 }); } else { */ $.get("http://www.everstelecom.nl/modules/producten/requests/voeg_product_winkelmandje.php?id="+rand, { id: id, aantal: aantal }, function(data){ $("#response_"+id).fadeOut('slow',function() { $("#response_"+id).html(data); $("#response_"+id).fadeIn('slow'); }); $.get("http://www.everstelecom.nl/modules/producten/requests/get_cart_contents.php?id="+rand, function(data){ $("#cart_mini").html(data); $("#cart_mini").animate({backgroundColor: "#ffc4c4"}, "slow", function() { $("#cart_mini").animate({backgroundColor: "#eeeeee"}, "slow"); }); $("input[name='basket_aantal_"+id+"']").val("1"); }); }); /* } }); */ } function checkoutStep(step) { $('.stap').hide(); $('h1.selected').addClass('inactive'); $('h1.selected').removeClass('selected'); $('#stap_'+step).show(); $('#stap_'+step).prev('h1').removeClass('active').addClass('selected'); } function showHoofdAfbeelding(url) { $("#hoofdAfbeeldingCntr").html(""); } function registerCopyBillingAdres() { $("input[name='ship_bedrijfsnaam']").val($("input[name='bill_bedrijfsnaam']").val()); $("input[name='ship_contactpersoon']").val($("input[name='voornaam']").val() + " " + $("input[name='achternaam']").val()); $("input[name='ship_adres']").val($("input[name='bill_adres']").val()); $("input[name='ship_postcode']").val($("input[name='bill_postcode']").val()); $("input[name='ship_plaats']").val($("input[name='bill_plaats']").val()); $("select[name='ship_land']").val($("select[name='bill_land']").selectedValues()); } function filter(type,value) { set = 0; sub_set = 0; stop = 0; url = location.href; querystring = url.split("?"); if (querystring[1] !==undefined) { sub_set = 1; qs = querystring[1].split("&"); for ( var i in qs ) { if (i != 'indexOf') { var querys = qs[i].split("="); if (querys[0] == type || querys[0] == 'pagina') { if (value == '') { set = 1; delete qs[i]; } else { if (querys[0] == 'pagina') { url = url.replace('&pagina='+querys[1],""); delete qs[i]; } else { set = 1; qs[i] = querys[0] + "=" + value; } } } } } } if (set == 0) { if (value == '') { stop = 1; } else { if (sub_set == 0) { splitter = '?filter&'; } else { splitter = '&'; } url = url + splitter + type + "=" + value; } } else { query = qs.join("&"); url = querystring[0] + "?" + query; } url = url.replace("&&","&"); lengte = url.length; if (url.substring((lengte-1),(lengte)) == "&") { url = url.substring(0,(lengte-1)); } if (url.substring((lengte-8),(lengte)) == "?filter") { url = url.substring(0,(lengte-8)); } if (stop != 1) { window.location=url; } } function adresChange(id) { rand = Math.floor(Math.random()*1111); $('#adres_Wijzigen').slideUp(function() { if (id == 'x') { } else if (id == 'z') { $("input[name='adres_id']").val(""); $("input[name='bedrijfsnaam']").val(""); $("input[name='contactpersoon']").val(""); $("input[name='adres']").val(""); $("input[name='postcode']").val(""); $("input[name='plaats']").val(""); $("input[name='land']").val(""); $("select[name='land']").selectOptions(1); $("#delLink").html(""); } else { $.get("http://www.everstelecom.nl/modules/producten/requests/get_adres.php?cache="+rand, { id: id }, function(data){ part = data.split('|'); var link = part[7]; $("input[name='adres_id']").val(part[0]); $("input[name='bedrijfsnaam']").val(part[1]); $("input[name='contactpersoon']").val(part[2]); $("input[name='adres']").val(part[3]); $("input[name='postcode']").val(part[4]); $("input[name='plaats']").val(part[5]); $("select[name='land']").selectOptions(part[6]); $('#delLink').html(link); }); } if (id != 'x') { $('#adres_Wijzigen').slideDown(); } }); } function rmaGetProducten(id) { rand = Math.floor(Math.random()*1111); if (id == 'x') { } else { $.get("http://www.everstelecom.nl/modules/producten/requests/get_rma_producten.php?cache="+rand, { id: id }, function(data){ $('#producten').html(data); }); } } function rmaGetArtikel(id) { rand = Math.floor(Math.random()*1111); if (id == 'x') { } else { $.get("http://www.everstelecom.nl/modules/producten/requests/get_rma_artikel.php?cache="+rand, { id: id }, function(data){ $('#artikel').html(data); }); } } function changeTab(tab) { $('.tabcontent').hide(); $('#'+tab).show(); $('.active').removeClass('active'); $('#'+tab+'_tab').addClass('active'); } function checkOutAdres(id,type) { rand = Math.floor(Math.random()*1111); if (id > 0) { $.get("http://www.everstelecom.nl/modules/producten/requests/get_adres.php?cache="+rand, { id: id }, function(data){ part = data.split('|'); $("input[name='"+type+"_bedrijfsnaam']").val(part[1]); $("input[name='"+type+"_contactpersoon']").val(part[2]); $("input[name='"+type+"_adres']").val(part[3]); $("input[name='"+type+"_postcode']").val(part[4]); $("input[name='"+type+"_plaats']").val(part[5]); $("select[name='"+type+"_land2']").selectOptions(part[6]); $("select[name='"+type+"_land']").selectOptions(part[6]); $("input[name='"+type+"_land']").val(part[6]); }); } if (id != 'x') { $('#adres_Wijzigen').slideDown(); } } function showAV() { rand = Math.floor(Math.random()*1111); $.get("http://www.everstelecom.nl/modules/producten/requests/algemenevoorwaarden.php?cache="+rand, { }, function(data) { Shadowbox.open({ content: data, player: "html", height: 355, width: 633 }); }); } function addRma() { row = $("input[name='aantalRijen']").val()*1; nieuw = row+1; $("input[name='aantalRijen']").val(nieuw); var aantal = $("select[name='aantal']").val(); var factuur = $("input[name='factuur']").val(); var artikel = $("input[name='artikel']").val(); var klacht = $("input[name='probleem']").val(); var id = $("input[name='id']").val(); inputregel = ''; regel = ''+inputregel+''+factuur+''+artikel+''+aantal+''+klacht+''; $("#rmas").append(regel); $("select[name='bestelling']").selectOptions(""); $("#producten").html(""); $("#rmaNieuwOverzicht").show(); return false; } function openToestellen(merk) { $('.product_toestellen div').hide(); $('#toestellen_'+merk).show(); }