function header()
{
document.write("<table width='740' border='0' cellspacing='0' cellpadding='0' height='70'>");
document.write("<tr> ");
document.write("<td width='263'><A href='./index.htm'><img src='./images/logo.jpg' width='263' height='70' border='0'></a></td>");
document.write("<td width='477' background='./images/04.gif' align='right'> ");
document.write("<table width='100%' border='0' cellspacing='0' cellpadding='0'>");
document.write("<tr align='center'> ");
document.write("<td width='13%' height='22'>&nbsp;</td>");
document.write("<td width='12%' height='22'>&nbsp;</td>");
document.write("<td width='12%' height='22' align='center'><a href='http://www.agri.gov.cn/MOA/buzhzhci.htm'>部长致辞</a>|</td>");
document.write("<td width='12%' height='22' align='center'><a href='http://www.agri.gov.cn/MOA/main.htm'>农 业 部</a>|</td>");
document.write("<td width='12%' height='22' align='center'><a href='http://www.agri.gov.cn/gzgf/'>工作规范</a>|</td>");
document.write("<td width='12%' height='22' align='center'><a href='http://www.agri.gov.cn/xzsp/t20031030_131673.htm'>行政审批</a>|</td>");
document.write("<td width='12%' height='22' align='center'><a href='http://www.agri.gov.cn/MOA/Zhishu/ZhiShu.htm'>直属单位</a>|</td>");
document.write("<td width='11%' height='22' align='center'><A href='./index.htm'>首　　页</A></td>");
document.write("</tr>");
document.write("<tr align='center'> ");
document.write("<td width='13%' height='22'><a href='./blgg/'>部令公告</a>|</td>");
document.write("<td width='12%' height='22'><a href='./xxfb/'>信息发布</a>|</td>");
document.write("<td width='12%' height='22'><a href='./zcfg/'>政策法规</a>|</td>");
document.write("<td width='12%' height='22'><a href='http://gongqiu.agri.gov.cn/index.html'>供求热线</a>|</td>");
document.write("<td width='12%' height='22'><a href='http://www.agri.gov.cn/fxycpd/zh'>分析预测</a>|</td>");
document.write("<td width='12%' height='22'><a href='./gndt/'>国内动态</a>|</td>");
document.write("<td width='12%' height='22'><a href='./llzy/'>劳力转移</a>|</td>");
document.write("<td width='11%' height='24'><a href='http://guide.agri.gov.cn/'>农业网站</a></td>");
document.write("</tr>");
document.write("<tr align='center'>"); 
document.write("<td width='13%' height='20'><a href='./xztz/'>行政通知</a>|</td>");
document.write("<td width='12%' height='20'><a href='./xxlb/'>信息联播</a>|</td>");
document.write("<td width='12%' height='20'><a href='./kjtg/'>科技推广</a>|</td>");
document.write("<td width='12%' height='20'><a href='./jghq/ly/'>价格行情</a>|</td>");
document.write("<td width='12%' height='20'><a href='./jjps/'>经济评述</a>|</td>");
document.write("<td width='12%' height='20'><a href='./gjdt/'>国际动态</a>|</td>");
document.write("<td width='12%' height='20'><a href='./wjwm/'>外经外贸</a>|</td>");
document.write("<td width='11%' height='20'><a href='http://www.agri.gov.cn/tsyx/'>图书音像</a></td>");
document.write("</tr>");
document.write("</table>");
document.write("</td>");
document.write("</tr>");
document.write("</table>");
}

function foot()
{
document.write("<table width='740' border='0' cellspacing='0' cellpadding='0'>");
document.write("<tr> ");
document.write("<td height='10'></td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td bgcolor='#F3F3F3' height='6'></td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td bgcolor='#CCCCCC' height='18'> ");
document.write("<table cellspacing=0 cellpadding=0 width='80%' border=0 align='center'>");
document.write("<tbody> ");
document.write("<tr align=middle> ");
document.write("<td class=boldf9 width='40%'><b><font color='#990000'>主 办：中华人民共和国农业部</font></b></td>");
document.write("<td class=boldf9 width='35%'><b><font color='#990000'>承 办：农业部信息中心</font></b></td>");
document.write("<td class=boldf9 width='25%'><b><font color='#990000'>京ICP备000055号</font></b></td>");
document.write("</tr>");
document.write("</tbody>"); 
document.write("</table>");
document.write("</td>");
document.write("</tr>");
document.write("</table>");
document.write("<br>");
document.write("<table width='500' border='0' cellspacing='0' cellpadding='0'>");
document.write("<tr> ");
document.write("<td width='220'> ");
document.write("<table width='100%' border='0'>");
document.write("<tr> ");
document.write("<td width='26%'><b>电 &nbsp;话：</b></td>");
document.write("<td width='74%'>(010) 64193366 (总机)</td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td width='26%'>&nbsp;</td>");
document.write("<td width='74%'>(010) 64192210 (维护)</td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td width='26%'>&nbsp;</td>");
document.write("<td width='74%'>(010) 64192292 (业务)</td>");
document.write("</tr>");
document.write("</table>");
document.write("</td>");
document.write("<td width='190' align='right'> ");
document.write("<table width='91%' border='0'>");
document.write("<tr> ");
document.write("<td width='26%'><b>传真：</b></td>");
document.write("<td width='74%'>(010) 64192468</td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td width='26%'><b>地址：</b></td>");
document.write("<td width='74%'>北京农展馆南里11号</td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td width='26%'><b>邮编：</b></td>");
document.write("<td width='74%'>100026</td>");
document.write("</tr>");
document.write("</table>");
document.write("</td>");
document.write("<td width='90' align='center'><a ");
document.write("href='http://www.hd315.gov.cn/beian/view.asp?bianhao=010102001123000461' ");
document.write("target=_blank><img height=48 src='./images/biaoshi.gif' width=40 ");
document.write("border=0></a></td>");
document.write("</tr>");
document.write("<tr> ");
document.write("<td colspan='3'><b>E-mail：&nbsp;</b><a ");
document.write("href='mailto:webmaster@agri.gov.cn'>webmaster@agri.gov.cn</a></td>");
document.write("</tr>");
document.write("</table>");
}

  
function trim_spaces(from_where) {
    
    // Store the string in a temporary variable    
    var temp_string = this

    // If no argument, then trim from both sides
    if (arguments.length == 0) {
        from_where = "BOTH"
    }
    
    // Trim spaces from the left
    if (from_where.toUpperCase() == "LEFT" || from_where == "BOTH") {
        while (temp_string.left(1) == " ") {
            temp_string = temp_string.substring(1)
        }
    }
    
    // Trim spaces from the right
    if (from_where.toUpperCase() == "RIGHT" || from_where == "BOTH") {
        while (temp_string.right(1) == " ") {
            temp_string = temp_string.substring(0, temp_string.length - 2)
        }
    }
    return temp_string   

}

function extract_left(total_chars) {
    return this.substring(0, total_chars)
}

function extract_right(total_chars) {
    return this.substring(this.length - total_chars)
}

String.prototype.right = extract_right
String.prototype.left = extract_left
String.prototype.trim = trim_spaces

///////////////////检索函数//////////////////////////
function search_onsubmit()
{
var SQLTitle="";
var SQL="";
var Relation="";
var SQLBanci="";
var keyWord="";
Relation="and";
Relation=" "+Relation+" ";	
keyWord=document.form1.searchWord.value;

//////////////////////提交到供求热线///////////////////////////
if(document.form1.classic.options[4].selected==true){
document.form1.action="http://gongqiu.agri.gov.cn/gongqiu/chaxun";
document.form1.keyword.value=keyWord;
document.form1.type.value="";
document.form1.catalog.value="";
document.form1.publishtime.value="";
document.form1.submit();
return true;
}

//////////////////////提交到分析预测///////////////////////////
if(document.form1.classic.options[5].selected==true){
document.form1.action="http://www.agri.gov.cn/analysis/asp/search/search.asp";
document.form1.info_keyword.value=keyWord;
document.form1.submit();
return true;
}

document.form1.action="http://202.127.45.55/Search/simpsearch.jsp";
document.form1.searchWord.value=keyWord;
document.form1.submit();
return true;

}
