// ---------------------------smb-home-cookie-logic.js starts here----------------------------
var whichProd="";var cat="";var fromCookie=0;var metas=document.getElementsByTagName("meta");var tmp=null;var pretmp=null;var tmpVal=null;var recCookie=false;function trimAll(sString){if(sString!=null){while(sString.substring(0,1)==' '){sString=sString.substring(1,sString.length);}
while(sString.substring(sString.length-1,sString.length)==' '){sString=sString.substring(0,sString.length-1);}}
return sString;}
function Get_Cookie(name){var start=document.cookie.indexOf(name+"=");var len=start+name.length+1;if((!start)&&(name!=document.cookie.substring(0,name.length))){return null;}
if(start==-1){return null;}
var end=document.cookie.indexOf(";",len);if(end==-1)end=document.cookie.length;return unescape(trimAll(document.cookie.substring(len,end)));}
for(var i=0;i<metas.length;i++){if(metas[i].name=="product_service_name"){var product_meta_index=i;if(Get_Cookie('smbRMcookie')){tmp=Get_Cookie('smbRMcookie');pretmp=Get_Cookie('smbRMcookie');productcookiedefined=true;tmp=trimAll(tmp);tmp=tmp.replace(/\_/g,' ');tmp='entry_page/'+tmp;metas[i].content=tmp;fromCookie=1;}else{tmp=null;}}}
var urlpathname=location.pathname;if(fromCookie==1&&urlpathname=="/sbso/index.html"){document.write("<scr"+"ipt language=\"JavaScript\" type=\"text\/javascript\" src=\"http:\/\/www.hp.com\/country\/js\/hpweb_syn_con.js\"><\/scr"+"ipt>");}
var urlString=document.location.href;var urlString=urlString.toLowerCase();var myDate=new Date;myDate.setDate(myDate.getDate()+28);if(urlString.indexOf('topiccode=psg')>0){whichProd='PSG';if(tmp==null){document.cookie='smbRMcookie=notebooks_tablet_pcs/notebook_pcs; expires='+myDate+'; path=/';}}else if(urlString.indexOf('topiccode=ipg')>0){whichProd='IPG';if(tmp==null){document.cookie='smbRMcookie=printing_and_multifunction; expires='+myDate+'; path=/';}}else if(urlString.indexOf('topiccode=tsg')>0){whichProd='TSG';if(tmp==null){document.cookie='smbRMcookie=servers; expires='+myDate+'; path=/';}}
if(tmp!=null&&tmp!="null"&&tmp!=""){tmpVal=tmp.toLowerCase();}
if(whichProd==""){if(tmpVal){if(tmpVal.indexOf("printing")>0||tmpVal.indexOf("multifunction")>0||tmpVal.indexOf("supplies")>0||tmpVal.indexOf("accessories")>0||tmpVal.indexOf("doityourself")>0||tmpVal.indexOf("fax")>0||tmpVal.indexOf("copiers")>0||tmpVal.indexOf("scanners")>0||tmpVal.indexOf("photography")>0||tmpVal.indexOf("camera")>0||tmpVal.indexOf("photo studios")>0){whichProd='IPG';}else if(tmpVal.indexOf("handhelds")>0||tmpVal.indexOf("calculators")>0||tmpVal.indexOf("handheld")>0||tmpVal.indexOf("pcs")>0||tmpVal.indexOf("desktops")>0||tmpVal.indexOf("workstations")>0||tmpVal.indexOf("desktop")>0||tmpVal.indexOf("notebooks")>0||tmpVal.indexOf("wireless")>0||tmpVal.indexOf("tablet")>0||tmpVal.indexOf("notebook")>0||tmpVal.indexOf("workstation")>0){whichProd='PSG';}else if(tmpVal.indexOf("servers")>0||tmpVal.indexOf("storage")>0){whichProd='TSG';}}}
if(tmpVal==""||tmpVal==null||tmpVal=='null'||tmpVal==undefined||tmpVal=='undefined'){tmpVal="";}
if(tmpVal.indexOf("accessories")>=0||tmpVal.indexOf("suppl")>=0||tmpVal.indexOf("doityourself")>=0){cat="supplies";}else if(tmpVal.indexOf("calculator")>=0||tmpVal.indexOf("handheld")>=0){cat="handhelds";}else if(tmpVal.indexOf("large")>=0||tmpVal.indexOf("design")>=0){cat="large";}else if(tmpVal.indexOf("photo printer")>=0||tmpVal.indexOf("inkjet")>=0||tmpVal.indexOf("color laserjet")>=0||tmpVal.indexOf("color hp laserjet")>=0){cat="color_printers";}else if(tmpVal.indexOf("black and white multifunction")>=0||tmpVal.indexOf("all-in-one")>=0||tmpVal.indexOf("all in one")>=0){cat="multifunction";}else if(tmpVal.indexOf("black and white")>=0){cat="bw_printers";}else if(tmpVal.indexOf("multifunction")>=0){cat="multifunction";}else if(tmpVal.indexOf("scanner")>=0){cat="scanners";}else if(tmpVal.indexOf("server")>=0){cat="servers";}else if(tmpVal.indexOf("storage")>=0){cat="storage";}else if(tmpVal.indexOf("bw")>=0||tmpVal.indexOf("black")>=0){cat="bw_printers";}else if(tmpVal.indexOf("color")>=0){cat="color_printers";}else if(tmpVal.indexOf("monitor")>=0){cat="monitors";}else if(tmpVal.indexOf("service")>=0){cat="service";}else if(tmpVal.indexOf("services")>=0){cat="services";}else if(tmpVal.indexOf("multifunction")>=0||tmpVal.indexOf("copiers")>=0||tmpVal.indexOf("fax")>=0){cat="multifunction";}else if(tmpVal.indexOf("desktop pc")>=0){cat="desktops";}else if(tmpVal.indexOf("workstation")>=0){cat="workstations";}else if(tmpVal.indexOf("notebook")>=0||tmpVal.indexOf("tablet")>=0||tmpVal.indexOf("wireless")>=0){cat="notebooks";}else if(tmpVal.indexOf("desktop")>=0||tmpVal.indexOf("pc")>=0){cat="desktops";}
else
cat=="";if(cat==""||cat==null||cat==" "||cat=='null'||cat==undefined||cat=='undefined'){cat="day";}else{recCookie=true;}
var currentTime=new Date();var day=currentTime.getDate();
// ---------------------------smb-home-cookie-logic.js ends here----------------------------
// ---------------------------smb-home-ajacgi.js starts here----------------------------
var xmlHttp
function findSpecialsContent(cat,day){xmlHttp=GetXmlHttpObject()
if(xmlHttp==null){alert("Your browser does not support AJAX!");return;}
var url="/cgi-bin/sbso/special/smb_home.cgi?site=sbso&cat="+cat+"&day="+day;xmlHttp.onreadystatechange=stateChanged;xmlHttp.open("GET",url,true);xmlHttp.send(null);}
function stateChanged(){if(xmlHttp.readyState==4){document.getElementById("topSellProds").innerHTML=xmlHttp.responseText;}}
function GetXmlHttpObject(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest();}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}}
return xmlHttp;}
// ---------------------------smb-home-ajacgi.js ends here----------------------------
// ---------------------------hp-segment-cookie.js starts here----------------------------
var default_ck_name="hp_cust_seg_sel";var default_ck_domain=".hp.com";var default_ck_path="/";var default_ck_days=90;function _setCK(ck_value,ck_name,ck_days,ck_path,ck_domain)
{if(!ck_value)return;if(!ck_name)ck_name=default_ck_name;if(!ck_days)ck_days=default_ck_days;if(!ck_path)ck_path=default_ck_path;if(!ck_domain)ck_domain=default_ck_domain;var expireDate=new Date();expireDate.setTime(expireDate.getTime()+(ck_days*24*3600*1000));document.cookie=ck_name+"="+escape(ck_value)+((ck_days)?"; expires="+expireDate.toGMTString():"")+((ck_domain)?"; domain="+ck_domain:"")+((ck_path)?"; path="+ck_path:"");}
_setCK('SMB');
// ---------------------------hp-segment-cookie.js starts here----------------------------
