// Associate-O-Matic v4.5.0 function popup(purl, pw, ph) { pww = pw + 30; pwh = ph + 30; winpops = window.open('', 'imgWindow', 'width=' + pww + ',height=' + pwh); winpops.document.write('\'\''); winpops.document.close(); } function popupCond(msg) { winpops = window.open('', 'imgWindowTerms', 'width=300,height=300,resizable=1,scrollbars=yes') winpops.document.write('' + msg + ''); winpops.document.close(); } function popupPricing(msg) { winpops = window.open('','imgWindowPricing','width=230,height=230,resizable=1,scrollbars=no') winpops.document.write('' + msg + '') winpops.document.close(); } function popupTerms(msg) { winpops = window.open('','imgWindowPricing','width=500,height=400,resizable=1,scrollbars=yes') winpops.document.write('' + msg + '') winpops.document.close(); } function checkVariation(msg) { var selection=document.Variation.elements['offerlistingid'].selectedIndex; if (selection=="-1") { alert(msg); document.Variation.elements['offerlistingid'].focus(); return false; } return true; } function redirectSameWindow(msg) { if (document.Variation.elements['offerlistingid'].value != '') { window.open(document.Variation.elements['offerlistingid'].value, 'win'); } else { alert(msg); } } function redirectNewWindow(msg) { if (document.Variation.elements['offerlistingid'].value != '') { location.href(document.Variation.elements['offerlistingid'].value); } else { alert(msg); } } function searchInside() { swn = document.getElementById('aom_swn').value; swk = document.getElementById('aom_swk').value; sbox = document.getElementById('aom_sbox').value; if (swk != sbox) searchinside = swk + ' ' + sbox; else searchinside = swk; document.getElementById('aom_sbox').value = searchinside; if (swn != '') document.getElementById('aom_swn').name = 'n'; document.getElementById('aom_search').submit(); } function displayDate(amz) { var t = new Date(); var month = t.getMonth() + 1; var day = t.getDate(); var year = t.getFullYear(); if (amz=='Amazon.de' || amz=='Amazon.fr' || amz=='Amazon.co.uk') { month = String(month); day = String(day); if (month.length == 1) month = "0" + month; if (day.length == 1) day = "0" + day; } if (amz=='Amazon.de') document.write(day + '.' + month + '.' + year) else if (amz=='Amazon.co.uk' || amz=='Amazon.fr') document.write(day + '/' + month + '/' + year) else if (amz=='Amazon.co.jp') document.write(year + '年' + month + '月' + day + '日') else document.write(month + '/' + day + '/' + year) } function enableField(id) { document.getElementById(id).disabled=false; } $(document).ready(function(){ $("a[rel='gallery']").each(function(){ $(this).colorbox({href:$(this).attr('caption')}); }); $("a[rel='gallery2']").each(function(){ $(this).colorbox({href:$(this).attr('caption')}); }); }); function autoList(script,parent,child,childVal,childLbl,childLbl2) { $("body").append(""); $('#'+parent+child).html($("#"+child+" option")); var parentValue = $('#'+parent).attr('value'); $('#'+child).html($("#"+parent+child+" .sub_"+parentValue).clone()); childVal = (typeof childVal == "undefined")? "" : childVal ; $("#"+child).val(childVal).attr('selected','selected'); $('#'+parent).change(function(){ var parentValue = $('#'+parent).attr('value'); $('#'+child).html($("#"+parent+child+" .sub_"+parentValue).clone()); $('#'+child).prepend(""); var year = $("#year").val(); var make = $("#make").val(); var model = $("#model").val(); mk = 0; vs = "Year=" + year; if (make!="none" && make!="make") { vs = vs + "&Make=" + make; mk = 1; } if (model!="none" && model!="model" && mk) { vs = vs + "&Model=" + model; md = 1; } else { $('#model').html(''); $('#model').prepend(""); md = 0; } var position = $(this).offset(); $('').css('position','absolute').hide().appendTo('body'); $('#spinner').css({ top: position.top +22 , left: position.left + $(this).width() -40 }).fadeIn(); $.getJSON(script + '?ajax=true&a=auto&' + vs, function(data){ var options = ''; options += ''; for (var i = 1; i < data.length; i++) { options += ''; } $('#'+child).html(options); }) $('#spinner').fadeOut(); $('#'+child).focus(); }); }