/* PCNavitagionTool.js */
(function(){var g=null;var h=null;var k=null;var l=null;var m=[];var n=[];var o=0;var p="|";var q=function(){var a=navigator.userAgent.toLowerCase();return{major:parseInt(navigator.appVersion),minor:parseFloat(navigator.appVersion),nav:((a.indexOf('mozilla')!=-1)&&((a.indexOf('spoofer')==-1)&&(a.indexOf('compatible')==-1))),nav2:(this.nav&&(this.major==2)),nav3:(this.nav&&(this.major==3)),vms:(a.indexOf("vax")!=-1)||(a.indexOf("openvms")!=-1)}}();function Item(a,b,c,d){this.name=a;this.path=b;this.catId=c;this.id=b;this.list=[];this.isItem=d;m[b]=this}function search(){switch(g){case pT.consumables:location=pT.catProdLineListAction+"&nloc=top&categoryID="+itemObj.catId;break;case pT.accessories:location=pT.catProdLineListAction+"&nloc=top&categoryID="+itemObj.catId;break;default:location=pT.catProdLineListAction+"&nloc=top&categoryID="+itemObj.catId;break}}function getTopCategory(a){path=n[a];var b=path.split(p);return b.shift()}function getBreadCrumbs(a){path=n[a];pathArray=path.split(p);breadCrumbString="";for(var i=1;i<pathArray.length;i++){breadCrumbString+=pathArray[i];if(i<(pathArray.length-1)){breadCrumbString+=" >> "}}return breadCrumbString}window.toggleTabs=function(a){g=a;for(var i=2;i<=4;i++){document.getElementById("step"+i+"Col_"+g).style.display="none"}productTree.buildList(a,a+"_step1")};window.productTree={list:[],addItem:function(a,b,c,d){o++;var e=b.split(p);var f=this.list;n[c]=b;for(var i=0;i<e.length;i++){if(f[e[i]]!=null){if((i+1)==e.length){f[e[i]].name=a;f[e[i]].catId=c;f[e[i]].path=b;f[e[i]].isItem=(d===true)?true:"blsh"}f=f[e[i]].list}else{if((i+1)==e.length){f[e[i]]=new Item(a,b,c,d)}else{f[e[i]]=new Item(null,null,null,d)}f=f[e[i]].list}}},findItem:function(a){var b=a.split(p);var c=this.list;var d=null;for(var i=0;i<b.length;i++){if(c[b[i]]!=null){d=c[b[i]];c=c[b[i]].list}}return d},buildList:function(a,b){var c=this.findItem(a).list;var d=document.getElementById(b);for(var i=d.options.length;i!==0;i--){d.remove(i)}var e=document.createElement("option");switch(g){case pT.consumables:switch(b){case pT.consumables+"_step1":e.appendChild(document.createTextNode(pT.choose+"..."));break;case pT.consumables+"_step2":e.appendChild(document.createTextNode(pT.forMy+"..."));break;case pT.consumables+"_step3":e.appendChild(document.createTextNode(pT.type+"..."));break;case pT.consumables+"_step4":e.appendChild(document.createTextNode(pT.model+"..."));break}break;case pT.accessories:switch(b){case pT.accessories+"_step1":e.appendChild(document.createTextNode(pT.for_resource+"..."));break;case pT.accessories+"_step2":case pT.accessories+"_step3":case pT.accessories+"_step4":e.appendChild(document.createTextNode(pT.choose+"..."));break}break;case pT.devices:switch(b){case pT.devices+"_step1":case pT.devices+"_step2":case pT.devices+"_step3":case pT.devices+"_step4":e.appendChild(document.createTextNode(pT.choose+"..."));break}break}e.setAttribute("value","");d.appendChild(e);if(d.options.length>1){d.remove(0)}sortedListItems=[];listCounter=0;for(var j in c){if(c[j].name){sortedListItems[listCounter]=[c[j].name,c[j].path];listCounter++}}sortedListItems.sort();for(i=0;i<sortedListItems.length;i++){e=document.createElement("option");e.appendChild(document.createTextNode(sortedListItems[i][0]));e.setAttribute("value",sortedListItems[i][1]);e.setAttribute("width",500);d.appendChild(e)}},showNext:function(a){var b=a.options[a.selectedIndex].value;itemObj=this.findItem(b);var c=a.name;var d=c.substring(c.length-1);var e=Number(d)+1;if(b!==""){if(itemObj.isItem===true){search()}else{var f=g+"_step"+(e);this.buildList(b,f);if(q.nav){document.getElementById("step"+(e)+"Col_"+g).style.display="table-cell"}else{document.getElementById("step"+(e)+"Col_"+g).style.display="block"}for(var i=(Number(e)+1);i<=4;i++){document.getElementById("step"+i+"Col_"+g).style.display="none"}}}}}})();