slide=0; function sortObjects(){ result=[]; r=0; fos=f.object.selectedIndex; fcs=f.country.selectedIndex; fds=f.designer.selectedIndex; req=(fos?1:0)+(fcs?1:0)+(fds?1:0); for(i in data){ res=0; if(fos>0&&data[i][2]==f.object.options[fos].text)res++; if(fcs>0&&data[i][3]==f.country.options[fcs].text)res++; if(fds>0&&data[i][4]==f.designer.options[fds].text)res++; if(req==res)result[r++]=i; }; showResult(newPage?newPage:1); }; function showResult(pg){ showDIV(get("Aviewall"),result.length<50); showDIV(get("Aprevpage"),result.length>9); showDIV(get("Anextpage"),result.length>9); showDIV(get("DIVresult"),!result.length); if(!result.length)get("DIVresult").innerHTML="There are no results to match your selection. Please try again, or click View All Objects."; show=pg*9-9; newPage=0; if(show>=0 && show<=result.length){ page=parseInt(pg); for(p=0;p<9;p++){ if(result[show+p]){ curr=data[result[show+p]]; lis[p].style.backgroundImage="url(imgs/item_"+curr[1]+".jpg)"; la=lis[p].getElementsByTagName("a")[0]; la.innerHTML=curr[0]; la.title=la.innerHTML; la.href="objects_"+result[show+p]+".html"; la.onclick=menu2; la.onfocus=blurit; showDIV(lis[p],1); }else showDIV(lis[p],0); }}; if(slide)dCont.slider.go(-1); }; function viewAll(){ f.reset(); r=0; fos=fcs=fds=0; for(i in data)result[r++]=i; if(bw.cookies)deleteCookie('ObjectSearch'); showResult(1); showDIV(get("Aviewall"),0); }; function deCode(ar){ return ar.replace(/&amp;/,"&").replace(/&#x11B;/,"ě").replace(/&#xE9;/,"é").replace(/&#x2019;/,"’"); }; if(bw.loc[1]=="object_search"){ init2=function(){ vars={"object":[],"country":[],"designer":[]}; vars2={"object":[],"country":[],"designer":[]}; f=document.forms[0]; r=0; gall=get("DIVgallery2"); lis=[]; result=[]; for(i in data){ data[i][2]=deCode(data[i][2]); data[i][3]=deCode(data[i][3]); data[i][4]=deCode(data[i][4]); vars["object"][data[i][2]]=1; vars["country"][data[i][3]]=1; vars["designer"][data[i][4]]=1; result[r++]=i; }; for(k in vars){ l=0; for(i in vars[k])vars2[k][l++]=i; vars2[k].sort(); fel=f[k]; fel.onchange=sortObjects; }; if(gall.firstChild)gall.removeChild(gall.firstChild); for(i=0;i<9;i++){ lia=make("a"); lis[i]=make("li"); lis[i].appendChild(lia); gall.appendChild(lis[i]); }; newPage=0; if(bw.cookies&&getCookie("ObjectSearch")){ vars=getCookie("ObjectSearch").split("|"); f.object.selectedIndex=vars[0]; f.country.selectedIndex=vars[1]; f.designer.selectedIndex=vars[2]; newPage=vars[3]; sortObjects(); }else viewAll(1); slide=1; }}else if(bw.cookies)document.write('<style type="text/css">#Abacksearch{visibility:visible}</style>'); function menu2(){ switch(this.id){ case "Aprevpage": showResult(page-1); break; case "Anextpage": showResult(page+1); break; case "Aviewall": viewAll(); break; }; if(this.id)return false; else if(bw.cookies)setCookie('ObjectSearch',fos+"|"+fcs+"|"+fds+"|"+page,'Wednesday,21-Oct-08 16:14:21 GMT'); }

