$(document).ready(function(){ function geld(amount) { var i = parseFloat(amount); if(isNaN(i)) { i = 0.00; } var minus = ''; if(i < 0) { minus = '-'; } i = Math.abs(i); i = parseInt((i + .005) * 100); i = i / 100; s = new String(i); if(s.indexOf('.') < 0) { s += '.00'; } if(s.indexOf('.') == (s.length - 2)) { s += '0'; } s = minus + s; s = s.replace('.', ','); return s.replace(',00', ',-'); } $("#merk").load("/includes/engine.php?mode=merk", function() { if (document.body.className.indexOf("merk") != -1) { $("#merk").val(document.body.className.substr(4, document.body.className.length)); $("#model").html(""); $("#model").load("/includes/engine.php?mode=model&id=" + this.value, function() { $("#model")[0].disabled = false; //$("#model")[0].focus(); $("#bestel img")[0].src = "http://www.telefoonlader.nl/images/pijli.gif"; $("#stap2")[0].style.color = '#FFF'; $("#stap3")[0].style.color = '#808080'; $("#bestel")[0].style.color = '#808080'; if (document.body.id.indexOf("model") != -1) { $("#model").val(document.body.id.substr(5, document.body.id.length)); $("#bestel img")[0].src = "http://www.telefoonlader.nl/images/pijl.gif"; $("#stap3")[0].style.color = '#FFF'; $("#bestel")[0].style.color = '#FFF'; //$("#bestel")[0].focus(); } }); } }); $("#merk").change(function() { $("#model").html(""); $("#model").load("/includes/engine.php?mode=model&id=" + this.value, function() { $("#model")[0].disabled = false; $("#model")[0].focus(); $("#bestel img")[0].src = "http://www.telefoonlader.nl/images/pijli.gif"; $("#stap2")[0].style.color = '#FFF'; $("#stap3")[0].style.color = '#808080'; $("#bestel")[0].style.color = '#808080'; }); }); $("#model").change(function() { if (parseInt($("#merk")[0].value) * parseInt($("#model")[0].value)) { document.location.href = '/?s_page_id=' + $("#model")[0].value; } //$("#bestel img")[0].src = "/images/pijl.gif"; //$("#stap3")[0].style.color = '#FFF'; //$("#bestel")[0].style.color = '#FFF'; //$("#bestel")[0].focus(); }); $("#bestel").click(function() { if (parseInt($("#merk")[0].value) * parseInt($("#model")[0].value)) { document.location.href = '/?s_page_id=' + $("#model")[0].value + '#naw'; } return false; }); $("#kleft .brow").toggle(function() { $("img", this).css({height:"auto"}); $.scrollTo($(this), {duration: 1000, offset: -3}); $("img", this).animate({ width: '100%' },1000,function(){}); }, function() { $("img", this).css({width:"", height:""}); }); $(".groep .kopen").click(function() { $.scrollTo($("#kassa"), {duration: 1000, offset: -6}); $("#kassa").load("/includes/inc_kassa.php?s_item=" + $(this).parent().children('.s_item').val() + "&s_aantal=" + $(this).parent().children('select').val() + "&s_foon=" + $(this).parent().children('.s_foon').val(), function() { $("#kassa").show("normal"); }); return false; }); $(".groep .brow select").click(function() { return false; }); $(".fld, h2").toggle(function() { $.scrollTo($(this).parent(), {duration: 1000, offset: -6}); $(this).parent().children(".fold").show(); $(this).parent().children(".fld").html('Minder «'); return false; }, function() { $.scrollTo($(this).parent(), {duration: 1000, offset: -6}); $(this).parent().children(".fold").slideUp('fast'); $(this).parent().children(".fld").html('Meer »'); //$(this).parent().children(".brow img").css({width:"", height:""}); return false; } ); $("#sub").click(function() { $("#kassa").hide('slow'); return false; }); $("h1").click(function() { document.location.href = '/'; }); $("#kassa").load("/includes/inc_kassa.php", function() { if ($("#kassa .brow").length > 0) { $("#kassa").show("normal"); } }); });