var updateshoppingcart_timer; var updatecombineshoppingcart_timer; var updateshoppingprevious_skuid; var updateshoopingprevious_amount; var timerskuid = null; var timerskuids = null; function updateshoppingcarttimer(skuid, activityid, activitytype) { if (timerskuid == null || timerskuid == skuid) { cleartimeout(updateshoppingcart_timer); } updateshoppingcart_timer = settimeout("updateshoppingcart("+skuid+", " + activityid + ", " + activitytype + ")", 1000); timerskuid = skuid; } function updatecombineshoppingcarttimer(skuids, activityid, activitytype) { if (timerskuids == null || timerskuids == skuids) { cleartimeout(updatecombineshoppingcart_timer); } updatecombineshoppingcart_timer = settimeout("updatecombineshoppingcart('"+skuids+"', " + activityid + ", " + activitytype + ")", 500); timerskuids = skuids; }