主体函数:
function RelReset(strStart)
{
NavRow(0).style.display="none";
NavRow(1).style.display="none";
ErrorMsgOpSys.innerText=""; // init to no errors
ErrorMsgKeywords.innerText=""; // init to no errors
if (OpSysList.value=="0") // ensure the OS has been selected
{
ErrorMsgOpSys.innerText="Please select an Operating System";
return;
}
// persist search values
ShowValue.value = getRadioValue("ShowMeList");
OpSysValue.value = OpSysList.value;
PrevNextValue.value = strStart;
if (strStart=="") iPage=0;
var strPageFrom = iPage.toString();
var strPageTo = (strStart.indexOf("-")==0)?(iPage-1).toString()
iPage+1).toString();
var strPage = strPageFrom+"-"+strPageTo;
if (CellProduct.style.display=="")
{
SearchMethod.value = "Product";
SearchValue.value = ProductList.value;
ListTitle.innerText= SortedListTitle() + " -- " + ProductList.options(ProductList.selectedIndex).text+" -- "+OpSysList.options(OpSysList.selectedIndex).text;
relsrc.DataURL = "SrcRel.asp?ReleaseID=0&LangID=20&LangDIR=en-us&OpSysID="+OpSysList.value+"&Search=Product&Value="+ProductList.value+"&Show="+getRadioValue("ShowMeList") +"&Start="+strStart+"&Page="+strPage+"&AddLangID="+AddLangID.value+"&StartDate="+SelectArchive.options(SelectArchive.options.selectedIndex).StartDate+"&EndDate="+SelectArchive.options(SelectArchive.options.selectedIndex).EndDate;
if (strStart=="") countsrc.DataURL = "SrcRel.asp?ReleaseID=0&LangID=20&LangDIR=en-us&OpSysID="+OpSysList.value+"&Search=Product&Value="+ProductList.value+"&Show="+getRadioValue("ShowMeList") +"&Start="+strStart+"&Page="+strPage+"&AddLangID="+AddLangID.value+"&Count=1"+"&StartDate="+SelectArchive.options(SelectArchive.options.selectedIndex).StartDate+"&EndDate="+SelectArchive.options(SelectArchive.options.selectedIndex).EndDate;
}
else if (CellCategory.style.display=="")
{
SearchMethod.value = "Category";
SearchValue.value = CategoryList.value;
ListTitle.innerText= SortedListTitle() + " -- " + CategoryList.options(CategoryList.selectedIndex).text+" -- "+OpSysList.options(OpSysList.selectedIndex).text;
relsrc.DataURL = "SrcRel.asp?ReleaseID=0&LangID=20&LangDIR=en-us&OpSysID="+OpSysList.value+"&Search=Category&Value="+CategoryList.value+"&Show="+getRadioValue("ShowMeList") +"&Start="+strStart+"&Page="+strPage+"&AddLangID="+AddLangID.value+"&StartDate="+SelectArchive.options(SelectArchive.options.selectedIndex).StartDate+"&EndDate="+SelectArchive.options(SelectArchive.options.selectedIndex).EndDate;
if (strStart=="") countsrc.DataURL = "SrcRel.asp?ReleaseID=0&LangID=20&LangDIR=en-us&OpSysID="+OpSysList.value+"&Search=Category&Value="+CategoryList.value+"&Show="+getRadioValue("ShowMeList") +"&Start="+strStart+"&Page="+strPage+"&AddLangID="+AddLangID.value+"&Count=1"+"&StartDate="+SelectArchive.options(SelectArchive.options.selectedIndex).StartDate+"&EndDate="+SelectArchive.options(SelectArchive.options.selectedIndex).EndDate;
}
else
{
if (VBTrim(Keywords.value)=="")
{
ErrorMsgKeywords.innerText="Please enter keywords";
return;
}
else
{
SearchMethod.value = "Keywords";
SearchValue.value = Keywords.value;
ListTitle.innerText= SortedListTitle() + " -- '" + Keywords.value + "' -- "+OpSysList.options(OpSysList.selectedIndex).text;
relsrc.DataURL = "SrcRel.asp?ReleaseID=0&LangID=20&LangDIR=en-us&OpSysID="+OpSysList.value+"&Search=Keywords&Value="+Keywords.value+"&Show="+getRadioValue("ShowMeList") +"&Start="+strStart+"&Page="+strPage+"&AddLangID="+AddLangID.value+"&StartDate="+SelectArchive.options(SelectArchive.options.selectedIndex).StartDate+"&EndDate="+SelectArchive.options(SelectArchive.options.selectedIndex).EndDate;
if (strStart=="") countsrc.DataURL = "SrcRel.asp?ReleaseID=0&LangID=20&LangDIR=en-us&OpSysID="+OpSysList.value+"&Search=Keywords&Value="+Keywords.value+"&Show="+getRadioValue("ShowMeList") +"&Start="+strStart+"&Page="+strPage+"&AddLangID="+AddLangID.value+"&Count=1"+"&StartDate="+SelectArchive.options(SelectArchive.options.selectedIndex).StartDate+"&EndDate="+SelectArchive.options(SelectArchive.options.selectedIndex).EndDate;
}
}
relsrc.reset();
countsrc.reset();
iPage = (strStart.indexOf("-")==0)?iPage-1:iPage+1;
}