var flag = false;

function draw(ImgD, mw, mh) {
	var image = new Image();
	var iwidth = mw;
	var iheight = mh;
	image.src = ImgD.src;
	if (image.width > 0 && image.height > 0) {
		flag = true;
		if (image.width / image.height >= iwidth / iheight) {
			if (image.width > iwidth) {
				ImgD.width = iwidth;
				ImgD.height = (image.height * iwidth) / image.width;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
			ImgD.alt = image.width + "\xd7" + image.height;
		} else {
			if (image.height > iheight) {
				ImgD.height = iheight;
				ImgD.width = (image.width * iheight) / image.height;
			} else {
				ImgD.width = image.width;
				ImgD.height = image.height;
			}
			ImgD.alt = image.width + "\xd7" + image.height;
		}
	}
}

function writeTopBanner(){
	document.write("<div id='top'><form method='POST' action='http://search.forestry.gov.cn//search/se.jsp' name='search2'><div id='top_txt'><span class='col_063'><a href='#'>联系我们</a></span><span class='title'>站内搜索</span><span><input name='keyword' type='text' class='search_int' id='textfield' /><input name='button3' type='submit' class='search_but0' id='button3' value='搜索' /><input name='button3' type='buttom' class='search_but1' id='button3' value='高级搜索' onclick='http://search.forestry.gov.cn//search/assemble.jsp'/> </span> </div><input type='hidden' name='category' size='12' value='国家林业局干部管理学院'></form> <div id='top_name'><img src='/portal/stafa/banner.jpg' width='990' height='199' /></div> </div> ");
}
function writeFootBanner(){
	document.write("<table width='990' align='center' cellpadding='0' cellspacing='0'>  <tr>    <td height='8' colspan='4' class='menudown'></td>  </tr>  <tr>    <td height='70' colspan='4' align='center' class='menudown2_copyright'>    	主办：国家林业局　　承办：国家林业局管理干部学院        <br>地址：北京市大兴区林校北路8号 联系电话：010-60282118 邮政编码：102600         <br>技术支持：西安未来国际信息股份有限公司 京ICP备06020348号	电话：010-84239626 84239676</td>  </tr>  <tr>    <td height='25' colspan='4' class='menudown'></td>  </tr></table>");
}
function loadiframe(){
	var key=document.getElementById("search_key").value;
    document.getElementById("ifr_about_link").setAttribute("src","/portal/search/searchresult.jsp?searchword="+key);
}
