// *** *** Client side DbJsBasket functions - MyBasket Page // *** Copyright Roy Henderson(henderson.roy@gmail.com) 2012, All Rights Reserved. $(document).ready(function () { // This sets up the promo window, only needed on page with the cycle plugin. $('#inner-slider').cycle({ fx: 'scrollLeft', timeout: 6000, delay: -2000, pause: 1, pager: '#inner-slider-nav', next: '#slider-next', prev: '#slider-prev', pagerAnchorBuilder: function (idx, slide) { // return sel string for existing anchor return '#inner-slider-nav li:eq(' + (idx) + ') a'; } }); // This sets up the tabbed content $(".tab_content").hide(); //Hide all content $("ul.tabs li:first").addClass("active").show(); //Activate first tab $(".tab_content:first").show(); //Show first tab content $(".tab_content2").hide(); //Hide all content $("ul.tabs2 li:first").addClass("active").show(); //Activate first tab $(".tab_content2:first").show(); //Show first tab content //On Click Event $("ul.tabs li").click(function () { $("ul.tabs li").removeClass("active"); // Remove any "active" class $(this).addClass("active"); // Add "active" class to selected tab $(".tab_content").hide(); // Hide all tab content var activeTab = $(this).find("a").attr("href"); // Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); // Fade in the active ID content return false; }); //On Click Event $("ul.tabs2 li").click(function () { $("ul.tabs2 li").removeClass("active"); //Remove any "active" class $(this).addClass("active"); //Add "active" class to selected tab $(".tab_content2").hide(); //Hide all tab content var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content $(activeTab).fadeIn(); //Fade in the active ID content return false; }); // This is the carousel code for in the lower tabs jQuery('#mycarousel').jcarousel({ wrap: 'circular', scroll: 1 }); jQuery('#mycarousel2').jcarousel({ wrap: 'circular', scroll: 1 }); }); function MM_jumpMenu(targ, selObj, restore) { //v3.0 eval(targ + ".location='" + selObj.options[selObj.selectedIndex].value + "'"); if (restore) selObj.selectedIndex = 0; } function ProductPageUpdateBreadcrumbNav(str) { document.getElementById('Breadcrumbnav').innerHTML = String.fromCharCode(60) + 'strong' + String.fromCharCode(62) + 'You are here: ' + String.fromCharCode(60) + String.fromCharCode(47) + 'strong' + String.fromCharCode(62) + str; } String.prototype.repeat = function (num) { if (num <= 0) { return new Array(1).join(this) } return new Array(num + 1).join(this); } function MyBasketCapatalizeChar(str, intLocation) { var strOut = str; var intLength = strOut.lenght; if (intLength == 0) { return ''; } if (intLocation > intLength) { return strOut; } if (intLocation == 0) { strOut = strOut.toUpperCase().charAt(intLocation) + strOut.substring(intLocation + 1); } else { strOut = strOut.substring(0, intLocation) + strOut.toUpperCase().charAt(intLocation) + strOut.substring(intLocation + 1); } return strOut; } function MyBasketCapatalizeAllWords(str, bitMac) { var strOut = ''; var intStart = 0; var pieces = str.split(" "); for (var i = 0; i < pieces.length; i++) { var j = pieces[i].charAt(0).toUpperCase(); pieces[i] = j + pieces[i].substr(1); } strOut = pieces.join(" "); if (bitMac == true) { intStart = strOut.indexOf(' Mc'); if (intStart >= 0) { strOut = MyBasketCapatalizeChar(strOut, intStart + 3); } intStart = strOut.indexOf(' Mac'); if (intStart >= 0) { strOut = MyBasketCapatalizeChar(strOut, intStart + 4); } intStart = strOut.indexOf(' Mic'); if (intStart >= 0) { strOut = MyBasketCapatalizeChar(strOut, intStart + 4); } intStart = strOut.indexOf(' Fitz'); if (intStart >= 0) { strOut = MyBasketCapatalizeChar(strOut, intStart + 5); } intStart = strOut.indexOf(" O'"); if (intStart >= 0) { strOut = MyBasketCapatalizeChar(strOut, intStart + 3); } } return strOut; } function MyBasketStringToNumber(strText, dblDefault) { var dblOut = dblDefault; try { dblOut = parseFloat(strText) } catch (e) { dblOut = dblDefault } if (isNaN(dblOut)) { dblOut = dblDefault } return dblOut }