/***************************************************************/
/* Make year options and add them to the year select control   */
/***************************************************************/
function NetFind_getYears()
{
 var s=document.all(this.Year),
     d=new Date(),
     y;
 for (y=d.getYear(); y>=this.StartYear; y--)
  {
   var op=document.createElement("OPTION");
   s.options.add(op);
   op.innerText=y;
   op.value=y;
  }
}
/****************************************************************/
/* Go website which domain name has been selected by sel        */
/****************************************************************/
function NetFind_goSelected(sel)
{
 var idx=sel.selectedIndex,
     val=sel.options[idx].value;
 if (val!="") window.open(val,"","");
 sel.selectedIndex=0;
}
/****************************************************************/
/* Find informations which title includes the keywords          */
/****************************************************************/
function NetFind_findTitle(p)
{
 var top=this.Topic==null ? "" : "&TOP="+document.all(this.Topic).value;
 document.forms[0].action=p+"?TTL="+encodeURI(document.all(this.Kwds).value)+top+
                            "&NAME=%e6%a0%8f%e7%9b%ae%e5%86%85%e6%90%9c%e7%b4%a2";
 document.forms[0].submit();
 event.returnValue=false;
}
/*****************************************************************/
/* Find informations which text or title includes the keywords   */
/*****************************************************************/
function NetFind_findText(p)
{
 var top=this.Topic==null ? "" : "&TOP="+document.all(this.Topic).value;
 document.forms[0].action=p+"?TXT="+encodeURI(document.all(this.Kwds).value)+top+
                            "&NAME=%e6%a0%8f%e7%9b%ae%e5%86%85%e6%90%9c%e7%b4%a2";
 document.forms[0].submit();
 event.returnValue=false;
}
/*****************************************************************/
/* Find informations which date is selected by the date controls */
/*****************************************************************/
function NetFind_findDate(p)
{
 var top=this.Topic==null ? "" : "&TOP="+document.all(this.Topic).value,
     date=document.all(this.Year).options[document.all(this.Year).selectedIndex].value;
 if (this.Month!=null) date+=document.all(this.Month).options[document.all(this.Month).selectedIndex].value;
 if (this.Day!=null) date+=document.all(this.Day).options[document.all(this.Day).selectedIndex].value;
 document.forms[0].action=p+"?DATE="+date+top;
 document.forms[0].submit();
 event.returnValue=false;
}
function NetFind(t,k,y,m,d,sy)
{
 this.Topic=t;
 this.Kwds=k;
 this.Year=y;
 this.Month=m;
 this.Day=d;
 this.StartYear=sy;
 this.getYears=NetFind_getYears;
 this.goSelected=NetFind_goSelected;
 this.findTitle=NetFind_findTitle;
 this.findText=NetFind_findText;
 this.findDate=NetFind_findDate;
}
