		var siteip="http://" + document.domain;
		var kfport=9999;
		var kfip=siteip+":"+kfport;		
	
		//默认值
		var head_image_url=siteip+"/images/nw_index_13.jpg";
		var copyright_img_url=siteip+"/images/nw_index_175.jpg";		
		var copyright_content='厦门市统计局主管 厦门市农村经济信息中心主办 ? Copyright 2008-2009 All Rights Reserved 版权所有&nbsp; 请使用 IE 5.0以上版本进行浏览<br />技术支持、服务热线电话:(0592)5175070 传真:(0592)5175072　 E-mail:8magri@sina.com<br />地址：厦门市禾祥东路29-33号二楼 邮编：361012&nbsp; 闽ICP备010007号';
		
		var wcm_head_image_url="";
		var wcm_copyright_img_url="";
		var wcm_copyright_content="";
		
		
		
		//获取图片路径
		var xml_url=siteip+"/config_66.xml";
		var xmlDoc=loadXMLDoc(xml_url);
	
		if(null!=xmlDoc){
			var x=xmlDoc.getElementsByTagName("config");
			if(x.length>=3){
				wcm_head_image_url=x[0].text.replace('.',siteip);
				wcm_copyright_img_url=x[2].text.replace('.',siteip);
				wcm_copyright_content=x[3].text;
			}
		}
		
		if(""!=wcm_head_image_url){
			head_image_url = wcm_head_image_url;
		}
		if(""!=wcm_copyright_img_url){
			copyright_img_url=wcm_copyright_img_url;
		}
		if(""!=wcm_copyright_content){
			copyright_content=wcm_copyright_content;
		}
		
	

//加载xml文件	
function loadXMLDoc(dname){
	try {//Internet Explorer
  
 		 xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
 	 }
	catch(e){
		 try{ //Firefox, Mozilla, Opera, etc.    
		 
		  xmlDoc=document.implementation.createDocument("","",null);
		  
		}catch(e) {alert(e.message)
	}
  }
	try 
	  {
	  xmlDoc.async=false;
	  xmlDoc.load(dname);
	  return(xmlDoc);
	  }
	catch(e) {alert(e.message)}
	return(null);
}

document.write("<table width=\"990\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" class=\"bg1 mar_bot_1\">");
document.write("<tr>");
document.write("<td width=\"660\"><table width=\"48%\" border=\"0\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\">");
document.write(" <tr>");
document.write(" <td width=\"100%\" class=\"t-acidblue pad_left_10\"><a href=\""+siteip+"/\" class=\"acidblue\">返回首页<\/a> &nbsp;| &nbsp;<a href=\"#\" class=\"acidblue\" onClick=\"this.style.behavior='url(#default#homepage)';this.setHomePage('http:\/\/www.xmagri.net.cn');\">设为主页<\/a> &nbsp;|&nbsp; <a href=\"#\" class=\"acidblue\" onClick=\"javascript:window.external.AddFavorite('http:\/\/www.xmagri.com\/','厦门农网')\">收藏本站<\/a> &nbsp;|&nbsp; <a href=\""+siteip+"\/lxfs\" class=\"acidblue\">联系方式<\/a><\/td><\/tr><\/table><\/td>");
document.write("      <td width=\"340\">");
document.writeln(" <table width=\"100%\" height=\"22\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("    <form name=\"siteSearchForm\" id=\"siteSearchForm\" action=\""+kfip+"\/search\/searchsite.html\" method=\"post\"  onSubmit=\"return searchSite();\">");
document.writeln("    <input type=\"hidden\" name=\"isSite\" value=\"true\">");
document.writeln("      <tr>");
document.writeln("        <td height=\"20\" valign=\"bottom\" class=\"t-acidblue\">站内检索：<\/td>");
document.writeln("        <td valign=\"middle\"><input name=\"keyword_site\" style=\"line-height:18px;\" type=\"text\" value=\"请输入关键字\" size=\"16\" onFocus=\"if(this.value==\'请输入关键字\'){this.select();}\"\/><input type=\"hidden\" id=\"method\" name=\"method\" value=\"goSearch\"\/><input type=\"hidden\" id=\"keyType\" name=\"keyType\" value=\"5\"\/><input type=\"hidden\" id=\"key\" name=\"key\"\/>");
document.writeln("        <\/td>");
document.writeln("        <td valign=\"bottom\"><select name=\"search_type\"><option value=\"wcm\">信息新闻类<\/option><option value=\"sh\">商品价格类<\/option><\/select>");
document.writeln("        <\/td>");
document.writeln("        <td valign=\"bottom\"><input type=\"image\" src=\""+siteip+"\/images\/nw_index_05.jpg\" width=\"44\" height=\"20\" border=\"0\"\/><\/a><\/td>        ");
document.writeln("      <\/tr>");
document.writeln("      <\/form>");
document.writeln("    <\/table>")
document.write("<\/td>");
document.write("    <\/tr>");
document.write("  <\/table>");
document.write("  <table width=\"990\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.write("    <tr>");
document.write("      <td>");
if(head_image_url.split(".")[head_image_url.split(".").length-1]=="swf"){
	document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0\" width=\"990\" height=\"173\">");
	document.writeln("      <param name=\"movie\" value=\""+ head_image_url+"\" \/>");
	document.writeln("      <param name=\"quality\" value=\"high\" \/>");
	document.writeln("      <embed src=\""+ head_image_url+"\" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" width=\"1000\" height=\"130\"><\/embed>");
	document.writeln("    <\/object>")
}else{
	document.write("      <img id=\"head_image\" src=\""+ head_image_url+"\" width=\"990\" height=\"173\" \/>");
}
document.write("      <\/td>");
document.write("    <\/tr>");
 document.write(" <\/table>");
 document.write(" <table width=\"990\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\" background=\""+siteip+"\/images\/nw_index_16.jpg\">");
  document.write("  <tr>");
 document.write("     <td height=\"34\"><table width=\"990\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
  document.write("        <tr>");
    document.write("        <td width=\"40\">&nbsp;<\/td>");
    document.write("        <td width=\"90\" class=\"td1\" id=\"index\" onMouseMove=\"change('1','index');\" onMouseOut=\"change('2','index');\"><a href=\""+siteip+"\/\"class=\"menu\" >首页<\/a><\/td>");
          document.write("  <td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write(" <td width=\"90\" class=\"td1\" id=\"xmnc\"><a href=\""+siteip+"\/xmnc\" class=\"menu\" onMouseMove=\"change('1','xmnc');\" onMouseOut=\"change('2','xmnc');\">厦门农村<\/a><\/td>");
document.write("            <td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\" class=\"td1\" id=\"informatOnline\"><a href=\""+siteip+"\/xxzx\" class=\"menu\" onMouseMove=\"change('1','informatOnline');\" onMouseOut=\"change('2','informatOnline');\">信息在线<\/a><\/td>");
document.write("<td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\" class=\"td1\" id=\"rdzt\"  onMouseMove=\"change('1','rdzt');\" onMouseOut=\"change('2','rdzt');\"><a href=\""+siteip+"\/ldzt\" class=\"menu\">热点专题<\/a><\/td>");
document.write(" <td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\"  onMouseMove=\"change('1','swpd');\" onMouseOut=\"change('2','swpd');\" class=\"td1\" id=\"swpd\"><a href=\""+kfip+"\/sh\/index.do\" class=\"menu\">商务频道<\/a><\/td>");
document.write("<td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\" class=\"td1\" id=\"schq\"  onMouseMove=\"change('1','schq');\" onMouseOut=\"change('2','schq');\"><a href=\""+kfip+"/sh/index.do?method=getMarketlist\" class=\"menu\" >市场行情<\/a><\/td>");
document.write("<td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write(" <td width=\"90\" class=\"td1\" id=\"nykj\"  onMouseMove=\"change('1','nykj');\" onMouseOut=\"change('2','nykj');\"><a href=\""+siteip+"\/nykj\" class=\"menu\">农业科技<\/a><\/td>");
document.write(" <td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\" class=\"td1\" id=\"sjzl\"  onMouseMove=\"change('1','sjzl');\" onMouseOut=\"change('2','sjzl');\"><a href=\""+siteip+"\/sjzl\" class=\"menu\">世界资料<\/a><\/td>");
document.write(" <td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\" class=\"td1\" id=\"fgda\"  onMouseMove=\"change('1','fgda');\" onMouseOut=\"change('2','fgda');\"><a href=\""+siteip+"\/fgda\" class=\"menu\">法规档案<\/a><\/td>");
document.write("<td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write(" <td width=\"90\" class=\"td1\" id=\"wsdc\"  onMouseMove=\"change('1','wsdc');\" onMouseOut=\"change('2','wsdc');\"><a href=\""+kfip+"\/quan\/servlet\/Getpagelist\" class=\"menu\">网上调查<\/a><\/td>");
document.write(" <td width=\"2\"><img src=\""+siteip+"\/images\/nw_index_01.gif\" width=\"2\" height=\"34\" \/><\/td>");
document.write("<td width=\"90\" class=\"td1\" id=\"zsnw\"  onMouseMove=\"change('1','zsnw');\" onMouseOut=\"change('2','zsnw');\"><a href=\""+siteip+"\/ycyp/index.htm\" class=\"menu\">一村一品<\/a><\/td>");
document.write(" <td width=\"40\">&nbsp;<\/td>");
document.write(" <\/tr>");
document.write("<\/table><\/td>");
document.write("<\/tr>");
document.write(" <\/table>");

function change(id,idname){		
		if(id==1){
			document.getElementById(idname).background="\/images\/nw_index_03.gif";
		}else{
			document.getElementById(idname).background=null;
		}
}

//发送查询请求
	function searchSite(){		
		
		var keyword=document.getElementById('keyword_site').value;
		var search_type=document.getElementById('search_type').value;
		var siteSearchForm=document.getElementById('siteSearchForm');
		
		if(trim(keyword).length==0 || trim(keyword)=='请输入关键字'){
			alert('请输入关键字！');
			document.getElementById('keyword_site').focus();
			return false;
		}else{
			//WCM查询
			
			if(search_type=='wcm'){
				siteSearchForm.submit();
			}else{
				siteSearchForm.action=kfip+'/sh/index.do';
				document.getElementById('key').value=keyword;
				siteSearchForm.submit();
			}
			
		}
		
	}
	
	//去除左空格
	function ltrim(str) {
		var i;
		for (i = 0; i < str.length;i++) {
			if(str.charAt(i) != " " && str.charAt(i) != " ") {
				break;
			}
		}
		str = str.substring(i, str.length);
		return str;
	}
	
	//去除右空格 
	function rtrim(str) {
		var i;
		for (i = str.length - 1; i >= 0; i--) {
			if (str.charAt(i) != " " && str.charAt(i) != " ") {
				break;
			}
		}
		str = str.substring(0, i + 1);
		return str;
	} 
	
	//去除空格
	function trim(str) {
		return ltrim(rtrim(str));
	}
