} else{ return true; } } function GoAdvSearch() { window.location.href = 'http://buy.yahoo.com.tw/gdsale/gdsearch.aspx?adv=notbk&hpp=r2b&z=' + zno + '&subno=' + subno; } document.form2.z.value=zno; document.form2.subno.value=subno; if(zno>0 || subno>0) { var linkurl=document.getElementById("searchlink"); if(linkurl) { var form2url=linkurl.href; form2url=replaceArg(form2url,"z",zno,"true"); form2url=replaceArg(form2url,"subno",subno,"true"); linkurl.href=form2url; } } function replaceArg(fullurl, source, target, cutrepeat) { var returl=fullurl; var fi=returl.indexOf(source); var fe=returl.indexOf("&",fi); var nextfi=0; var nextfe=0; var nextfe2=0; var findfit=false; nextfi=fi; for(;nextfi>0;) { if(!((returl.substring(nextfi-1,nextfi) =="&" || returl.substring(nextfi-1,nextfi) =="?") && returl.substring(nextfi+source.length,nextfi+source.length+1) =="=")) { } else { nextfe2=returl.indexOf("&",nextfi); if(!findfit) { if(nextfe2>0) { returl=returl.substring(0,nextfi)+source+"="+target+"&"+returl.substring(nextfe2+1,returl.length); } else { returl=returl.substring(0,nextfi)+source+"="+target; } } else { nextfi=returl.indexOf(source,nextfi+source.length); if(nextfi>0) { nextfe2=returl.indexOf("&",nextfi); if(cutrepeat) { if(nextfe2>0) { returl=returl.substring(0,nextfi)+returl.substring(nextfe2+1,returl.length); } else { returl=returl.substring(0,nextfi); } } } } findfit=true; } nextfi=returl.indexOf(source,nextfi+source.length); } return returl; }

留言列表

發表留言