$(document).ready(function(){initHighlightTab();$('.boxresult').each(function(){var boxDelay=null;var showing=false;$(this).hover(function(){var popup=$('.popup2',this);boxDelay=setTimeout(function(){popup.show("slide",{direction:"down"},500);showing=true;},500)},function(){if(showing){clearTimeout(boxDelay);$('.popup2',this).hide("slide",{direction:"down"},500);showing=false;boxDelay=null;}else{clearTimeout(boxDelay);boxDelay=null;}});});$('.bubbleInfo').each(function(){var distance=10;var time=250;var hideDelay=500;var hideDelayTimer=null;var beingShown=false;var shown=false;var trigger=$('.trigger',this);var popup=$('.popup',this).css('opacity',0);$([trigger.get(0),popup.get(0)]).mouseover(function(){if(hideDelayTimer)clearTimeout(hideDelayTimer);if(beingShown||shown){return;}else{beingShown=true;popup.css({top:30,left:70,display:'block'})
.animate({top:'-='+distance+'px',opacity:1},time,'swing',function(){beingShown=false;shown=true;});}}).mouseout(function(){if(hideDelayTimer)clearTimeout(hideDelayTimer);hideDelayTimer=setTimeout(function(){hideDelayTimer=null;popup.animate({top:'-='+distance+'px',opacity:0},time,'swing',function(){shown=false;popup.css('display','none');});},hideDelay);});});if(getCookie("noshowDRreminder")!=1){initDRReminder();}});function flag(q){var flagged=prompt("How should we categorize this dress?");if(flagged){$.getJSON(dev+"product_callback.php",{q:q,flagged:flagged},function(data){if(data.success){$('#miscategorized').html("<span style='color:red;'>Flagged</span><br />Thank you!");}});};}
function addBuyPt(pid){$.getJSON(dev+"product_callback.php",{incrementpoints:1,pid:pid});}
function prodToDR(pid){var adddress=1;$.post(dev+"dressing_room_callback.php",{adddress:adddress,pid:pid},function(data){if(data.dr){setCookie("dr",data.dr,1);}
window.location="/private/"+getCookie("dr")+"/";},"json");}
function initDRReminder(){$('#overlay').show();$("#dressingroomreminderprod").show();$(".saveDRreminder").click(function(){if($("input[name='productreminder']:checked").val()){sendCaptchaResponse($("input[name='productreminder']:checked").val(),$("#captchapid").val());sendmailCaptchaChoice($("input[name='productreminder']:checked").val(),$("#captchapid").val());setCookie("noshowDRreminder",1,1000);}
else{$('#remindercaptcha').show();}});}
function sendCaptchaResponse(choice,pid){$.post(dev+"product_callback.php",{choice:choice,pid:pid},function(data){if(data.success==1){$('#overlay').hide();}},"json");}
function sendmailCaptchaChoice(mailchoice,pid){$.post(dev+"product_callback.php",{mailchoice:mailchoice,pid:pid},function(data){},"json");}
