var G_PS_PATHNAME=document.location.pathname.toLowerCase();var G_PS_QUERYSTRING=document.location.search.toLowerCase();var G_PS_URL_REFERRER=document.referrer.toLowerCase();var G_PS_COOKIE_LIFETIME=31536000;var G_PS_COOKIE_LAST_CATID="PS_LAST_CATID";var G_PS_COOKIE_CATID="PS_CATID";var G_PS_COOKIE_PROD_CATID="PS_PROD_CATID";var G_PS_COOKIE_PROD_NAME="PS_PROD_NAME";var G_PS_COOKIE_PROFILE="PS_PROFILE";var G_PS_COOKIE_FLAG="PS_FLAG";var G_PS_CUR_CATID=null;var onsubmitAddToCartPtr=null;var onsubmitSignInPtr=null;var onsubmitRegisterPtr=null;var onclickSearchPtr=null;var onclickItemDetailPtr=null;var onclickAddToCartPtr=null;var G_PS_DEBUG_MODE=2;if((document.body!=null)&&(document.body.innerHTML.search(/We\'re sorry! We cannot find that page/gi)>=0||document.body.innerHTML.search(/The page cannot be found/gi)>=0)){var pageId="";if(G_PS_PATHNAME.indexOf("/newsroom")>=0){pageId="Newsroom";G_PS_CUR_CATID="AboutSwanson";}else{pageId="Page Not Found";G_PS_CUR_CATID="Home";}psCreateErrorTag(pageId,G_PS_CUR_CATID);}else{if(G_PS_PATHNAME.indexOf("itemdetail")>=0){}else{if(G_PS_PATHNAME.indexOf("shoppingbag")>=0){}else{if(G_PS_PATHNAME.search(/orderrecap/i)>=0){G_PS_CUR_CATID="Checkout";psCreatePageviewTag(psGetPageId(),G_PS_CUR_CATID);var inputs=document.getElementsByTagName("input");for(var i=0;i<inputs.length;i++){if(inputs[i].src.search(/ContinueCheckout_Btn.gif/gi)>=0){inputs[i].oldCMClick=inputs[i].onclick;inputs[i].onclick=function(){psPostCartView();if(this.oldCMClick!=null){return this.oldCMClick();}};break;}}}else{if(G_PS_PATHNAME.search(/ThankYou/gi)>=0){}else{if(G_PS_PATHNAME.search(/\/loginForm/gi)>=0){G_PS_CUR_CATID="LoginForm";G_PS_CUR_PAGEID="LoginForm";psSubscribeSignInPages();}else{if(G_PS_PATHNAME.search(/\/SignonForm/gi)>=0){G_PS_CUR_CATID="CHECKOUT";G_PS_CUR_PAGEID="GATEWAY";psSubscribeSignInPages();}else{if(G_PS_PATHNAME=="/register"){G_PS_CUR_CATID="My Account";psSubscribeProfilePages();}else{if(G_PS_PATHNAME.indexOf("/registercheckout")>=0){G_PS_CUR_CATID="Checkout";pageId="Checkout Register";psSubscribeProfilePages();}else{if(G_PS_PATHNAME.indexOf("/billingguest")>=0){G_PS_CUR_CATID="Checkout";pageId="Billing Guest";psSubscribeProfilePages();}else{if(G_PS_PATHNAME=="/profile"){G_PS_CUR_CATID="My Account";psSubscribeProfilePages();}else{if(psGetCookie(G_PS_COOKIE_FLAG)=="P"){G_PS_CUR_CATID="Shop By Product";psCreatePageviewTag("SEARCH:"+psGetValueFromUrl(G_PS_QUERYSTRING,"keyword"),G_PS_CUR_CATID);psSetCookie(G_PS_COOKIE_FLAG,"","delete");}else{if(psGetCookie(G_PS_COOKIE_FLAG)=="B"){G_PS_CUR_CATID="Shop By Brand";psCreatePageviewTag("SEARCH:"+psGetSearchTerm(),G_PS_CUR_CATID);psSetCookie(G_PS_COOKIE_FLAG,"","delete");}else{if(psGetCookie(G_PS_COOKIE_FLAG)=="S"||G_PS_QUERYSTRING.indexOf("&ntt")>=0||G_PS_QUERYSTRING.indexOf("keyword")>=0){}else{if(G_PS_PATHNAME.indexOf("product-categories")>=0){G_PS_CUR_CATID="Product Categories";psCreatePageviewTag(psGetPageId(),G_PS_CUR_CATID);}else{if(G_PS_PATHNAME.indexOf("healthconcern")>=0){G_PS_CUR_CATID="HealthConcern";psCreatePageviewTag(psGetPageId(),G_PS_CUR_CATID);}else{if(G_PS_QUERYSTRING.indexOf("?n=")>=0||G_PS_QUERYSTRING.indexOf("&n=")>=0){G_PS_CUR_CATID=psGetCatIdFromUrl();psCreatePageviewTag(psGetSearchTerm(),G_PS_CUR_CATID);}else{psPostPageView();}}}}}}}}}}}}}}}}}if(G_PS_CUR_CATID!=null){psSetCookie(G_PS_COOKIE_LAST_CATID,psCleanCatId(G_PS_CUR_CATID));}psPostSignInView();psPostUpdateProfileView();psHijackAddToCartButtons();psHijackItemDetailLinks();psHijackSearchButtons();psHijackLinkLogout();function psPostPageView(){var pageId=null;if(document.location.hostname.search(/swansonvitamins.blogs.com/gi)>=0){G_PS_CUR_CATID="Swansonvitamins Web Blogs";pageId=document.title;}else{if(G_PS_PATHNAME.indexOf("/emailsignup")>=0||G_PS_PATHNAME.indexOf("/customerreviewguide")>=0||G_PS_PATHNAME.indexOf("/shpnews_links")>=0||G_PS_PATHNAME.indexOf("/askdrdesilva")>=0||G_PS_PATHNAME.indexOf("/vendor/p267")>=0){G_PS_CUR_CATID="HOME";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/my-account/")>=0){G_PS_CUR_CATID="My Account";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/health-library")>=0){G_PS_CUR_CATID="Health-Library";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/affiliate")>=0){G_PS_CUR_CATID="Affiliate";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/merch")>=0){G_PS_CUR_CATID="Merch";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/offers")>=0){G_PS_CUR_CATID="Offers Directory";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/shippingguest")>=0){G_PS_CUR_CATID="CHECKOUT";pageId="Shipping Guest";}else{if(G_PS_PATHNAME.indexOf("/billinguser")>=0){G_PS_CUR_CATID="CHECKOUT";pageId="Billing Reg User";}else{if(G_PS_PATHNAME.indexOf("/shippinguser")>=0){G_PS_CUR_CATID="CHECKOUT";pageId="Shipping Reg User";}else{if(G_PS_PATHNAME.indexOf("/onsalenow")>=0){G_PS_CUR_CATID="OnSaleNow";pageId="OnSaleNow";}else{if(G_PS_PATHNAME.indexOf("/toprated")>=0){G_PS_CUR_CATID="BROWSE";pageId="TopRated";}else{if(G_PS_PATHNAME.indexOf("/bogo")>=0){G_PS_CUR_CATID="Bogo";pageId="Bogo";}else{if(G_PS_PATHNAME.indexOf("health-concerns.html")>=0){G_PS_CUR_CATID="BROWSE";pageId="HealthConcerns";}else{if(G_PS_PATHNAME.indexOf("/shopbyproduct")>=0){G_PS_CUR_CATID="BROWSE";pageId="ShopByProduct";}else{if(G_PS_PATHNAME.indexOf("/healtharticles")>=0||(G_PS_PATHNAME.indexOf("askourexperts")>=0)){G_PS_CUR_CATID="HealthArticles";pageId="HealthArticles";}else{if(G_PS_PATHNAME.indexOf("/aboutswanson")>=0||G_PS_PATHNAME.indexOf("/shpaboutus_main")>=0){G_PS_CUR_CATID="AboutSwanson";pageId="About Us";}else{if(G_PS_PATHNAME.indexOf("/community")>=0){G_PS_CUR_CATID="AboutSwanson";pageId="Community";}else{if(G_PS_PATHNAME.indexOf("/newsroom")>=0){G_PS_CUR_CATID="AboutSwanson";pageId="Newsroom";}else{if(G_PS_PATHNAME.indexOf("/shp")>=0){G_PS_CUR_CATID="SHP";pageId=G_PS_PATHNAME.substr(G_PS_PATHNAME.lastIndexOf("/"));pageId=pageId.replace("/shp_","").replace(".html","").replace(".htm","");}else{if(G_PS_PATHNAME.indexOf("/vitaminsandsupplements")>=0||G_PS_PATHNAME.indexOf("/spotlight")>=0){G_PS_CUR_CATID="VitaminsAndSupplements";pageId="VitaminsAndSupplements";}else{if(G_PS_PATHNAME.indexOf("/brands")>=0){G_PS_CUR_CATID="Brands";pageId="Brands";}else{if(G_PS_PATHNAME.indexOf("/new-products")>=0){G_PS_CUR_CATID="NewProducts";pageId="NewProducts";}else{if(G_PS_PATHNAME.indexOf("/favorites")>=0){G_PS_CUR_CATID="Favorites";pageId="Favorites";}else{if(G_PS_PATHNAME.indexOf("/quickbuy")>=0){G_PS_CUR_CATID="QuickBuy";pageId="QuickBuy";}else{if(G_PS_PATHNAME.indexOf("/helpdesk")>=0){G_PS_CUR_CATID="Help Desk";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/help")>=0){G_PS_CUR_CATID="Help Desk";pageId="Help";}else{if(G_PS_PATHNAME.search(/AskOurExperts/gi)>=0){G_PS_CUR_CATID="AskOurExperts";pageId="AskOurExperts";}else{if(G_PS_PATHNAME.indexOf("/product.request.do")>=0){G_PS_CUR_CATID="Error Pages";pageId="Product Request Form";}else{if(G_PS_PATHNAME.search(/PromoCode/gi)>=0){G_PS_CUR_CATID="PromoCode";pageId="PromoCode";}else{if(G_PS_PATHNAME=="/html/shpshippinginfo1.html"){G_PS_CUR_CATID="Shipping Standard";pageId="Shipping Policies at Swansonvitamins.com";}else{if(G_PS_PATHNAME=="/catalogrequest"){G_PS_CUR_CATID="Catalog Request";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/gs_7basic")>=0){G_PS_CUR_CATID="7 Basic Supplements for Good Health";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/html/gs_")>=0){G_PS_CUR_CATID="Product Guides";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/jobs")>=0){G_PS_CUR_CATID="Job Listings";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/lnd/")>=0){G_PS_CUR_CATID="Product-Related Articles";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/html/videoarchive.html")>=0){G_PS_CUR_CATID="HOME";pageId=psGetPageId();}else{if(G_PS_PATHNAME.indexOf("/forgotpassword")>=0){G_PS_CUR_CATID="Forgot Password";pageId="Forgot Password";}else{if(G_PS_PATHNAME.indexOf("/deal-of-the-day.html")>=0){G_PS_CUR_CATID="Deal of the Day";pageId="Deal of the Day";}else{if(G_PS_PATHNAME.indexOf("/outletmall")>=0){G_PS_CUR_CATID="OutletMall";pageId="OutletMall";}else{if(G_PS_PATHNAME.indexOf("/addressbook")>=0||G_PS_PATHNAME.indexOf("viewcworderstatus")>=0||G_PS_PATHNAME.indexOf("cworderstatuscheckcmd")>=0||G_PS_PATHNAME.indexOf("/account")>=0||G_PS_PATHNAME.indexOf("/orderstatusform")>=0||G_PS_PATHNAME.indexOf("/orderhistory")>=0){G_PS_CUR_CATID="My Account";pageId=psGetPageId();}else{if(G_PS_PATHNAME=="/payment"){G_PS_CUR_CATID="Checkout";pageId="Payment";}else{G_PS_CUR_CATID=null;pageId=null;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}if(pageId!=null){psCreatePageviewTag(pageId,G_PS_CUR_CATID);}}function psPostSearchView(){var pageId,catId,searchTerm,searchResult;searchTerm=psGetSearchTerm();searchResult=psGetSearchResult();if(searchResult>0){pageId="SEARCH SUCCESSFULL PAGE ";if(document.body.innerHTML.toUpperCase().indexOf("PAGE:")==-1){pageId+="1";}else{var str=document.body.innerHTML.toUpperCase().split("PAGE:")[1];str=str.split("</FONT>")[0];pageId+=str.substr(str.lastIndexOf(">")+1);}}else{pageId="SEARCH UNSUCCESSFULL";}if(G_PS_PATHNAME.indexOf("referencesearch")>=0||G_PS_PATHNAME.indexOf("healtharticles")>=0){catId="REFERENCE SEARCH";}else{catId="SEARCH";}psCreatePageviewTag(pageId,catId,searchTerm,searchResult);}function psPostProductView(){var prd=new psProduct();prd.getProduct();psCreateProductviewTag(prd.id,prd.name,prd.catId);}function psPostCartView(){psCreatePageviewTag(psGetPageId(),G_PS_CUR_CATID,null);var cartTbl=null;var tables=document.getElementsByTagName("table");if(G_PS_PATHNAME.search(/shoppingbag/i)>=0){if(tables.length<22){return;}cartTbl=tables[21];}else{if(G_PS_PATHNAME.search(/OrderRecap/i)>=0){if(tables.length<24){return;}cartTbl=tables[23];}else{return;}}var rows=cartTbl.rows;var prd=new psProduct();for(var r=0;r<rows.length;r++){if((rows[r].innerHTML.search(/\/itemdetail/i)<0)||(rows[r].innerHTML.indexOf("FREE")>=0)){continue;}prd.getItem5(rows[r]);psCreateShopAction5Tag(prd.id,prd.name,prd.quantity,prd.price,prd.catId);psSetValueToCookie(G_PS_COOKIE_CATID,prd.id,null);}psDisplayShop5s();}function psPostOrderView(){cmCreatePageviewTag("ThankYou",G_PS_CUR_CATID,null);var tables=document.getElementsByTagName("table");if(tables.length<13){return;}var rows=tables[12].rows;var ord=new psOrder();var prd=new psProduct();ord.getOrder();for(var r=0;r<rows.length;r++){if((rows[r].innerHTML.search(/receiptList/gi)>=0)&&(rows[r].cells.length==5)){prd.getItem9(rows[r]);psCreateShopAction9Tag(prd.id,prd.name,prd.quantity,prd.price,ord.cusId,ord.id,ord.subtotal,prd.catId);}}psDisplayShop9s();psCreateOrderTag(ord.id,ord.subtotal,ord.shipping,ord.cusId,ord.city,ord.state,ord.zipCode);psCreateRegistrationTag(ord.cusId,ord.cusId,ord.city,ord.state,ord.zipCode);psSetCookie(G_PS_COOKIE_PROD_CATID,"","delete");}function psSubscribeSignInPages(){psCreatePageviewTag(G_PS_CUR_PAGEID,G_PS_CUR_CATID,null);var frm=null;if(G_PS_PATHNAME.search(/\/LoginForm/gi)>=0){frm=document.getElementsByName("LogonPrompt")[0];}else{if(G_PS_PATHNAME.search(/\/SignonForm/gi)>=0){frm=document.getElementById("frmLogin");}}if(frm!=null){onsubmitSignInPtr=frm.onsubmit;frm.onsubmit=function(){var uP=new psProfile();if(G_PS_PATHNAME.indexOf("/login")>=0){uP.email=document.getElementById("logonId").value;}else{uP.email=document.getElementById("fldEmailReg").value;}uP.writeProfile();psSetCookie(G_PS_COOKIE_FLAG,"signed in");if(onsubmitSignInPtr!=null){return onsubmitSignInPtr();}};}}function psPostSignInView(){if(psGetCookie(G_PS_COOKIE_FLAG)=="signed in"){if((G_PS_PATHNAME.search(/loginform/gi)<0)&&(G_PS_PATHNAME.search(/signonform/gi)<0)){var uP=new psProfile();uP.readProfile();psCreateRegistrationTag(uP.email,uP.email);}psSetCookie(G_PS_COOKIE_FLAG,"","delete");}}function psSubscribeProfilePages(){psCreatePageviewTag(psGetPageId(),G_PS_CUR_CATID,null);var frm=null;if(G_PS_PATHNAME.search(/\/register/gi)>=0){frm=document.getElementById("register");}else{if(G_PS_PATHNAME.search(/\/profile/gi)>=0){frm=document.getElementsByName("changeRegistration")[1];}else{if(G_PS_PATHNAME.search(/\/billinguser/gi)>=0){frm=document.getElementById("frmBillingShipping");}else{if(G_PS_PATHNAME.search(/\/billingguest/gi)>=0){frm=document.getElementById("frmBillingShipping2");}else{return;}}}}if(frm!=null){onsubmitRegisterPtr=frm.onsubmit;frm.onsubmit=function(){var uP=new psProfile();if(G_PS_PATHNAME.search(/\/billingguest/gi)>=0){uP.email=document.getElementById("email1").value;uP.city=document.getElementById("city").value;uP.state=document.getElementById("state");if(uP.state!=null){uP.state=psGetInnerText(uP.state.options[uP.state.selectedIndex]);}uP.zipcode=document.getElementById("zip").value;}else{if((G_PS_PATHNAME.search(/\/register/gi)>=0)||(G_PS_PATHNAME.search(/\/profile/gi)>=0)){uP.email=document.getElementById("email").value;uP.city=document.getElementById("city").value;if(G_PS_PATHNAME.search(/\/register/gi)>=0){uP.state=document.getElementById("state");}else{uP.state=document.getElementById("stateSelect");}if(uP.state!=null){uP.state=psGetInnerText(uP.state.options[uP.state.selectedIndex]);}if(G_PS_PATHNAME=="/register"){uP.zipcode=document.getElementById("zipcode").value;}else{if(G_PS_PATHNAME=="/registercheckout"){uP.zipcode=document.getElementById("zip").value;}else{uP.zipcode=document.getElementsByName("zipCode")[0].value;}}}else{uP.email=document.getElementById("fldBillingEmail").value;uP.city=document.getElementById("fldBillingCity").value;uP.state=document.getElementById("fldBillingState");uP.state=psGetInnerText(uP.state.options[uP.state.selectedIndex]);uP.zipcode=document.getElementById("fldBillingZip").value;}}uP.writeProfile();psSetCookie(G_PS_COOKIE_FLAG,"updated");if(onsubmitRegisterPtr!=null){return onsubmitRegisterPtr();}};}}function psPostUpdateProfileView(){if(psGetCookie(G_PS_COOKIE_FLAG)=="updated"){if(((G_PS_PATHNAME!="/register")&&(G_PS_PATHNAME!="/profile")&&(G_PS_PATHNAME!="/registercheckout"))||(document.body.innerHTML.search(/thank you for registering/gi)>=0)){var uP=new psProfile();uP.readProfile();psCreateRegistrationTag(uP.email,uP.email,uP.city,uP.state,uP.zipcode);}psSetCookie(G_PS_COOKIE_FLAG,"","delete");}}function psHijackLinkLogout(){var tagA=document.getElementsByTagName("A");if(tagA!=null){for(var i=0;i<tagA.length;i++){if(tagA[i].href.indexOf("j_acegi_logout")>=0){tagA[i].oldFunc=tagA[i].onclick;tagA[i].onclick=function(){psSetCookie(G_PS_COOKIE_PROFILE,"","delete");if(this.oldFunc!=null){return this.oldFunc();}};break;}}}}function psHijackAddToCartButtons(){if(G_PS_PATHNAME.search(/quickbuy/gi)>=0){var frm=document.getElementById("quickbuy");if(frm!=null){onsubmitAddToCartPtr=frm.onsubmit;frm.onsubmit=function(){psAddToOrderOnClick(this);if(onsubmitAddToCartPtr!=null){return onsubmitAddToCartPtr();}};}}else{var items=null;if((G_PS_PATHNAME.search(/itemdetail/gi)>=0)||(G_PS_PATHNAME.search(/favorites/gi)>=0)){items=document.getElementsByTagName("input");}else{items=document.images;}for(var i=0;i<items.length;i++){if((items[i].src.search(/AddToOrder/gi)>=0)||(items[i].src.search(/AddToBag/gi)>=0)||(items[i].src.search(/AddOrder/gi)>=0)){onclickAddToCartPtr=items[i].onclick;items[i].onclick=function(){psAddToOrderOnClick(this);if(onclickAddToCartPtr!=null){return onclickAddToCartPtr();}};}}}}function psAddToOrderOnClick(clickedItem){if(G_PS_PATHNAME.search(/quickbuy/gi)>=0){var tables=document.getElementsByTagName("table");if(tables.length<21){return;}var rows=new Array();var index=0;for(var i=0;i<tables[19].rows.length;i++){rows[index++]=tables[19].rows[i];}for(var i=0;i<tables[20].rows.length;i++){rows[index++]=tables[20].rows[i];}var inputs;for(index=0;index<rows.length;index++){if(rows[index].innerHTML.search(/qbItemNo/gi)<0){continue;}inputs=rows[index].getElementsByTagName("input");if((inputs[0].value!="")&&(inputs[1].value>0)){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,inputs[0].value,G_PS_CUR_CATID);}}}else{if(G_PS_PATHNAME.search(/itemdetail/gi)>=0){var prdId=psGetPrdIdFromUrl(G_PS_PATHNAME);psSetValueToCookie(G_PS_COOKIE_PROD_CATID,prdId,psGetValueFromCookie(G_PS_COOKIE_CATID,prdId));}else{if(G_PS_PATHNAME.search(/favorites/gi)>=0){var tables=document.getElementsByTagName("table");if(tables.length<18){return;}var rows=tables[17].rows;var chkObj=null;for(var r=0;r<rows.length;r++){if(rows[r].innerHTML.search(/quantityArray/gi)>=0){chkObj=rows[r].getElementsByTagName("input")[2];if(chkObj.checked){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,chkObj.value,G_PS_CUR_CATID);}}}}else{var node=clickedItem;while(node.innerHTML.search(/endecaRecordId=/gi)<0){node=node.parentNode;}var re=new RegExp("endecaRecordId=([^&]*)","gi");if(node.innerHTML.search(re)>=0){psSetValueToCookie(G_PS_COOKIE_PROD_CATID,RegExp.$1,G_PS_CUR_CATID);}}}}}function psHijackItemDetailLinks(){var itemLinks=document.links;for(var i=0;i<itemLinks.length;i++){if(itemLinks[i].href.search(/itemdetail/gi)>=0){onclickItemDetailPtr=itemLinks[i].onclick;itemLinks[i].onclick=function(){var prdId=psGetPrdIdFromUrl(this.href);if(G_PS_PATHNAME.search(/shoppingbag/gi)>=0){psSetValueToCookie(G_PS_COOKIE_CATID,prdId,psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,prdId));}else{psSetValueToCookie(G_PS_COOKIE_CATID,prdId,psCleanCatId(G_PS_CUR_CATID));}if(onclickItemDetailPtr!=null){return onclickItemDetailPtr();}};}}}function psHijackSearchButtons(){var objects=document.getElementsByTagName("input");for(var i=0;i<objects.length;i++){if(objects[i].src.search(/go_button.jpg/i)>=0){onclickSearchPtr=objects[i].onclick;objects[i].onclick=function(){psSetCookie(G_PS_COOKIE_FLAG,"S");if(onclickSearchPtr!=null){return onclickSearchPtr();}};break;}}var txtGo=document.getElementById("keyword");if(txtGo!=null){txtGo.onkeyup=function(){if(event.keyCode==13){psSetCookie(G_PS_COOKIE_FLAG,"S");}};}objects=document.getElementsByName("keyword");if(objects.length>=2){objects[1].onchange=function(){if(this.options[this.selectedIndex].innerHTML.toUpperCase()!="SHOP BY PRODUCT"){psSetCookie(G_PS_COOKIE_FLAG,"P");}document.getElementsByTagName("form")[1].submit();};}objects=document.getElementsByName("n");if(objects.length>=3){objects[2].onchange=function(){if(this.options[this.selectedIndex].innerHTML.toUpperCase()!="SHOP BY BRAND"){psSetCookie(G_PS_COOKIE_FLAG,"B");}document.getElementsByTagName("form")[3].submit();};}}function psGetCatIdFromUrl(){var catId=psGetValueFromUrl(G_PS_QUERYSTRING,"n");if(catId==null){catId=psGetValueFromUrl(G_PS_URL_REFERRER,"n");}if(catId==null){return null;}var start=catId.lastIndexOf("+");if(start<0){start=catId.lastIndexOf(" ");}catId=catId.substr(start+1);return catId;}function psGetSearchTerm(){var term="";var h1=document.getElementsByTagName("h1");if(h1.length==0){term=document.body.innerHTML.toUpperCase().split("SEARCH:")[1];if(term==null||typeof(term)=="undefined"){return null;}term=term.split("</A>")[0];term=term.substr(term.lastIndexOf(">")+1);}else{term=psHtmlDecode(psGetInnerText(h1[0]));var i=term.lastIndexOf(">");if(i>=0){term=term.substr(i+1);}else{i=term.toUpperCase().lastIndexOf("SEARCH:");if(i>=0){term=term.substr(i+"SEARCH:".length);}else{return null;}}}return psTrim(term);}function psGetSearchResult(){var result=document.body.innerHTML.toUpperCase().split("SEARCH RESULTS");if(G_PS_PATHNAME.indexOf("referencesearch")>=0){result=result[2];}else{result=result[1];}if(result==null||typeof(result)=="undefined"){return null;}result=result.split("ITEMS</SPAN>")[0];result=result.substr(result.lastIndexOf(">")+1);return psTrim(result);}function psGetPageId(){var pageId="";if(document.title.indexOf(" - ")>=0){pageId=document.title.substr(0,document.title.indexOf(" - "));}else{pageId=document.title;}return pageId.replace(/[\n\t\v\r\?\'\"]/gi,"");}function psGetPrdIdFromUrl(pUrl){pUrl=pUrl.toUpperCase();pUrl=pUrl.substring(0,pUrl.indexOf("/ITEMDETAIL"));return pUrl.substr(pUrl.lastIndexOf("/")+1);}function psProduct(){this.id=null;this.name=null;this.catId=null;this.price=null;this.quantity=null;this.getProduct=function(){this.id=psGetPrdIdFromUrl(G_PS_PATHNAME);this.name=psHtmlDecode(psGetInnerText(document.getElementsByTagName("h1")[0]));if(psGetCookie(G_PS_COOKIE_FLAG)=="P"){this.catId="Shop By Product";}else{if(psGetCookie(G_PS_COOKIE_FLAG)=="B"){this.catId="Shop By Brand";}else{if(psGetCookie(G_PS_COOKIE_FLAG)=="S"){this.catId="SEARCH";}else{this.catId=psGetValueFromCookie(G_PS_COOKIE_CATID,this.id);if(this.catId==null){this.catId=psGetCookie(G_PS_COOKIE_LAST_CATID);}if(this.catId==null){this.catId=psGetCatIdFromUrl();}if(this.catId==null){this.catId="BOOKMARK";}}}}psSetValueToCookie(G_PS_COOKIE_CATID,this.id,this.catId);psSetCookie(G_PS_COOKIE_FLAG,"","delete");};this.getItem5=function(itemRow){var hrefs=itemRow.cells[0].getElementsByTagName("a");this.id=psGetPrdIdFromUrl(hrefs[0].href);if(itemRow.innerHTML.indexOf("FREE")>=0){this.name=psHtmlDecode(hrefs[0].innerHTML);this.price=0;this.quantity=psGetInnerText(psHtmlDecode(itemRow.cells[2].innerHTML));if(this.quantity!=null){this.quantity=this.quantity.replace("qty","");}}else{this.name=psHtmlDecode(hrefs[1].innerHTML);this.price=itemRow.cells[1].innerHTML.split("SWANSON")[1];if(this.price!=null){this.price=psTrim(this.price.substring(0,this.price.indexOf("<")));if(this.price!=null){this.price=this.price.replace("$","");}}this.quantity=itemRow.cells[2].getElementsByTagName("input")[0];if(this.quantity!=null){this.quantity=this.quantity.value;}}this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,this.id);};this.getItem9=function(itemRow){this.id=psGetInnerText(itemRow.cells[0]);this.name=null;this.quantity=psGetInnerText(itemRow.cells[2]);this.price=psGetInnerText(itemRow.cells[3]);if(this.price!=null){this.price=this.price.replace("$","");}this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,this.id);};this.getFreeItem9=function(prdId){this.id=prdId;this.name=null;this.quantity=1;this.price=0;this.catId=psGetValueFromCookie(G_PS_COOKIE_PROD_CATID,this.id);};}function psProfile(){this.email=null;this.city=null;this.state=null;this.zipcode=null;this.readProfile=function(){this.email=psGetCookie(G_PS_COOKIE_PROFILE);if(this.email!=null){var buf=this.email.split("|");this.email=buf[0];this.city=buf[1];this.state=buf[2];this.zipcode=buf[3];}};this.writeProfile=function(){if(this.email==null){return;}var data=this.email+"|"+this.city+"|"+this.state+"|"+this.zipcode;psSetCookie(G_PS_COOKIE_PROFILE,data);};}function psOrder(){this.id=null;this.subtotal=null;this.shipping=null;this.cusId=null;this.city=null;this.state=null;this.zipCode=null;this.getOrder=function(){this.id=document.body.innerHTML.toUpperCase().split("ORDER NUMBER:")[1];this.id=this.id.substring(0,this.id.indexOf("</TD>"));this.id=psTrim(this.id.substr(this.id.indexOf(">")+1));var discount=0;if(document.body.innerHTML.search(/DISCOUNT \/ PROMOTION:/gi)>=0){discount=document.body.innerHTML.toUpperCase().split("DISCOUNT / PROMOTION:")[1];discount=discount.split("$")[1];discount=discount.substring(0,discount.indexOf("<"));}this.subtotal=document.body.innerHTML.toUpperCase().split("SUBTOTAL:")[2];this.subtotal=this.subtotal.split("$")[1];this.subtotal=this.subtotal.substring(0,this.subtotal.indexOf("<"));this.subtotal=Math.round((this.subtotal-discount)*100)/100;this.shipping=document.body.innerHTML.toUpperCase().split("SHIPPING (STANDARD):")[1];this.shipping=this.shipping.split("$")[1];this.shipping=this.shipping.substring(0,this.shipping.indexOf("<"));this.cusId=psGetCookie(G_PS_COOKIE_PROFILE);if(this.cusId!=null){this.cusId=this.cusId.split("|")[0];}var table=document.getElementsByTagName("table");if(table.length>11){var buffer=table[11].rows[2].cells[0].innerHTML.toUpperCase().split("<BR")[3];buffer=buffer.substr(buffer.indexOf(">")+1);buffer=buffer.split(",");this.city=buffer[0];buffer=psTrim(buffer[1]).split(" ");this.state=buffer[0];this.zipCode=buffer[1];if(this.cusId==null){var profileStr=table[11].rows[2].cells[0].innerHTML;var arrProfile=profileStr.toLowerCase().split("<br>");this.cusId=arrProfile[arrProfile.length-1];}}};}function psGetInnerText(pTagOjb){if(pTagOjb!=null){if(typeof(pTagOjb)=="object"){return psTrim(pTagOjb.innerHTML.replace(/\<+.+?\>+/g,""));}else{return psTrim(pTagOjb.replace(/\<+.+?\>+/g,""));}}return null;}function psCleanCatId(pCatId){return(pCatId!=null)?pCatId.replace(/[\'\":,]/g,""):null;}function psCleanPageId(pPageId){return(pPageId!=null)?pPageId.replace(/[\n\t\v\r’\'\"]/gi,""):null;}function psCleanProductName(pProductName){return(pProductName!=null)?pProductName.replace(/[\n\t\v\r’\'\"]/gi,""):null;}function psTrim(pStr){if(pStr==null||typeof(pStr)=="undefined"){return pStr;}return pStr.replace(/&nbsp;/gi," ").replace(/^\s+|\s+$/g,"");}function psGetValueFromUrl(pUrl,pKey){var re=new RegExp("[?&]"+pKey+"=([^&$]*)","i");if(pUrl.search(re)==-1){return null;}return unescape(RegExp.$1);}function psHtmlDecode(pValue){if(pValue){pValue=pValue.replace(/&nbsp;/gi," ");pValue=pValue.replace(/&quot;/gi,'"');pValue=pValue.replace(/&amp;/gi,"&");pValue=pValue.replace(/&lt;/gi,"<");pValue=pValue.replace(/&gt;/gi,">");}return pValue;}function psGetCookie(pCookieName){if(!pCookieName){return null;}var start=document.cookie.indexOf(pCookieName+"=");if(start>-1){start=start+pCookieName.length+1;end=document.cookie.indexOf(";",start);if(end==-1){end=document.cookie.length;}return unescape(document.cookie.substring(start,end));}return null;}function psSetCookie(pCookieName,pCookieValue,pLifeTime,pDomain){if(!pCookieName){return false;}if(pLifeTime=="delete"){CC(pCookieName);return true;}var expire=(pLifeTime)?(new Date((new Date()).getTime()+(1000*pLifeTime))).toGMTString():null;return CB(pCookieName,escape(pCookieValue),expire,pDomain);}function psSetValueToCookie(pCookieName,pKey,pValue){pCookieName=psTrim(pCookieName);pKey=psTrim(pKey);var catCookie=psGetCookie(pCookieName);if(catCookie==null){catCookie="";}if(catCookie.indexOf(pKey)>=0){var reg=new RegExp("#"+pKey+"~([^#]*)","gi");catCookie=catCookie.replace(reg,"");}if(pValue!=null&&pValue!=""){catCookie="#"+pKey+"~"+pValue+catCookie;var cookieArray=null;while(catCookie.length>3500){cookieArray=catCookie.split("#");cookieArray.pop();catCookie=cookieArray.join("#");}}psSetCookie(pCookieName,catCookie,G_PS_COOKIE_LIFETIME);}function psGetValueFromCookie(pCookieName,pKey){pCookieName=psTrim(pCookieName);pKey=psTrim(pKey);var catCookie=psGetCookie(pCookieName);if(catCookie!=null){var re=new RegExp("#"+pKey+"~([^#]+)","i");if(catCookie.search(re)==-1){return null;}return RegExp.$1;}return null;}function psCreatePageviewTag(pageID,categoryID,searchString,searchResults){pageID=psCleanPageId(pageID);categoryID=psCleanCatId(categoryID);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreatePageviewTag("+pageID+", "+categoryID+", "+searchString+", "+searchResults+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreatePageviewTag(pageID,categoryID,searchString,searchResults);}}function psCreateProductviewTag(productID,productName,categoryID){productName=psCleanProductName(productName);categoryID=psCleanCatId(categoryID);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateProductviewTag("+productID+", "+productName+", "+categoryID+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateProductviewTag(productID,productName,categoryID);}}function psCreateShopAction5Tag(productID,productName,productQuantity,productPrice,categoryID){productName=psCleanProductName(productName);categoryID=psCleanCatId(categoryID);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateShopAction5Tag("+productID+", "+productName+", "+productQuantity+", "+productPrice+", "+categoryID+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateShopAction5Tag(productID,productName,productQuantity,productPrice,categoryID);}}function psCreateShopAction9Tag(productID,productName,productQuantity,productPrice,customerID,orderID,orderTotal,categoryID){productName=psCleanProductName(productName);categoryID=psCleanCatId(categoryID);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateShopAction9Tag("+productID+", "+productName+", "+productQuantity+", "+productPrice+", "+customerID+", "+orderID+", "+orderTotal+", "+categoryID+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateShopAction9Tag(productID,productName,productQuantity,productPrice,customerID,orderID,orderTotal,categoryID);}}function psCreateOrderTag(orderID,orderTotal,orderShipping,customerID,customerCity,customerState,customerZIP){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateOrderTag("+orderID+", "+orderTotal+", "+orderShipping+", "+customerID+", "+customerCity+", "+customerState+", "+customerZIP+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateOrderTag(orderID,orderTotal,orderShipping,customerID,customerCity,customerState,customerZIP);}}function psCreateConversionEventTag(eventID,actionType,categoryID,points){categoryID=psCleanCatId(categoryID);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateConversionEventTag("+eventID+", "+actionType+", "+categoryID+", "+points+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateConversionEventTag(eventID,actionType,categoryID,points);}}function psCreateRegistrationTag(customerID,customerEmail,customerCity,customerState,customerZIP,newsletterName,subscribe){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateRegistrationTag("+customerID+", "+customerEmail+", "+customerCity+", "+customerState+", "+customerZIP+", "+newsletterName+", "+subscribe+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateRegistrationTag(customerID,customerEmail,customerCity,customerState,customerZIP,newsletterName,subscribe);}}function psCreateErrorTag(pageID,categoryID){pageID=psCleanPageId(pageID);categoryID=psCleanCatId(categoryID);if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmCreateErrorTag("+pageID+", "+categoryID+")");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmCreateErrorTag(pageID,categoryID);}}function psDisplayShop5s(){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmDisplayShop5s()");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmDisplayShop5s();}}function psDisplayShop9s(){if(G_PS_DEBUG_MODE==1||G_PS_DEBUG_MODE==3){alert("cmDisplayShop9s()");}if(G_PS_DEBUG_MODE==2||G_PS_DEBUG_MODE==3){cmDisplayShop9s();}}
