function myFunction(){var e=document.getElementById("myTopnav");"mytopnav"===e.className?e.className+=" responsive":e.className="mytopnav"}function toggleVis(e){var o=document.getElementById(e);if(o.classList.contains("mobileshown"))var t="mobileshown";else t="mobilehidden";jQuery(".mobileshown").addClass("mobilehidden"),jQuery(".mobileshown").removeClass("mobileshown"),"mobilehidden"==t&&(o.classList.add("mobileshown"),o.classList.remove("mobilehidden"))}$("#hscroller").simplyScroll({auto:!0,orientation:"horizontal",speed:4.5}),$("#hpscroller").simplyScroll({auto:!0,orientation:"horizontal",speed:4.5}),$("#vscroller").simplyScroll({auto:!0,customClass:"vert",orientation:"vertical",speed:4.5});var store_url="";function do_search(e){sessionStorage.setItem("searchscrollstart",0),$("#deslist-hide").hide(),$("#accord-hide").css("z-index",2),$("#searchprod").html("
"),$("#searchpopup").popup("show");var o="designercode=&searchterm="+e;$.ajax({type:"POST",url:"//secretsof.com/includes/cms/new_results.php",data:o,cache:!1,success:function(e){parts=e.split("~"),"success"!=parts[0]?($("#searchpopup").popup("hide"),alert(e)):($("#searchprod").html('
'+parts[1]),sessionStorage.setItem("searchnumproducts",parts[2]))}})}window.console=window.console||function(e){};var cat_allprods_shown=!1;
var cat_st=0;
function show_cat(e, o) {
$("#catwin").show();
$("#prodpopup").popup("hide");
showdhpdiv("categories");
var a=jQuery("#cat-header").html();
console.log("top="+a);
if(cat_st==0)$("#catwin").html("
");
var n="designercode=&cat="+e;
if(o)n=n+"&subcat="+o;
n=n+"&cat_st="+cat_st;
filters = '';
if ($("#Singles").val() > 0 || $('#Singlescb').is(":checked")) {
n += "&singles=1";
filters += "Singles,";
}
if ($("#Tutorials").val() > 0 || $('#Tutorialscb').is(":checked")) {
n += "&tutorial=1";
filters += "Tutorials,";
}
if ($("#Projects").val() > 0 || $('#Projectscb').is(":checked")) {
n += "&projects=1";
filters += "Projects,";
}
if ($("#In_The_Hoop").val() > 0 || $('#In_The_Hoopcb').is(":checked")) {
n += "&ith=1";
filters += "In The Hoop,";
}
if ($("#Applique").val() > 0 || $('#Appliquecb').is(":checked")) {
n += "&applique=1";
filters += "Applique,";
}
if ($("#Free_Standing_Lace").val() > 0 || $('#Free_Standing_Lacecb').is(":checked")) {
n += "&fsl=1";
filters += "Free Standing Lace,";
}
if ($("#Quilt_Blocks").val() > 0 || $('#Quilt_Blockscb').is(":checked")) {
n += "&quiltblocks=1";
filters += "Quilt Blocks,";
}
if ($("#Outlines").val() > 0 || $('#Outlinescb').is(":checked")) {
n += "&outlines=1";
filters += "Outlines,";
}
if ($("#Fill_Stitch").val() > 0 || $('#Fill_Stitchcb').is(":checked")) {
n += "&fillstitch=1";
filters += "Fill Stitch,";
}
var method = "";
$('.method:checkbox:checked').each(function() {
method += $(this).val() + "|";
filters += $(this).data("name") + ",";
});
if (method != "") n += "&method=" + method;
var style = "";
$('.style:checkbox:checked').each(function() {
style += $(this).val() + "|";
filters += $(this).data("name") + ",";
});
if (style != "") n += "&style=" + style;
console.log("datastring="+n);
$.ajax({
type: "POST",
url: "//secretsof.com/categories.new.php",
data: n,
cache: !1,
success: function(result) {
parts = result.split("~");
divname = document.getElementById("catwin");
if(parts[0] != "success"){
jQuery(".filterbacktext").text("No designs found. Tap to close or select another subcategory.");
jQuery(".filterclosetext").text("No designs found. Tap to close or change your filters.");
var divtext="
"; if (filters != "") divtext+=""; divtext+="
No designs found.
"; divname.innerHTML =divtext; //$("#catwin").hide(); alert(result); }else{ jQuery("#morebutton"+cat_st).hide(); if(parts[3]>0){ var t=""; }else{ t=""; } if(cat_st==0){ jQuery(".filterbacktext").text(parts[5] + " products found. Tap to view or select a subcategory."); jQuery(".filterclosetext").text(parts[5] + " products found. Tap to view or select another filter."); if (filters != "") { var filtertext = "
You have the following filters set: " + filters + " .
"; } else { var filtertext = ""; } var divtext=""; if (filters != "") divtext+=" "; divtext+="
" + filtertext + parts[1]+t; $("#catwin").html(divtext); }else{ $("#catwin").append("" + parts[1]+t); } console.log("i'm here"); var top=""; if(parts[2] !=""){ var html=""+parts[2]+""; $("#cat-header").html(html); } console.log("results: \n"+result+ " \nend results"); if(parts[3]==0){ cat_allprods_shown=true; dhpcat=0; cat_st=0; }else{ cat_st=parts[3] console.log("3="+parts[3]); console.log("4="+parts[4]); console.log("5="+parts[5]); console.log("6="+parts[6]); } } } }); }function getPageId(e){return"page-"+e}function getDocumentHeight(){var e=document.body,o=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,o.clientHeight,o.scrollHeight,o.offsetHeight)}function getScrollTop(){return void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop}function getArticleImage(){var e=Math.floor(Math.random()*Number.MAX_SAFE_INTEGER),o=new Image;return o.className="article-list__item__image article-list__item__image--loading",o.src="http://api.adorable.io/avatars/250/"+e,o.onload=function(){o.classList.remove("article-list__item__image--loading")},o}function getArticle(){return article}var waiting=0;function getArticlePage(e){if(0==cat_allprods_shown){if(waiting)return void console.log("waiting");var o=document.createElement("div");o.id=getPageId(e),o.className="article-list__page";var t="designercode=&cat="+dhpcat+"&cat_st="+(1==e?0:30*(e-1)+1);return console.log("datastring="+t),waiting=1,$.ajax({type:"POST",url:"//secretsof.com/categories.new.php",data:t,cache:!1,success:function(e){var t=e.split("~");if("success"!=t[0])alert(e);else{var a=""+t[2]+"";$("#cat-header").html(a),0==t[3]&&(cat_allprods_shown=!0,dhpcat=0,cat_st=0),console.log("1="+t[1]),console.log("3="+t[3]),console.log("4="+t[4]),console.log("5="+t[5]),console.log("6="+t[6]),waiting=0,jQuery("#"+o.id).html(t[1])}}}),o}}function addPaginationPage(e){console.log("adding page link "+e);var o=document.createElement("a");o.href="#"+getPageId(e),o.innerHTML=e;var t=document.createElement("li");t.className="article-list__pagination__item",t.appendChild(o);var a=document.getElementById("article-list-pagination");a.appendChild(t),2===e&&a.classList.remove("article-list__pagination--inactive")}function fetchPage(e){1==e?jQuery("#catwin").html(getArticlePage(e)):jQuery("#catwin").append(getArticlePage(e))}function addPage(e){fetchPage(e),addPaginationPage(e)} function changecat(e){ "Show This Store Only"==e?(jQuery(".topcatul").hide(),jQuery(".topnavnew").show(),sessionStorage.setItem("desquery",1),jQuery("#catalogli").show(),jQuery("#allcatproddes").show(),jQuery("#allcatprodall").hide()):(jQuery(".topcatul").show(),jQuery(".topnavnew").hide(),sessionStorage.setItem("desquery",0),jQuery("#catalogli").hide(),jQuery("#allcatprodall").show(),jQuery("#allcatproddes").hide())}document.getElementById("catwin").addEventListener("scroll",function(e){console.log("scrolling,waiting="+waiting+",dhpcat="+dhpcat+",cat_all_prods_shown="+cat_allprods_shown);!waiting&&dhpcat&&0==cat_allprods_shown&&addPage(++page)});var articleListPagination=document.getElementById("article-list-pagination"),page=0;console.log("show_product_id=");$(document).ready(function(){jQuery("#allcattoplili").click(),$("#deslist-hide").show(),$("#searchpopup").popup({horizontal:"center",vertical:"center",scrolllock:!0}),$("#prodpopup").popup({horizontal:"center",vertical:"center",scrolllock:!0,blur:!0}),console.log("here")});var $menu=$(".dropdown-menu");function activateSubmenu(e){var o=$(e),t=o.data("submenuId"),a=$("#"+t),n=($menu.outerHeight(),$menu.outerWidth());a.css({display:"inline-block",left:n-5}),console.log("left:"+n-5),o.find("a").addClass("maintainHover")}function deactivateSubmenu(e){var o=$(e),t=o.data("submenuId");$("#"+t).css("display","none"),o.find("a").removeClass("maintainHover")}$menu.menuAim({activate:activateSubmenu,deactivate:deactivateSubmenu}),$(".dropdown-menu li").click(function(e){e.stopPropagation()}),$(document).click(function(){$(".popover").css("display","none"),$("a.maintainHover").removeClass("maintainHover")});var $menu2=$(".cat-dropdown-menu");function activateCatSubmenu(e){var o=$(e),t=o.data("submenuId"),a=$("#"+t),n=($menu2.outerHeight(),$menu2.outerWidth());a.css({display:"inline-block",left:n-5}),o.find("a").addClass("maintainHover")}function deactivateCatSubmenu(e){var o=$(e),t=o.data("submenuId"),a=$("#"+t);console.log("deactivating "+t),a.css("display","none"),o.find("a").removeClass("maintainHover")}function showdhpdiv(e) { if (jQuery("a").removeClass("chosen"), divnames = new Array("home", "catalog", "categories", "search_results"), !(divnames.indexOf(e) < 0)) for (i = 0; i < divnames.length; i++) console.log("divname=" + divnames[i]), divname = document.getElementById(divnames[i]), e == divnames[i] ? (console.log("showing=" + divnames[i]), divname.style.display = "block", jQuery("#" + divnames[i] + "link").addClass("button-on")) : (console.log("hiding=" + divnames[i]), "homes" != divnames[i] && (divname.style.display = "none"), jQuery("#" + divnames[i] + "link").removeClass("button-on")) } $menu2.menuAim2({ activate: activateCatSubmenu, deactivate: deactivateCatSubmenu }), $(".cat-dropdown-menu li").click(function(e) { e.stopPropagation() }), $(document).click(function() { $(".cat-popover").css("display", "none"), $("a.maintainHover").removeClass("maintainHover") }), $("#allcattoplili").click(function() { jQuery("#storelanding").hide(); jQuery("#maincontent").show(); $("#shop-by-store").css("color", "#222"); if($("#accord-hide2").is(":visible")){ $("#allcattopli").css("color", "#222"); $("#catarrow").text("▼"); $(".popover").hide(); $("a.maintainHover").removeClass("maintainHover"); }else{ $(".cat-dropdown-menu").show(); $("#allcattopli").css("color", "rgb(43, 168, 214)"); $("#catarrow").text("▲"); $("#mobilecats").css("color", "rgb(43, 168, 214)"); $("#mobilecatarrow").text("▲"); $("#accord-hide2").slideToggle("slow", function() { $(".cat-dropdown-menu").css("overflow", "visible"); }); } }); $("#allcattoplilixx").mouseover(function() { $(".dropdown-menu").is(":visible") || ($(".store-dropdown-menu").is(":visible") && ($(".store-dropdown-menu").hide(), $("#shop-by-store").css("color", "#222"), $("#storearrow").text("▼")), $("#allcattopli").css("color", "rgb(43, 168, 214)"), $("#catarrow").text("▲"), $(".store-dropdown-menu").hide(), $(".dropdown-menu").slideToggle("slow")) }), $("#storetopxx").mouseover(function() { $(".store-dropdown-menu").is(":visible") || ($(".dropdown-menu").is(":visible") && ($(".dropdown-menu").hide(), $("#allcattopli").css("color", "#222"), $("#catarrow").text("▼"), $(".popover").hide(), $("a.maintainHover").removeClass("maintainHover")), $(".store-dropdown-menu").is(":visible") && ($(".store-dropdown-menu").hide(), $("#allcattopli").css("color", "#222"), $("#catarrow").text("▼"), $(".popover").hide(), $("a.maintainHover").removeClass("maintainHover")), $("#shop-by-store").css("color", "rgb(43, 168, 214)"), $("#storearrow").text("▲"), $(".store-dropdown-menu").slideToggle("slow")) }), $(".store-dropdown-menu").mouseleave(function() { $(".store-dropdown-menu").hide(), $("#shop-by-store").css("color", "#222"), $("#storearrow").text("▼") }), $(".dropdown-menu").mouseleave(function() { $(".popover").hide() }), $(".cat-dropdown-menu").mouseleave(function() { $(".cat-popover").hide() }), $("#mobilecats").click(function() { jQuery("#storelanding").hide(),jQuery("#maincontent").show(), $("#accord-hide2").is(":visible") ? ($(".popover").hide(), $("#mobilecats").css("color", "#222"),$("#mobilecatarrow").text("▼"),$("a.maintainHover").removeClass("maintainHover")) : ($(".cat-dropdown-menu").show(),$("#mobilecatarrow").text("▲"),$("#mobilecats").css("color", "rgb(43, 168, 214)")), $("#accord-hide2").slideToggle("slow", function() { $(".cat-dropdown-menu").css("overflow", "visible") }) }), jQuery(document).ready(function() { var e, o, t, a, n, i, s, r, c; void 0 === store_url && $(".dropdown-menu").hide(), function() { for (var e, o = function() {}, t = ["assert", "clear", "count", "debug", "dir", "dirxml", "error", "exception", "group", "groupCollapsed", "groupEnd", "info", "log", "markTimeline", "profile", "profileEnd", "table", "time", "timeEnd", "timeStamp", "trace", "warn"], a = t.length, n = window.console = window.console || {}; a--;) n[e = t[a]] || (n[e] = o) }(), n = window, i = document, n.fbq || (s = n.fbq = function() { s.callMethod ? s.callMethod.apply(s, arguments) : s.queue.push(arguments) }, n._fbq || (n._fbq = s), s.push = s, s.loaded = !0, s.version = "2.0", s.queue = [], (r = i.createElement("script")).async = !0, r.src = "https://connect.facebook.net/en_US/fbevents.js", (c = i.getElementsByTagName("script")[0]).parentNode.insertBefore(r, c)), fbq("init", "1622062758103306"), fbq("track", "PageView") }); $(document).ready(function() { $( "#cattopli" ).click();$('#searchpopup').popup({horizontal: 'center',vertical: 'center',scrolllock:true});$('#prodpopup').popup({horizontal: 'center',vertical: 'center',scrolllock:true,blur: true}); }); function showtrick(){ $("#accord-hide2").hide(); $(".store-dropdown-menu").hide(); if ($('#accord-hide2').length > 0) { if(!$("#accord-hide2").is(':hidden')){ $('#accord-hide2').css("z-index",100); //console.log("resetting z-index"); } // dostuff } if ($('#deslist-hide').length > 0) { if(!$("#deslist-hide").is(':hidden')){ $('#deslist-hide').css("z-index",100); //console.log("resetting z-index"); } // dostuff } $("#searchpopup").popup("hide"); $("#prodpopup").html("
");
$("#prodpopup").popup("show");
}
function showtreat(bundle){
$("#accord-hide2").hide();
$(".store-dropdown-menu").hide();
if ($('#accord-hide').length > 0) {
if(!$("#accord-hide").is(':hidden')){
$('#accord-hide').css("z-index",100);
//console.log("resetting z-index");
}
// dostuff
}
if ($('#deslist-hide').length > 0) {
if(!$("#deslist-hide").is(':hidden')){
$('#deslist-hide').css("z-index",100);
//console.log("resetting z-index");
}
// dostuff
}
$("#searchpopup").popup("hide");
$("#prodpopup").html("
");
$("#prodpopup").popup("show");
//console.log("showprod show");
var dataString="bundle_id="+bundle;
console.log("showtreat datastring="+dataString);
$.ajax({
type: "POST",
url: "//secretsof.com/includes/cms/new_productcontent.php",
data: dataString,
cache: false,
success: function(result){
$("#prodpopup").html("
"+result+""); $("#prodpopup").popup("show"); $( "#prodpopup" ).scrollTop( 0 ); eval("FB.XFBML.parse(document.getElementById('prodpopup'));"); } }); } $(".trick").on("click", function(e){ e.preventDefault(); showtreat(); }); $(".treat").on("click", function(e){ e.preventDefault(); showtrick(); }); imageMapResize(); /*$("#storetop").click(function() { $("#accord-hide2").is(":visible") && ($("#accord-hide2").hide(), $("#allcattopli").css("color", "#222"), $("#catarrow").text("▼"), $(".popover").hide(), $("a.maintainHover").removeClass("maintainHover")), $(".store-dropdown-menu").is(":visible") ? ($("#shop-by-store").css("color", "#222"), $(".store-dropdown-menu").show(), $("#storearrow").text("▼")) : ($("#shop-by-store").css("color", "rgb(43, 168, 214)"), $("#storearrow").text("▲")), $(".store-dropdown-menu").slideToggle("slow") }); $("#mobilestores").click(function() { $("#accord-hide2").hide(),$("#mobilecatarrow").text("▼"), $(".popover").hide(), $(".store-dropdown-menu").is(":visible") ? ($("#mobilestorearrow").text("▼"),$("#mobilestores").css("color", "#222"),$("a.maintainHover").removeClass("maintainHover")) : $("#mobilestorearrow").text("▲"), $(".store-dropdown-menu").slideToggle("slow") }), */