if(!window.sdg){sdg={};}sdg.processStartTime=null;sdg.process=function(a,e){var b=document.createElement("div");
b.id="processing";$sd(b).html('<div class="tbProcessing"><p class="header">Processing...please wait</p><p class="loading">Loading...</p><p>We are processing your selection. Please do not click again.</p></div>');
if(a=="start"){var c=new Date();sdg.processStartTime=c.getTime();if($sd("#processing").length!=0){$sd("#processing").remove();
}$sd("body").append(b);if(e!=null&&e=="checkout"){tb_show("Please wait","#TB_inline?height=200&width=220&inlineId=processing&modal=false",null,null,"checkout");
e=null;}else{tb_show("Please wait","#TB_inline?height="+$sd(b).height()+"&width=520&inlineId=processing&modal=true");
}$sd("#TB_closeAjaxWindow").hide();if($sd.isFunction(e)){e.call();}}else{if(a=="end"||a=="clear"){var c=new Date();
totalTime=c.getTime()-sdg.processStartTime;if(totalTime<2000){setTimeout(function(){$sd("#TB_ajaxContent").fadeOut("fast",function(){$sd("#TB_closeAjaxWindow").show();
$sd(".tbProcessing").remove();$sd("#processing").remove();if(a==="end"){tb_remove(function(){if($sd.isFunction(e)){e.call();
}});}});},2000-totalTime);}else{$sd("#TB_ajaxContent").fadeOut("fast",function(){$sd("#TB_closeAjaxWindow").show();
$sd(".tbProcessing").remove();$sd("#processing").remove();if(a==="end"){tb_remove(function(){if($sd.isFunction(e)){e.call();
}});}});}}else{if($sd.isFunction(e)){e.call();}}}};
