
var lAs=new Array();var curLoad=null;var plPG=null;var ldBsy=0;function CurLoadO(){this.searchID='';this.pageNumber=0;}
function SearchO(){this.ia=null;this.pp=null;this.so=null;this.st=null;this.pc=null;this.at1=null;this.at2=null;this.at3=null;this.at4=null;this.av1=null;this.av2=null;this.av3=null;this.av4=null;this.flags=null;this.stt=null;this.searchID=null;}
function PageO(){this.pageNumber=null;this.lA=null;this.html=null;this.status=0;this.padB='';this.padT=''}
function LoadAttempt(){this.pages=new Array();this.searchID='';this.sO=null;}
function getSrchO(ia,pp,so,st,pc,at1,av1,at2,av2,at3,av3,at4,av4,stt,sflags){var obj=new SearchO();obj.ia=ia;obj.pp=pp;obj.so=so;obj.st=st;obj.pc=pc;obj.at1=at1;obj.av1=av1;obj.at2=at2;obj.av2=av2;obj.at3=at3;obj.av3=av3;obj.at4=at4;obj.av4=av4;obj.sflags=sflags;obj.stt=stt;obj.searchID=''+ia+pp+so+st+pc+at1+at2+at3+at4+av1+av2+av3+av4+stt+sflags;return obj;}
function cpySrchO(sO){return getSrchO(sO.ia,sO.pp,sO.so,sO.st,sO.pc,sO.at1,sO.av1,sO.at2,sO.av2,sO.at3,sO.av3,sO.at4,sO.av4,sO.stt,sO.sflags);}
function getLA(sO){if(lAs==null){lAs=new Array();return null;}for(var i=0;i<lAs.length;++i){if((lAs[i]!=null)&&(lAs[i].searchID==sO.searchID))return lAs[i];}return null;}
function getLAPg(lA,pageNumber){if(lA!=null&&lA.pages!=null&&lA.pages[pageNumber]!=null)return lA.pages[pageNumber];return null;}
function showPage(pG){pnHideWait();curLoad=null;var sr=document.getElementById('searchres');var padB=document.getElementById('padB');var padT=document.getElementById('padT');if(sr!=null){sr.innerHTML='';sr.innerHTML=pG.html;scroll(0,0);}
if(padB!=null){padB.innerHTML='';padB.innerHTML=pG.padB;}
if(padT!=null){padT.innerHTML='';padT.innerHTML=pG.padT;}
document.body.style.cursor='auto';var i=document.getElementById('phhc');if(i!=null)i.style.visibility='hidden';window.status='Done';if(typeof clearX=='function'){clearX();initX();}
document.getElementById('navt').value=1;plPG=pG;setTimeout('preloadNextPage(plPG)',300);ab5();}
function pnShowWait()
{if(typeof fW!='undefined'&&document.getElementById('hhIc')!=null){if(fW!=null){fW.hide();fW=null}
fW=new fWait('hhIc',bu+'img/hourglass.gif','Please Wait...','Please wait while more products are loaded...',55,500);fW.show();}}
function pnHideWait()
{if(typeof fW!='undefined'&&document.getElementById('hhIc')!=null){if(fW!=null){fW.hide();fW=null}}}
function PageNav(ia,pp,pn,so,st,pc,at1,av1,at2,av2,at3,av3,at4,av4,stt,sflags,noshow)
{var i2=document.getElementById('phhc');if(i2!=null&&(noshow==null||noshow==0)){i2.src=imghg.src;i2.style.visibility='visible';}
if(noshow==null||noshow==0)document.body.style.cursor='wait';var sr=document.getElementById('searchres');var sO=getSrchO(ia,pp,so,st,pc,at1,av1,at2,av2,at3,av3,at4,av4,stt,sflags);if(curLoad==null)curLoad=new CurLoadO();if(noshow==null||noshow==0){curLoad.searchID=sO.searchID;curLoad.pageNumber=pn;}
var lA=getLA(sO);if(lA==null){lA=new LoadAttempt();lA.searchID=sO.searchID;lA.sO=sO;lA.pages=new Array();lAs[lAs.length]=lA;}
var pG=getLAPg(lA,pn);if(pG==null){if(noshow==null||noshow==0)pnShowWait();pG=new PageO();pG.status=0;pG.html=null;pG.lA=lA;pG.pageNumber=pn;lA.pages[pn]=pG;}
if(pG.status==3){showPage(pG);return;}
if(noshow==null||noshow==0)pnShowWait();if(pG.status!=0)return;navRes(pG);}
function navRes(pG){ldBsy=1;var sO=pG.lA.sO;pG.status=1;ASP.products_aspx.NavigateResults(sO.ia,sO.pp,pG.pageNumber,sO.so,sO.st,sO.pc,document.getElementById('navt').value,sO.at1,sO.av1,sO.at2,sO.av2,sO.at3,sO.av3,sO.at4,sO.av4,sO.stt,sO.sflags,navResDone,pG);}
function killPG(pG){if(pG!=null)pG.lA.pages[pG.pageNumber]=null;}
function navResDone(result,pG){ldBsy=0;if(result.error){killPG(pG);return;}if(!result.value){killPG(pG);return;}
pG.html=result.value.Tables.cont.Rows[0].cont;pG.padB=result.value.Tables.cont.Rows[0].padB;pG.padT=result.value.Tables.cont.Rows[0].padT;var pLoads=new Array();for(var i=0;i<result.value.Tables.preloads.Rows.length;++i){pLoads.push(result.value.Tables.preloads.Rows[i].url);};pG.status=2;var pl=new ImagePreloader(pLoads,navPreloaded,pG);}
function navPreloaded(pG)
{if(pG==null)return;if(pG.lA==null)return;pG.status=3;if(curLoad!=null){if(pG.lA.searchID==curLoad.searchID&&pG.pageNumber==curLoad.pageNumber){showPage(pG);}}}
function preloadNextPage(pG)
{plPG=pG;if(ldBsy==1){setTimeout('preloadNextPage(plPG)',1000)}else{var pGNext=getLAPg(pG.lA,pG.pageNumber+1);if(pGNext!=null)return;pGNext=new PageO();pGNext.status=0;pGNext.html=null;pGNext.lA=pG.lA;pGNext.pageNumber=pG.pageNumber+1;pG.lA.pages[pGNext.pageNumber]=pGNext;navRes(pGNext);}}