function setFocusToSearch() { document.getElementById("keyword").focus(); document.getElementById("keyword").select() }
jQuery(function() { var a; try { a = window.parent.location.host == window.location.host } catch (b) { a = false } a || (jQuery("#logging_gifs").append('<img src="' + location.origin + '/images/BIABSite/AuxImages/1x1_inframe.gif" style="border: 0; width: 1px; height: 1px;" alt="viewing in frame" title="viewing in frame" />'), location.protocol == "https:" && jQuery("#logging_gifs").append('<img src="' + location.origin + "/fblgng.asp?e=FB&amp;c=" + BIAB_G.sPathEncoded + '" style="display:none; border: 0; width: 1px; height: 1px;" alt="x" title="x" />')) });
BIAB_G.iMSIE = fn_getMSIEFromUserAgent(); function fn_getMSIEFromUserAgent() { var a = navigator.userAgent, b = a.indexOf("MSIE"); return b > 0 ? a.substr(b + 5, 1) : 0 } var $jQ = jQuery.noConflict(), jQ = jQuery.noConflict(), sHostname = ""; if (window.location.hostname.indexOf("birthdayinabox.com") >= 0) document.domain = "birthdayinabox.com", sHostname = window.location.hostname; var jQTop, oTopBIABWindow; self != top ? (oTopBIABWindow = jfn_topBIABWindow(self), jQTop = oTopBIABWindow.jQuery) : (oTopBIABWindow = self, jQTop = jQuery);
function jfn_topBIABWindow(a) { a === void 0 && (a = self); var b; try { b = self.location.hostname.indexOf("birthdayinabox.com") >= 0 ? true : false } catch (e) { b = false } if (!b) return null; if (top == a) return a; var c; try { c = a.parent.location.hostname.indexOf("birthdayinabox.com") >= 0 ? true : false } catch (d) { c = false } return c ? jfn_topBIABWindow(a.parent) : a } history.navigationMode = "compatible";
function MM_preloadImages() { var a = document; if (a.images) { if (!a.MM_p) a.MM_p = []; var b, e = a.MM_p.length, c = MM_preloadImages.arguments; for (b = 0; b < c.length; b++) if (c[b].indexOf("#") != 0) a.MM_p[e] = new Image, a.MM_p[e++].src = c[b] } } function changeImages() { if (document.images) for (var a = 0; a < changeImages.arguments.length; a += 2) document[changeImages.arguments[a]].src = changeImages.arguments[a + 1] } window.onerror = null; var topMargin = 200, slideTime = 1200, ns6 = !document.all && document.getElementById, ie4 = document.all, ns4 = document.layers;
function main() { if (ns4) this.currentY = document.layers.floatLayer.top, this.scrollTop = window.pageYOffset, mainTrigger(); else if (ns6) this.currentY = parseInt(document.getElementById("floatLayer").style.top), this.scrollTop = scrollY, mainTrigger(); else if (ie4) this.currentY = floatLayer.style.pixelTop, this.scrollTop = document.body.scrollTop, mainTrigger() }
function writeTip(a) { a == "" && (a = ' <div id="tooltipsformhh" style="height:50px; width:250px"><div id="switchview" onclick="javascript:toggleLayer(\'panel1\');" style=" cursor:default"> <img src="http://images.birthdayinabox.com/biabsite/buttons/plussign.jpg" /><sup><a href="#" class="smallleft" > View Larger</a></sup></div> </span> </div>'); document.getElementById("tooltipsformhh").innerHTML = a }
function getURLParameter(a) { a = a.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); a = RegExp("[\\?&]" + a + "=([^&#]*)").exec(window.location.href); return a == null ? "" : a[1] } function fn_bPersistentCookiesEnabled() { var a = new Date; a.setDate(a.getDate() + 30); document.cookie = escape("tpce") + "=" + escape("1") + "; expires=" + a.toUTCString() + "; path=/"; return document.cookie.indexOf("tpce=") == -1 && document.cookie.indexOf("cookiedetector=") == -1 ? false : true }
function fn_AddToCart(a, b) { return fn_AddToCartAndPersonalize(a, b, "", "") } function fn_AddToCartAndPersonalize(a, b, e, c) { return fn_AddToCartAllOptions(a, b, e, c, false) } function fn_AddToCartFromLightbox(a, b, e, c) { return fn_AddToCartAllOptions(a, b, e, c, true) }
function fn_AddToCartAllOptions(a, b, e, c) {
	if (!fn_bPersistentCookiesEnabled()) return window.location.href = "/cookieorjava.asp", false; b > 0 || (b = 1); if (b > 5E3) return jQuery("#waitspinner").hide(), alert("For very large orders, please contact Customer Service by phone at 800-989-5506 or 301-956-1616, or by email at customerservice@birthdayinabox.com. Thank you! [ahs-m1]"), 0; jQuery("#waitspinner").length && jQuery("#waitspinner").show(); jQuery.ajax({ async: false, type: "GET", url: "/ajax/ajax_addtocart.asp", data: "iSku=" +
a + "&iQty=" + b + "&page_shopperID=" + BIAB_G.sShopperID, timeout: 5E3, tryCount: 0, retryLimit: 2, error: function(a, b) {
	b == "timeout" ? (this.tryCount++, this.tryCount <= this.retryLimit ? $.ajax(this) : (jQuery("#waitspinner").hide(), alert("We could not add this item to your cart.  Please try again in a few minutes or contact Customer Service. [ahs-m2]"))) : (a.status == 500 ? (jQuery("#waitspinner").hide(), alert("We could not add this item to your cart.  The server is very busy.  Please try again in a few minutes or contact Customer Service. [ahs-m3]")) :
(jQuery("#waitspinner").hide(), alert("We could not add this item to your cart. Please try again or contact Customer Service. [ahs-m4]")), jQuery("#waitspinner").hide())
}, success: function(d) {
	if (d == "" || d == "[]") return 0; d = jQuery.parseJSON(d); if (d.bSuccess == 1) {
		var f = "<iframe src='http://pixel.fetchback.com/serve/fb/pdc?cat=&name=landing&sid=3563&abandon_products=" + d.sQBPC + "' scrolling='no' width='1' height='1' marginheight='0' marginwidth='0' frameborder='0'></iframe>"; jQuery("body").append(f); fn_UpdateMiniCart(d.iItemsInCart,
d.sSubtotal); fn_PopulateAddedToCartPopUp(a, b, d); d.iPersTmpltID <= 0 ? jQuery("#atc-pre-anchor").trigger("click") : (d = "/new_includes/personalize_a.asp?rd=ss&pers_type=" + d.iPersTmpltID + "&iIndex=" + d.iNewIndex + "&qty=" + (c > 0 ? c * b : b) + "&sku=" + (e != "" ? e : a), jQuery("#buttonPersonalize").attr("href", d), jQuery("#buttonPersonalize").trigger("click"))
	} else d = d.sErrMsg.length > 0 ? d.sErrMsg : "We could not add this item to your cart. Please try again or contact Customer Service. [ahs-m5]", jQuery("#waitspinner").hide(), alert(d)
} 
	});
	return true
}
function fn_UpdateMiniCart(a, b) {
	a < 0 || a === void 0 || b === void 0 ? jQuery.ajax({ url: "/ajax/ajax_getsubtotal.asp?page_shopperID=" + BIAB_G.sShopperID, dataType: "text", cache: false, timeout: 15E3, tryCount: 0, retryLimit: 3, error: function(a, b) { if (b == "timeout" && (this.tryCount++, this.tryCount <= this.retryLimit)) { jQuery.ajax(this); return } jQuery("#minicart-loading").hide() }, success: function(a) {
		jQuery("#minicart-loading").hide(); aRet = a.split("|"); aRet[0] == "Error" && (jQuery("#cart_quantity").html("<i>looking up your cart</i>"), jQuery("#cart_total").html("..."),
jQuery.delay(5E3).ajax(this)); BIAB_G.oMiniCart.itemcount = aRet[0]; BIAB_G.oMiniCart.subtotal = aRet[1]
	} 
	}) : (BIAB_G.oMiniCart.itemcount = a, BIAB_G.oMiniCart.subtotal = b); BIAB_G.oMiniCart.updateCookie(); BIAB_G.oMiniCart.updateDisplay(); jQuery("#minicart-loading").hide()
}
function fn_PopulateAddedToCartPopUp(a, b, e) {
	var a = e.sSubtotal.replace("subtotal ", ""), c = "", c = b > 1 ? "these items" : "this item"; e.iPersTmpltID <= 0 ? jQTop("#div-atc-announcebar").html("You have added " + c + " to your cart") : jQTop("#div-atc-announcebar").html("You have personalized " + c); jQTop("#img-atc-thumbnail").attr("src", e.sImageSrc).show(); jQTop("#p-productname").html(e.sProductName); e.sPkgQty != "" && jQTop("#p-tab6").html(e.sPkgQty); jQTop("#p-price").html(e.sPricePaid); jQTop("#p-quantity").html("Quantity: " +
b); jQTop("#p-cartitems").html("Items in Cart: " + e.iItemsInCart); jQTop("#p-subtotal").html("Subtotal:* " + a)
} function fn_persFrameHeight(a) { switch (a) { case 2: case 0: a = jQuery.browser.msie && (jQuery.browser.version == 6 || jQuery.browser.version == 7) ? 640 : 568; break; case 6: a = 660; break; case 11: a = 530; break; case 4: case 12: case 17: a = 540; break; case 5: a = 570; break; case 10: case 23: a = 630; break; default: a = jQuery.browser.msie && (jQuery.browser.version == 6 || jQuery.browser.version == 7) ? 595 : 580 } return a }
jQuery(function() {
	jQuery("#buttonAddedContinue").click(function() { jQuery("#div-added-to-cart").stop(true); jQuery("#div-added-to-cart").fadeOut("fast"); jQuery.fancybox.close(); return false }); jQuery("#closebar span").click(function() { jQuery("#div-added-to-cart").stop(true); jQuery("#div-added-to-cart").fadeOut("fast"); jQuery.fancybox.close(); return false }); jQuery("#buttonAddedCheckout").click(function() {
		jQTop("#waitspinner").length && jQTop("#waitspinner").show(); jQuery("#div-added-to-cart").stop(true);
		jQuery("#div-added-to-cart").fadeOut("slow"); window.location.href = "/shopping/cart.asp"; jQuery.fancybox.close(); return false
	})
}); function dynamicallyLoadJSFile(a, b) { var e = document.getElementsByTagName("head")[0], c = document.createElement("script"); c.src = a; var d = false; c.onload = c.onreadystatechange = function() { if (!d && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) d = true, b && b(c), c.onload = c.onreadystatechange = null }; e.appendChild(c); return c }
function fn_setPersButton(a, b, e) {
	b == "" && (b = parseInt(jQuery(this).attr("rel"))); var c; c = 750; jQuery.browser.msie && (c = 766); var b = fn_persFrameHeight(b), d = "no"; BIAB_G.iMSIE > 7 && document.documentMode == 7 && (d = "auto"); c = { type: "iframe", autoScale: false, showIframeLoading: true, hideOnContentClick: false, hideOnOverlayClick: false, showCloseButton: false, height: b, width: c, scrolling: d, padding: 0, margin: 0, showNavArrows: false, titleShow: false, transitionIn: "fade", easingIn: "swing", speedIn: 300, transitionOut: "none", centerOnScroll: false };
	for (key in e) c[key] = e[key]; jQuery(a).fancybox(c)
};
