/**
 * 标题：浙江国税网站 WAS模板公用函数
 * 作者：神州数码（中国）(www.digitalchina.com)
 * 部门：技术工程部
 * 撰写：胡龙周
 * 日期：2002.12.18
 * 神州数码公司版权所有(All Copyright Reserved).
**/

//跳转到细览页面    2002-12-18
function goDoc(pubUrl) 
{
  var s = pubUrl;
  window.location=pubUrl;
}

//按全文检索信息  胡龙周 2002-12-18
function searchNewsByKeyword()
{
	var QwjsString = document.all.SearchNewsByKeywordForm.inputword.value;
	QwjsString=replaceTRSOperator(QwjsString);
	QwjsString="%"+QwjsString+"%";
	document.all.SearchNewsByKeywordForm.searchword.value = QwjsString;
	document.all.SearchNewsByKeywordForm.method = "post";
	document.all.SearchNewsByKeywordForm.action = "/was40/search";
	document.all.SearchNewsByKeywordForm.submit();	
}

//替换所有TRS特殊符号  胡龙周 2003-01-07
function replaceTRSOperator(InputString)
{
	   var OutString = "";
	   var MiddleString = "";
	   for (i=0;i<InputString.length;i++) 
          {
		MiddleString = InputString.substring(i,i+1);
		if (MiddleString=="[") {
		   OutString=OutString+"\\[";
		}
		else if(MiddleString=="]")
		{
		   OutString=OutString+"\\]";
		}
		else if(MiddleString=="(")
		{
		  OutString=OutString+"\\(";
		}else if(MiddleString==")")
		{
		  OutString=OutString+"\\)";
		}
		else if(MiddleString==",")
		{
		  OutString=OutString+"\\,";
		}
		else if(MiddleString=="/")
		{
		  OutString=OutString+"\\/";
		}
		else if(MiddleString=="@")
		{
		  OutString=OutString+"\\@";
		}
		else if(MiddleString=="=")
		{
		  OutString=OutString+"\\=";
		}
		else if(MiddleString==">")
		{
		  OutString=OutString+"\\>";
		}
		else if(MiddleString=="<")
		{
		  OutString=OutString+"\\<";
		}
		else if(MiddleString=="!")
		{
		  OutString=OutString+"\\!";
		}
		
		else if(MiddleString=="&")
	        {
		  OutString=OutString+"\\&";
		}
		else if(MiddleString=="*")
		{
		  OutString=OutString+"\\*";
		}
		else if(MiddleString=="^")
		{
		  OutString=OutString+"\\^";
		}
		else if(MiddleString=="-")
		{
		  OutString=OutString+"\\-";
		}
		else if(MiddleString=="+")
		{
		  OutString=OutString+"\\+";
		}
		else 
		{
		    OutString=OutString+MiddleString;
		}
	}
	return OutString;
}

//栏目简单检索函数   胡龙周 2003-01-07
function searchJdjsFirst()
{
      SQLJdjsFirst="";
      v="";
      if (document.all.SearchJdjsByTimeTitleForm1.title) {
	      v=trim(document.all.SearchJdjsByTimeTitleForm1.title.value);
	      if(v!=""){ 
	          if (SQLJdjsFirst!="") {SQLJdjsFirst = SQLJdjsFirst+" and "}
	          SQLJdjsFirst=SQLJdjsFirst + "docTitle='%"+v+"%'";
	      }
      }
     if (document.all.SearchJdjsByTimeTitleForm1.content) {
        v=trim(document.all.SearchJdjsByTimeTitleForm1.content.value);
        if (v!=""){
          if (SQLJdjsFirst!="") {SQLJdjsFirst = SQLJdjsFirst+" and "}
          SQLJdjsFirst=SQLJdjsFirst + "docContent='%"+v+"%'";
        }
      }
     if (document.all.SearchJdjsByTimeTitleForm1.QuestionKeyWord) {
        v=trim(document.all.SearchJdjsByTimeTitleForm1.QuestionKeyWord.value);
        if (v!=""){
          if (SQLJdjsFirst!="") {SQLJdjsFirst = SQLJdjsFirst+" and "}
          SQLJdjsFirst=SQLJdjsFirst + "docAbstract='%"+v+"%'";
        }
      }
     if (document.all.SearchJdjsByTimeTitleForm1.AskManName) {
        v=trim(document.all.SearchJdjsByTimeTitleForm1.AskManName.value);
        if (v!=""){
          if (SQLJdjsFirst!="") {SQLJdjsFirst = SQLJdjsFirst+" and "}
          SQLJdjsFirst=SQLJdjsFirst + "docAuthor='%"+v+"%'";
        }
      }
      document.all.SearchJdjsByTimeTitleForm1.searchword.value =SQLJdjsFirst;
      return true;
}


//栏目高级检索函数 胡龙周 2003-01-08
function searchGjjs() 
{
      SQLGjjs="";
      v="";
      ra="";
      if (document.all.SearchGjjsByTimeTitleForm.relation)
      {
         ra=" "+document.all.SearchGjjsByTimeTitleForm.relation.options[document.all.SearchGjjsByTimeTitleForm.relation.selectedIndex].value+" ";
      }
      if (document.all.SearchGjjsByTimeTitleForm.title) {
	      v=trim(document.all.SearchGjjsByTimeTitleForm.title.value);
	      if(v!=""){ 
	          if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
	          SQLGjjs=SQLGjjs + "docTitle='%"+v+"%'";
	      }
      }
     if (document.all.SearchGjjsByTimeTitleForm.content) {
        v=trim(document.all.SearchGjjsByTimeTitleForm.content.value);
        if (v!=""){
          if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
          SQLGjjs=SQLGjjs + "docContent='%"+v+"%'";
        }
      }
      if (document.all.SearchGjjsByTimeTitleForm.lmmc) {
        v=trim(document.all.SearchGjjsByTimeTitleForm.lmmc.options[document.all.SearchGjjsByTimeTitleForm.lmmc.selectedIndex].value);
        if (v!=""){
           if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
           SQLGjjs=SQLGjjs + "IP_ITEMDESC='"+v+"'";
        }
      }
      
      if (document.all.SearchGjjsByTimeTitleForm.QuestionKeyWord) {
        v=trim(document.all.SearchGjjsByTimeTitleForm.QuestionKeyWord.value);
        if (v!=""){
          if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
          SQLGjjs=SQLGjjs + "docAbstract='%"+v+"%'";
        }
      }
     
     if (document.all.SearchGjjsByTimeTitleForm.wtbh) {
             v=trim(document.all.SearchGjjsByTimeTitleForm.wtbh.value);
             if (v!=""){
               if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
               SQLGjjs=SQLGjjs + "fid='"+v+"'";
             }
      }
      
      if (document.all.SearchGjjsByTimeTitleForm.wtxs) {
                   v=trim(document.all.SearchGjjsByTimeTitleForm.wtxs.value);
                   if (v!=""){
                     if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
                     SQLGjjs=SQLGjjs + "docAbstract='%"+v+"%'";
                   }
      }
      
      if (document.all.SearchGjjsByTimeTitleForm.AskManName) {
              v=trim(document.all.SearchGjjsByTimeTitleForm.AskManName.value);
              if (v!=""){
                if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
                SQLGjjs=SQLGjjs + "docAuthor='%"+v+"%'";
              }
      }
      
      if (document.all.SearchGjjsByTimeTitleForm.sfzxlmmc) {
              v=trim(document.all.SearchGjjsByTimeTitleForm.sfzxlmmc.options[document.all.SearchGjjsByTimeTitleForm.sfzxlmmc.selectedIndex].value);
              if (v!=""){
                if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
                SQLGjjs=SQLGjjs + "docKeywords='%"+v+"%'";
              }
      }
      
      var NewsYear,NewsMonth,NewsDate,SQLDate;	//注意Date.getDate()得到当前日期而Date.getDay()得到的是星期几
      var today = new Date();	
            
         NewsYear = document.all.NewsYear.options[document.all.NewsYear.selectedIndex].value;
      if (NewsYear == null || NewsYear.length==0)
         NewsYear = today.getYear();
            	
      NewsMonth = document.all.NewsMonth.options[document.all.NewsMonth.selectedIndex].value;
      if (NewsMonth == null || NewsMonth.length==0)
         NewsMonth = today.getMonth();
            	
         NewsDate = document.all.NewsDate.options[document.all.NewsDate.selectedIndex].value;
      if (NewsDate == null || NewsDate.length==0)
         NewsDate = today.getDate();
      SQLDate=NewsYear+"-"+NewsMonth+"-"+NewsDate;  
      if (document.all.SearchGjjsByTimeTitleForm.wtxs) {
          v=trim(document.all.SearchGjjsByTimeTitleForm.wtxs.value);
          if (v!=""){
          if (SQLGjjs!="") {SQLGjjs = SQLGjjs+ra}
          SQLGjjs=SQLGjjs + "docAbstract='%"+v+"%'";
          }
      }
      
      
      if (SQLGjjs!="")
      {
         SQLGjjs=SQLGjjs +ra+"docDate='"+SQLDate+"'";
      }
      else
      {
         SQLGjjs="docDate='"+SQLDate+"'";
      }
      document.all.SearchGjjsByTimeTitleForm.searchword.value =SQLGjjs;
      return true; 
}

//删除输入表单的空格 Begin the "trim" function 2002-12-18
function trim(inputString) {
   // Removes leading and trailing spaces from the passed string. Also removes
   // consecutive spaces and replaces it with one space. If something besides
   // a string is passed in (null, custom object, etc.) then return the input.
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") { // Check for spaces at the beginning of the string
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") { // Check for spaces at the end of the string
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) { // Note that there are two spaces in the string - look for multiple spaces within the string
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); // Again, there are two spaces in each of the strings
   }
   return retValue; // Return the trimmed string back to the user
} 
// Ends the "trim" function

//组合检索的提交函数
function FieldSearchForm_onsubmit() {
	var BeginDate,EndDate,SQLDate,SQLTitle,SQLContent,SQL,Relation;

	var BeginYear=document.FieldSearchForm.BeginYear.options[document.FieldSearchForm.BeginYear.selectedIndex].value;
	var BeginMonth=document.FieldSearchForm.BeginMonth.options[document.FieldSearchForm.BeginMonth.selectedIndex].value;
	var BeginDay=document.FieldSearchForm.BeginDay.options[document.FieldSearchForm.BeginDay.selectedIndex].value;
	var EndYear=document.FieldSearchForm.EndYear.options[document.FieldSearchForm.EndYear.selectedIndex].value;
	var EndMonth=document.FieldSearchForm.EndMonth.options[document.FieldSearchForm.EndMonth.selectedIndex].value;
	var EndDay=document.FieldSearchForm.EndDay.options[document.FieldSearchForm.EndDay.selectedIndex].value;
	

	BeginDate=EndDate=SQLDate=SQLTitle=SQLContent=SQL=Relation="";
	
	if(document.FieldSearchForm.Relation[0].selected==true)
		Relation=" AND ";
	else
		Relation=" OR ";
	
	//alert(Relation);
	if(BeginYear!="")
	{
		if(BeginMonth!="")
		{
			if(BeginDay!="")
				BeginDate="'" + BeginYear + "/" + BeginMonth + "/" + BeginDay + "'";  
			else
				BeginDate="'" + BeginYear + "/" + BeginMonth + "'";  						
		}
		else
			BeginDate="'"+ BeginYear + "'"; 
	 }
	if(EndYear!="")
	{
		if(EndMonth!="")
		{
			if(EndDay!="")
				EndDate="'" + EndYear + "/" + EndMonth + "/" + EndDay + "'";  
			else
				EndDate="'" + EndYear + "/" + EndMonth + "'";  						
		}
		else
			EndDate="'" + EndYear + "'"; 
	}
	if(BeginDate!=""&&EndDate!="")
		SQLDate="docRelTime>=" + BeginDate + " AND docRelTime<=" + EndDate + Relation;
	if(BeginDate==""&&EndDate!="")
		SQLDate="docRelTime=" + EndDate + Relation;
	if(BeginDate!=""&&EndDate=="")
		SQLDate="docRelTime=" + BeginDate + Relation;
	
	
	var keyword;
	var aArray;
	var keywords = "";
	var i = 0;
	//alert(trim(document.FieldSearchForm.Title.value));
	if(trim(document.FieldSearchForm.Title.value)!="")
	{	  
	  //alert("ok");
	  keyword = trim(document.FieldSearchForm.Title.value);
	  aArray = keyword.split(" ");	  
	  while (i<aArray.length)
	  {
	    
	    if (aArray[i]!==null && aArray[i]!="")
	    {
	      if (i==0)	      
	        keywords = keywords + " docTitle='%" +aArray[i]+ "%'  ";	      
	      else
	        keywords = keywords + " and docTitle='%" +aArray[i]+ "%'  ";
	    }
	    i = i+1;
	  }
	  //alert(aArray.toString());   
	  SQLTitle = keywords + Relation;
	}
	
	//alert(SQLTitle);
	keyword = "";
	keywords = "";
	i = 0;
	if(trim(document.FieldSearchForm.Content.value)!="")
	{
          keyword = trim(document.FieldSearchForm.Content.value);
	  aArray = keyword.split(" ");
	  while (i<aArray.length)
	  {
	    
	    if (aArray[i]!==null && aArray[i]!="")
	    {
	      if (i==0)	      
	        keywords = keywords + " docContent='%" +aArray[i]+ "%'  ";	      
	      else
	        keywords = keywords + " and docContent='%" +aArray[i]+ "%'  ";
	    }
	    i = i+1;
	  }
          SQLContent = keywords + Relation;
	}
	
	SQL=SQLDate + SQLTitle + SQLContent;

	var Length=SQL.length;
	SQL=SQL.substring(0,Length-5);
        
        //SQL = SQL + sortfield
       //alert(SQL);
	document.FieldSearchForm.searchword.value=SQL;
	
	if(SQL=="")
	{
		alert("检索表达式不能为空!");
		return false;
	}
	return true;
}
//多语句查询函数
function MultiWordSearch_onsubmit() 
{
	var SQL="";
	var Word=document.MultiWordSearch.Word.value;
	var FindPression= new RegExp("  *","g");
	
	if(document.MultiWordSearch.Select.selectedIndex==1)
	{
		
		SQL=Word.replace(FindPression ," AND ");
	}
	if(document.MultiWordSearch.Select.selectedIndex==0)
	{
		
		SQL=Word.replace(FindPression, " OR ");
	}
	if(SQL=="")
	{
		alert("检索表达式不能为空!");
		return false;
	}
	else
	{
		document.MultiWordSearch.searchword.value=SQL;
		return true;
	}
}


//查询WAS频道函数
function searchWASinChannel()
{

	var s = "%"+trim(document.all.SearchForm.inputword.value)+"%";
	document.all.SearchForm.searchword.value = s;
	document.all.SearchForm.method = "post";
	document.all.SearchForm.action = "http://www.zjsat.gov.cn/was40/search";
	document.all.SearchForm.submit();
}

//检索某年、月、日信息
function searchNewsByTime()
{
	var NewsYear,NewsMonth,NewsDate;	//注意Date.getDate()得到当前日期而Date.getDay()得到的是星期几
	var today = new Date();	


	NewsYear = document.all.NewsYear.options[document.all.NewsYear.selectedIndex].value;
	if (NewsYear == null || NewsYear.length==0)
	  NewsYear = today.getYear();
	
	NewsMonth = document.all.NewsMonth.options[document.all.NewsMonth.selectedIndex].value;
	if (NewsMonth == null || NewsMonth.length==0)
	  NewsMonth = today.getMonth();
	
	NewsDate = document.all.NewsDate.options[document.all.NewsDate.selectedIndex].value;
	if (NewsDate == null || NewsDate.length==0)
	  NewsDate = today.getDate();
	
	document.all.SearchNewsByTimeForm.method = "post";
	document.all.SearchNewsByTimeForm.searchword.value = "DOCRELTIME='"+NewsYear+"."+NewsMonth+"."+NewsDate+"'";
	document.all.SearchNewsByTimeForm.action = "/was40/search";
    	document.all.SearchNewsByTimeForm.submit();
		
}

//打印当前详细日期，包括年月日星期。
function printCurDateDetail()
{
	
	
	var nowmonth,nowminutes;
	var today=new Date();

	nowmonth = today.getMonth()
	nowmonth = nowmonth+1
	nowminutes = today.getMinutes()

	var strmin=new String(nowminutes)

	document.write (today.getFullYear()+"年");
	document.write (nowmonth +"月");
	document.write (today.getDate()+"日 ");
	document.write (today.getHours()+":");

	if  (strmin.length == 1) {
		document.write ("0"+ today.getMinutes()+"&nbsp;&nbsp;");
	}else{
	  document.write (today.getMinutes()+"&nbsp;&nbsp;");
        }


        today=today.getDay()
        switch (today){
	case 0:
	document.write ("星期天")
	break;
	case 1:
	document.write ("星期一")
	break;
	case 2:
	document.write ("星期二")
	break;
	case 3:
	document.write ("星期三")
	break;
	case 4:
	document.write ("星期四")
	break;
	case 5:
	document.write ("星期五")
	break;
	case 6:
	document.write ("星期六")
	break;

        }
        
}


//输出年份的文本选择框，并设置默认值为当前年份
function putSelectYear()
{
  var thisyear ;
  var today = new Date();
  thisyear = today.getYear();	
  document.write("<SELECT name=NewsYear>");
  
  if (thisyear=="2002")
    document.write("<option value=2002 selected>2002</option>");
  else
    document.write("<option value=2002>2002</option>");
  
  if (thisyear=="2003")
    document.write("<option value=2003 selected>2003</option>");
  else
    document.write("<option value=2003>2003</option>");
  
  if (thisyear=="2004")
    document.write("<option value=2004 selected>2004</option>");
  else
    document.write("<option value=2004>2004</option>");
  
  if (thisyear=="2005")
    document.write("<option value=2005 selected>2005</option>");
  else
    document.write("<option value=2005>2005</option>");  
  
                        
  document.write("</SELECT>");
  
}

//输出月份的文本选择框，并设置默认值为当前月份
function putSelectMonth()
{
  var thismonth ;
  var today = new Date();
  thismonth = today.getMonth();		//thismonth值范围在0到11之间
  
  document.write("<SELECT name=NewsMonth>");
  

  if (thismonth=="0")	
    document.write("<option value=1 selected>01</option>");
  else
    document.write("<option value=1>01</option>");
  
  if (thismonth=="1")
    document.write("<option value=2 selected>02</option>");
  else
    document.write("<option value=2>02</option>");
  
  if (thismonth=="2")
    document.write("<option value=3 selected>03</option>");
  else
    document.write("<option value=3>03</option>");
  
  if (thismonth=="3")
    document.write("<option value=4 selected>04</option>");
  else
    document.write("<option value=4>04</option>"); 
    
  if (thismonth=="4")
    document.write("<option value=5 selected>05</option>");
  else
    document.write("<option value=5>05</option>");
  
  if (thismonth=="5")
    document.write("<option value=6 selected>06</option>");
  else
    document.write("<option value=6>06</option>"); 
  
  if (thismonth=="6")
    document.write("<option value=7 selected>07</option>");
  else
    document.write("<option value=7>07</option>"); 
  
  if (thismonth=="7")
    document.write("<option value=8 selected>08</option>");
  else
    document.write("<option value=8>08</option>"); 
  
  if (thismonth=="8")
    document.write("<option value=9 selected>09</option>");
  else
    document.write("<option value=9>09</option>"); 
  
  if (thismonth=="9")
    document.write("<option value=10 selected>10</option>");
  else
    document.write("<option value=10>10</option>"); 
  
  if (thismonth=="10")
    document.write("<option value=11 selected>11</option>");
  else
    document.write("<option value=11>11</option>"); 
  
  if (thismonth=="11")
    document.write("<option value=12 selected>12</option>");
  else
    document.write("<option value=12>12</option>"); 
  
                        
  document.write("</SELECT>");
  
}
//输出日期的文本选择框，并设置默认值为当前日期
function putSelectDate()	//注意Date.getDate()得到当前日期而Date.getDay()得到的是星期几
{
  var thisdate ;
  var today = new Date();
  thisdate = today.getDate();	
  document.write("<SELECT name=NewsDate>");
  
  if (thisdate=="1")
    document.write("<option value=1 selected>01</option>");
  else
    document.write("<option value=1>01</option>");
     
  if (thisdate=="2")
    document.write("<option value=2 selected>02</option>");
  else
    document.write("<option value=2>02</option>");
  
  if (thisdate=="3")
    document.write("<option value=3 selected>03</option>");
  else
    document.write("<option value=3>03</option>");
  
  if (thisdate=="4")
    document.write("<option value=4 selected>04</option>");
  else
    document.write("<option value=4>04</option>"); 
    
  if (thisdate=="5")
    document.write("<option value=5 selected>05</option>");
  else
    document.write("<option value=5>05</option>");
  
  if (thisdate=="6")
    document.write("<option value=6 selected>06</option>");
  else
    document.write("<option value=6>06</option>"); 
  
  if (thisdate=="7")
    document.write("<option value=7 selected>07</option>");
  else
    document.write("<option value=7>07</option>"); 
  
  if (thisdate=="8")
    document.write("<option value=8 selected>08</option>");
  else
    document.write("<option value=8>08</option>"); 
  
  if (thisdate=="9")
    document.write("<option value=9 selected>09</option>");
  else
    document.write("<option value=9>09</option>"); 
  
  if (thisdate=="10")
    document.write("<option value=10 selected>10</option>");
  else
    document.write("<option value=10>10</option>"); 
  
  if (thisdate=="11")
    document.write("<option value=11 selected>11</option>");
  else
    document.write("<option value=11>11</option>"); 
  
  if (thisdate=="12")
    document.write("<option value=12 selected>12</option>");
  else
    document.write("<option value=12>12</option>");
    
  if (thisdate=="13")
    document.write("<option value=13 selected>13</option>");
  else
    document.write("<option value=13>13</option>");
   
  if (thisdate=="14")
    document.write("<option value=14 selected>14</option>");
  else
    document.write("<option value=14>14</option>");

  if (thisdate=="15")
    document.write("<option value=15 selected>15</option>");
  else
    document.write("<option value=15>15</option>");
  
  if (thisdate=="16")
    document.write("<option value=16 selected>16</option>");
  else
    document.write("<option value=16>16</option>");
  
    if (thisdate=="17")
    document.write("<option value=17 selected>17</option>");
  else
    document.write("<option value=17>17</option>");

  if (thisdate=="18")
    document.write("<option value=18 selected>18</option>");
  else
    document.write("<option value=18>18</option>");
    
  if (thisdate=="19")
    document.write("<option value=19 selected>19</option>");
  else
    document.write("<option value=19>19</option>");
  
  if (thisdate=="20")
    document.write("<option value=20 selected>20</option>");
  else
    document.write("<option value=20>20</option>");
  
  if (thisdate=="21")
    document.write("<option value=21 selected>21</option>");
  else
    document.write("<option value=21>21</option>");
  
  if (thisdate=="22")
    document.write("<option value=22 selected>22</option>");
  else
    document.write("<option value=22>22</option>");
  
  if (thisdate=="23")
    document.write("<option value=23 selected>23</option>");
  else
    document.write("<option value=23>23</option>");
  
  if (thisdate=="24")
    document.write(
    "<option value=24 selected>24</option>");
  else
    document.write("<option value=24>24</option>");
  
  if (thisdate=="25")
    document.write("<option value=25 selected>25</option>");
  else
    document.write("<option value=25>25</option>");
  
  if (thisdate=="26")
    document.write("<option value=26 selected>26</option>");
  else
    document.write("<option value=26>26</option>");
  
  if (thisdate=="27")
    document.write("<option value=27 selected>27</option>");
  else
    document.write("<option value=27>27</option>");
  
  if (thisdate=="28")
    document.write("<option value=28 selected>28</option>");
  else
    document.write("<option value=28>28</option>");
  
  if (thisdate=="29")
    document.write("<option value=29 selected>29</option>");
  else
    document.write("<option value=29>29</option>");
  
  if (thisdate=="30")
    document.write("<option value=30 selected>30</option>");
  else
    document.write("<option value=30>30</option>");
    
  if (thisdate=="31")
    document.write("<option value=31 selected>31</option>");
  else
    document.write("<option value=31>31</option>");                   
  document.write("</SELECT>");
  
}
