var tgt; var curstartpos = 0; var currendpos = 0; var thdir = 'th170'; function setSearch(f, retainCurrent, doSubmit){ tgt = document.mainsearchform; // check of advanced formulier wel werkt bestaat om js filter te kunnen uitvoeren if (typeof(document.advancedsearchform) != 'undefined') { } // add useCountryFilerInSearch try{ var val = f.imagecountryFilter.options[f.imagecountryFilter.selectedIndex].value; if (val != ''){ val = 'smsx_country_' + val; addCriteriaXtra(val); } } catch (e){ } //get criteria if(!setCriteria(f, retainCurrent)) return false; //get imagetype and budget if(!setImagetype(f, retainCurrent)) return false; //get orientations if(!setOrienations(f, retainCurrent)) return false; //get colortypes if(!setColortype(f, retainCurrent)) return false; //get brandfilter if(!setBrandfilter(f, retainCurrent)) return false; //get vehiclefilter if used if(!setVehicles(f, retainCurrent)) return false; //get contributor if(!setContributor(f, retainCurrent)) return false; //get people filter if used if(!setPeoplefilter(f, retainCurrent)) return false; //get datefrom if used if(!setDatefrom(f, retainCurrent)) return false; //get startpos, maxrows if(!setPositions(f, retainCurrent)) return false; //get advancedsearch open/close if(!setAdvancedSearch(f, retainCurrent)) return false; //check if searchform should pass tab-information setActivetab(f, retainCurrent); //set search form action to be SEO friendly search setSrcFrmAction(tgt); //set sorting if needed setSorttype(f, retainCurrent); //handle extra hidden criteria if needed if(typeof(local_setSearch)=='function'){ localret = local_setSearch(f, retainCurrent); if(!localret){ return false; } } //submit the search if(doSubmit!=0){ if(tgt.action.indexOf('#')==-1){ actionStartpos = tgt.startpos.value - 1; tgt.action = tgt.action + '#s' + actionStartpos; } if(tgt.criteriaAll.value!='' || tgt.vehicle_brand.value!=''){ tgt.submit(); } } return false; } function setCriteria(f, retainCurrent){ //find if search is new, or in results nwsearch = 1; if(typeof(f.newinresRad) != 'undefined'){// there is a radiobuttno for new search / search in results. value 1 is inres, 0 is new for(x=0; x 1){//comma separated value for imagetype,budguet str = thetp.split(',')[1].toLowerCase(); if(str=='rf' || str=='rm' || str=='ed'){//list is simply like RF,RM. Do not use budget tp = thetp; } else{ tp = thetp.split(',')[0]; bud = thetp.split(',')[1]; } } else{ tp = thetp; } } else if(typeof(f.imagetype) != 'undefined'){//work with a hidden field, just copy value thetp = f.imagetype.value; numbers = '0123456789'; if(thetp.split(',').length > 1 && numbers.indexOf(thetp.split(',')[1])!=-1){//comma separated value for imagetype,budguet tp = thetp.split(',')[0]; bud = thetp.split(',')[1]; } else{ tp = thetp; } } else if(retainCurrent==1){ tp = tgt.imagetypeCur.value; bud = tgt.budgetimagesCur.value; } if(bud==2 && tp==''){ tp = 'RF'; bud = 2; } else if(bud==2 && tp.indexOf('RF')==-1){ bud = 0; } if(tp==''){ tp = 'RF,fonts'; } if(tp.substring(tp.length-1)==','){//remove comma at the end if it's there tp = tp.substring(0, tp.length-1); } tgt.imagetype.value = tp; tgt.budgetimages.value = bud; tgt.criteriaXtraNot.value = ''; if (tp == 'RF'){ var xn = ''; if (tp != 'PhotosOnly_RF'){ xn = xn + 'PhotosOnly_RF,'; } if (tp != 'Fonts'){ xn = xn + 'Fonts,'; } if (tp != 'Vector'){ xn = xn + 'Vector,'; } if (tp != 'video'){ xn = xn + 'video,'; } tgt.criteriaXtraNot.value = xn; } } return true; } function setOrienations(f, retainCurrent){ if(typeof(f.imageOrient_PChk) != 'undefined'){ tgt.imageOrient_P.value = f.imageOrient_PChk.checked?1:0; } else{ tgt.imageOrient_P.value = retainCurrent?tgt.imageOrient_PCur.value:1; } if(typeof(f.imageOrient_LChk) != 'undefined'){ tgt.imageOrient_L.value = f.imageOrient_LChk.checked?1:0; } else{ tgt.imageOrient_L.value = retainCurrent?tgt.imageOrient_LCur.value:1; } if(typeof(f.imageOrient_SChk) != 'undefined'){ tgt.imageOrient_S.value = f.imageOrient_SChk.checked?1:0; } else{ tgt.imageOrient_S.value = retainCurrent?tgt.imageOrient_SCur.value:1; } return true; } function setColortype(f, retainCurrent){ if(typeof(f.imagecolor_CChk) != 'undefined'){ tgt.imagecolor_C.value = f.imagecolor_CChk.checked?1:0; } else{ tgt.imagecolor_C.value = retainCurrent?tgt.imagecolor_CCur.value:1; } if(typeof(f.imagecolor_BWChk) != 'undefined'){ tgt.imagecolor_BW.value = f.imagecolor_BWChk.checked?1:0; } else{ tgt.imagecolor_BW.value = retainCurrent?tgt.imagecolor_BWCur.value:1; } return true; } function setBrandfilter(f, retainCurrent){ br = ''; if(typeof(f.brandlistMSel) != 'undefined'){//use a multiple selectbox for the brands allfound = 1; for(x=0; x