$(function () { var randomNum = Math.floor(Math.random() * 100000); var url = '/Cart/DropDownCart/' + randomNum; $('#cart_down').removeClass('hideCart').hide(); if ($.browser.safari) { if ($.browser.version <= 499) { $('#clickMe').attr('href', '/Cart'); } else { $('#cart_down').removeClass('hideCart').hide(); $('#clickMe').tooltip({ delay: 0, showURL: false, fade: 200 }); $('.showHide').toggle(function () { $('#cart_down').animate({ height: 'show' }, 'fast'); $(this).addClass('sh_down').removeClass('sh_right'); $('#cart_contents').load(url); $('#clickMe').attr('title', 'Click to Close Your Shopping Cart'); $('#clickMe').tooltip({ delay: 0, showURL: false, fade: 200 }); }, function () { $('#cart_down').hide(); $(this).addClass('sh_right').removeClass('sh_down'); $('#clickMe').attr('title', 'Click to View Your Shopping Cart'); $('#clickMe').tooltip({ delay: 0, showURL: false, fade: 200 }); }); } } else { $('#cart_down').removeClass('hideCart').hide(); $('#clickMe').tooltip({ delay: 0, showURL: false, fade: 200 }); $('.showHide').toggle(function () { $('#cart_down').animate({ height: 'show' }, 'fast'); $(this).addClass('sh_down').removeClass('sh_right'); $('#cart_contents').load(url); $('#clickMe').attr('title', 'Click to Close Your Shopping Cart'); $('#clickMe').tooltip({ delay: 0, showURL: false, fade: 200 }); }, function () { $('#cart_down').hide(); $(this).addClass('sh_right').removeClass('sh_down'); $('#clickMe').attr('title', 'Click to View Your Shopping Cart'); $('#clickMe').tooltip({ delay: 0, showURL: false, fade: 200 }); }); } $('#jQM').jqm({ ajax: '@href', trigger: 'a.popme', overlay: 50, toTop: true, ajaxText: 'Loading...' }).jqmAddClose('.close'); $('#jQMBN').jqm({ ajax: '@href', trigger: 'a.popmeBN', overlay: 50, toTop: true, ajaxText: 'Loading...' }).jqmAddClose('.close'); $('#jQMsurvey').jqm({ ajax: '@href', trigger: 'a.popmeSM', overlay: 50, toTop: true, ajaxText: 'Loading...' }).jqmAddClose('.close'); $('#jQMBuyNow').jqm({ ajax: '@buynowurl', trigger: 'a.buynowtrigger', overlay: 50, modal: true, toTop: true, ajaxText: 'Loading...' }).jqmAddClose('.close'); var curID = ""; $('[id^=jqm]').each(function () { var pop = $(this).attr('popme'); if ($(this).attr('id') == curID) { } else { curID = $(this).attr('id'); $(this).jqm({ trigger: 'a.' + pop, overlay: 50, toTop: true, ajaxText: 'Loading...' }).jqmAddClose('.close'); }; }); $('body').css('background', '#f2f0ed'); var p1 = 1; var p2 = 1; var p3 = 1; var p4 = 1; $('a#firstTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); if (p1 == 0) { $.ajax({ url: '/Views/Shared/Controls/HomeFeatured.aspx', cache: false, success: function (html) { $("#tab1 div.content").html(html); } }); p1 = 1; } $('#tab1').show(); $(this).parent().addClass('selected'); $('a#fourthTabHeader').parent().addClass('special'); }); $('a#secondTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); if (p2 == 0) { $.ajax({ url: '/Views/Shared/Controls/HomeTop.aspx', cache: false, success: function (html) { $("#tab2 div.content").html(html); } }); p2 = 1; } $('#tab2').show(); $(this).parent().addClass('selected'); $('a#fourthTabHeader').parent().addClass('special'); }); $('a#thirdTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); if (p3 == 0) { $.ajax({ url: '/Views/Shared/Controls.aspx', cache: false, success: function (html) { $("#tab3 div.content").html(html); } }); p3 = 1; } $('#tab3').show(); $(this).parent().addClass('selected'); $('a#fourthTabHeader').parent().addClass('special'); }); $('a#fourthTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $(this).parent().removeClass('special'); $('.tab').hide(); if (p4 == 0) { $.ajax({ url: '/Views/Shared/Controls.aspx', cache: false, success: function (html) { $("#tab4 div.content").html(html); } }); p4 = 1; } $('#tab4').show(); $(this).parent().addClass('selected'); }); $('a#firstTabHeader').click(); $('#findAndBuySH').toggle(function () { $('#searchContainer').hide(); $(this).removeClass('opened').addClass('closed'); }, function () { $('#searchContainer').show(); $(this).addClass('opened').removeClass('closed'); }); $('#inMenuHeader').toggle(function () { $('#inMenuContent').hide(); $(this).removeClass('opened').addClass('closed'); }, function () { $('#inMenuContent').show(); $(this).addClass('opened').removeClass('closed'); }); $('#quickShopSH').toggle(function () { $('#leftMenuQuickShop').hide(); $(this).removeClass('opened').addClass('closed'); }, function () { $('#leftMenuQuickShop').show(); $(this).addClass('opened').removeClass('closed'); }); $('#needToBuyMore').toggle(function () { $('#needToBuyMoreContainer').show(); $('#needToBuyMore').text("Need to Buy Less?"); }, function () { $('#needToBuyMoreContainer').hide(); $('#needToBuyMore').text("Need to Buy More?"); }); $('#topCategoriesSH').toggle(function () { $('#topCategories').hide(); $(this).removeClass('opened').addClass('closed'); }, function () { $('#topCategories').show(); $(this).addClass('opened').removeClass('closed'); }); $('#greatDealsSH').toggle(function () { $('#greatDeals').hide(); $(this).removeClass('opened').addClass('closed'); }, function () { $('#greatDeals').show(); $(this).addClass('opened').removeClass('closed'); }); $('#onlineResourcesSH').toggle(function () { $('#onlineResources').hide(); $(this).removeClass('opened').addClass('closed'); }, function () { $('#onlineResources').show(); $(this).addClass('opened').removeClass('closed'); }); $('a.firstProdTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); $('#tab1').show(); $(this).parent().addClass('selected'); }); $('a.secondProdTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); $('#tab2').show(); $(this).parent().addClass('selected'); $('#tab2link').addClass('selected'); }); $('a.thirdProdTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); $('#tab3').show(); $(this).parent().addClass('selected'); }); $('a.fourthProdTabHeader').click(function () { $('ul.yui-nav li').removeClass('selected'); $('.tab').hide(); $('#tab4').show(); $(this).parent().addClass('selected'); }); $('ul.yui-nav li.selected>a').click(); }); function NSPrintable() { var PrintWindow; NSPrintableWin = window.open("", "Printable", "width=720,height=600,left=50,scrollbars,resizable"); PrintWindow = NSPrintableWin.document.open(); PrintWindow.writeln('<html>\n<head>\n<title>' + document.title + '</title>'); PrintWindow.writeln('<link href="/css/pages/product_details_print.css" rel="styleSheet" type="text/css">'); PrintWindow.writeln('</head>\n<body>'); PrintWindow.writeln('<div id="NSPrintableToolbar" class="NSPrintableToolbar">'); PrintWindow.writeln('<a href="javascript:void(0);" OnClick="window.opener.NSPrintablePrint();">Print This Page</a>  '); PrintWindow.writeln('</div>'); PrintWindow.writeln('<div id="header"><h1 class="logo"><img src="/images/logo.gif" alt="Northern Safety Co.,Inc. Safety and Industrial Supplies" border="0"></h1><p id="callCenterSchedule"><span class="phone">1-800-571-4646</span><br>For sales&customer service<br><em>7:30 am-8:00 pm ET,Mon-Fri</em></p><p id="contactAddress">Northern Safety Co.,Inc.<br>PO Box 4250,Utica,NY 13504-4250<br><span class="phone">Phone:</span>1-800-571-4646<br><span class="phone">Fax:</span>1-800-635-1591</p></div><div style="margin:10px;" class="clear"></div>'); PrintWindow.writeln('<div id="NSPrintableContent" class="NSPrintableContent">' + NSPrintableCopyContent() + '</div>'); PrintWindow.writeln('</body>\n</html>\n'); PrintWindow = NSPrintableWin.document.close(); window.setTimeout('NSPrintableDisableActions()', 0); NSPrintableWin.focus(); } function NSPrintable2() { var PrintWindow; NSPrintableWin = window.open("", "Printable", "width=900,height=600,left=50,scrollbars,resizable"); PrintWindow = NSPrintableWin.document.open(); PrintWindow.writeln('<html>\n<head>\n<title>' + document.title + '</title>'); PrintWindow.writeln('<link href="/css/checkout.css" rel="styleSheet" type="text/css">'); PrintWindow.writeln('<link href="/css/pages/checkout5_print.css" rel="styleSheet" type="text/css">'); PrintWindow.writeln('</head>\n<body>'); PrintWindow.writeln('<div id="NSPrintableToolbar" class="NSPrintableToolbar">'); PrintWindow.writeln('<a href="javascript:void(0);" OnClick="window.opener.NSPrintablePrint();">Print This Page</a>  '); PrintWindow.writeln('</div>'); PrintWindow.writeln('<div id="printHeader"><h1 class="logo"><img src="/images/logo.gif" alt="Northern Safety Co.,Inc. Safety and Industrial Supplies" border="0"></h1></div>'); PrintWindow.writeln('<div id="NSPrintableContent" class="NSPrintableContent">' + NSPrintableCopyContent() + '</div>'); PrintWindow.writeln('</body>\n</html>\n'); PrintWindow = NSPrintableWin.document.close(); window.setTimeout('NSPrintableDisableActions()', 0); NSPrintableWin.focus(); } function NSPrintableCopyContent() { var Content, startpos, endpos, offset, starttag, endtag; if (document.all) { starttag = '<PRINT start'; endtag = '<PRINT end'; offset = 13; } else { starttag = '<print start'; endtag = '<print end'; offset = 16; } Content = document.body.innerHTML; startpos = Content.indexOf(starttag); endpos = Content.indexOf(endtag); if (startpos < 0 || endpos < 0) { return "Error capturing text"; } else { return Content.substr(startpos + offset, endpos - startpos - offset); } } function NSPrintablePrint() { NSPrintableWin.print(); NSPrintableWin.close(); } function NSPrintableDisableActions() { for (i = 0; i < NSPrintableWin.document.links.length; i++) { if (NSPrintableWin.document.links[i].parentNode.id != 'NSPrintableToolbar') { NSPrintableWin.document.links[i].onclick = function () { return false }; NSPrintableWin.document.links[i].href = "javascript:void(0)"; } } for (var i = 0; i < NSPrintableWin.document.forms.length; i++) { for (var j = 0; j < NSPrintableWin.document.forms[i].elements.length; j++) { if (NSPrintableWin.document.forms[i].elements[j].type == 'submit' || NSPrintableWin.document.forms[i].elements[j].type == 'button') { NSPrintableWin.document.forms[i].elements[j].disabled = true; } } } }
