function chk(fm){
	if(fm.keyword.value.length<3){
		alert('the keyword must have at least 3 letters!');
		return false;
	}
}

function ShowControl(ElementID){
	document.getElementById(ElementID).style.display="block";
}
function HideControl(ElementID){
	document.getElementById(ElementID).style.display="none";
}

function openUrl(where){
	var base="http://www.meditech.com.cn/";
	if(where !=""){
		if(where.substr(0,4)=="http"){
			window.open(where);
		}else{
			window.open(base+where);
		}
	}else{
		location.href=base;
	}
}

function DrawImage(ImgD,wid,hei){ 
	var image=new Image();
	var flag=false;
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){ 
		flag=true;
		if(image.width/image.height>= wid/hei){ 
			if(image.width>wid){
				ImgD.width=wid;
				ImgD.height=(image.height*wid)/image.width;
			}else{ 
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
			ImgD.alt="Click for details...";
		}
		else{ 
			if(image.height>hei){
				ImgD.height=hei;
				ImgD.width=(image.width*hei)/image.height;
			}else{ 
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
			//ImgD.alt="Click for details...";
		}
	}
}

function InsertFlash(Flash,Width,Height,ID){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
	document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ");
	document.write("width=\"" + Width + "\" height=\"" + Height + "\" id=\"" + ID + "\">");
	document.write("<param name=\"movie\" value=\"" + Flash + "\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<embed src=\"" + Flash + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ");
	document.write("type=\"application/x-shockwave-flash\" width=\"" + Width + "\" height=\"" + Height + "\"></embed>");
	document.write("</object>");
}

// 页面中写入的代码为

// 先调用本js程序

// <script type="text/javascript" src="flash.js"></script>

// flash的插入,需要注意,insertflash最后一个属性是ID,在同一个页面中必须是唯一的

// <script type="text/javascript">InsertFlash("images/top.swf",476,158,"top");</script>
