function ShowControl(ElementID){
	document.getElementById(ElementID).style.display="block";
}

function HideControl(ElementID){
	document.getElementById(ElementID).style.display="none";
}

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">
// flash的插入,需要注意,insertflash最后一个属性是ID,在同一个页面中必须是唯一的
// <script type="text/javascript">InsertFlash("images/top.swf",476,158,"top");


				function FixImgSize(url,ww,hh){ //-------------------该函数用来返回高度或宽度值
				var oImg=new Image()   //创建图像对象 
				oImg.src=url;        //设置图像源 
				if(oImg.height>oImg.width)
				{
					if(oImg.height>hh){
						return hh;
						}
					else{
						return oImg.height;
						}
				}
				else
				{
						if(oImg.width>ww){
						return ww;
						}
					else{
						return oImg.width;
						}
				  
				}
				}
				function FixWho(url){ //----------------------该函数用来判断该限制高度还是宽度的值
				var oImg=new Image()   //创建图像对象 
				oImg.src=url;        //设置图像源 
				if(oImg.height>=oImg.width)
				{
					return "H";
				}
				else
				{
					return "W";
				  
				}
				}

