function DrawImage(ImgD,FitWidth,FitHeight)
{
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0)
	{
		if(image.width/image.height>= FitWidth/FitHeight)
		{
			if(image.width>FitWidth)
			{
				ImgD.width=FitWidth;
				ImgD.height=(image.height*FitWidth)/image.width;
			}
			else
			{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
		else
		{
			if(image.height>FitHeight)
			{
				ImgD.height=FitHeight;
				ImgD.width=(image.width*FitHeight)/image.height;
			}
			else
			{
				ImgD.width=image.width;
				ImgD.height=image.height;
			}
		}
	}
}
var sID = 0;

function ShowSearchTabs(ID)
{
	if (sID != ID)
	{
		ShTabs[ID].className = "sh_on";
		ShTabs[sID].className = "sh_off";
		ShShowTab[ID].style.display = "";
		ShShowTab[sID].style.display = "none";
	}
	sID = ID;
}
//文章搜索
function GoArticle()
{
	var strValue = taForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		taForm.Keyword.focus();
		return false;
	}
	taForm.submit();
}
//图片搜索
function GoPhoto()
{
	var strValue = tpForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		tpForm.Keyword.focus();
		return false;
	}
	tpForm.submit();
}
//医院搜索
function GoHospital()
{
	var strValue = thForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		thForm.Keyword.focus();
		return false;
	}
	thForm.submit();
}
//医生搜索
function GoDoctor()
{
	var strValue = tdForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		tdForm.Keyword.focus();
		return false;
	}
	tdForm.submit();
}
//招聘搜索
function GoZhaoPin()
{
	var strValue = tzForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		tzForm.Keyword.focus();
		return false;
	}
	tzForm.submit();
}
//人才搜索
function GoBrain()
{
	var strValue = tbForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		tbForm.Keyword.focus();
		return false;
	}
	tbForm.submit();
}
//视频搜索
function GoVideo()
{
	var strValue = tvForm.Keyword.value;
	if (strValue == "" || strValue.length == 0)
	{
		alert("请输入搜索关键字！！！");
		tvForm.Keyword.focus();
		return false;
	}
	tvForm.submit();
}
//显示new图片
function CheckInfoDate(infodate) {
	var today  = new Date().getTime();
	var theday = Date.parse(infodate.replace(/(\d+)-(\d+)-(\d+)/,'$2/$3/$1'));
	var intDay = Math.floor((today-theday)/(24*3600*1000));
	if (intDay <= 5)
	{
		document.write('<img src="http://www.wxybw.com/Skin/jkw/news5.gif" width="28" height="11" />');
	} else {
		document.write('');
	}
}
//png图片透明
function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
         var imgID = (img.id) ? "id='" + img.id + "' " : ""
         var imgClass = (img.className) ? "class='" + img.className + "' " : ""
         var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
         var imgStyle = "display:inline-block;" + img.style.cssText 
         if (img.align == "left") imgStyle = "float:left;" + imgStyle
         if (img.align == "right") imgStyle = "float:right;" + imgStyle
         if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle        
         var strNewHTML = "<span " + imgID + imgClass + imgTitle
         + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
         + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
         + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
         img.outerHTML = strNewHTML
         i = i-1
         }
      }
   }
window.attachEvent("onload", correctPNG);
