var flag=false;
			function DrawImage(ImgD,w,h)
			{
				var image=new Image();
				var iwidth = w; //定义允许图片宽度
				var iheight = h; //定义允许图片高度140,100
				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;
							//ImgD.height=iheight;
						}
						else
						{
							ImgD.width=image.width; 
							ImgD.height=image.height;
						}
						//ImgD.alt=image.width+"×"+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+"×"+image.height;
					}
				}
			}
			function istpl()
			{
				var plcontent=document.getElementById("plcontent").value
				var subtype="college";
				if(plcontent=="")
				{
					alert('留言内容不能为空');
					document.getElementById("plcontent").focus();
					return false;
				}
				college_index.istpl(plcontent,subtype,istpl_callback);		
			}
			function istpl_callback(ref)
			{
			
				var b=ref.value;
				valuex=b;
				if(valuex)
				{
					if(valuex=="1")
					{
						alert('留言成功');
						document.getElementById("plcontent").value="";
					}
					else if(valuex=="0")
					{
						alert('留言失败，请链接管理员');
						return false;
					}
					else
					{
						alert(valuex);
						return false;
					}
				}
				else
				{
				}
			}
			function showleibie()
			{
				document.getElementById("apDiv1").style.display=(document.getElementById("apDiv1").style.display=='none'?'block':'none');
			}
			function changeshow(value,text)
			{
				document.getElementById("sotype").value=value;
				document.getElementById("showleibie").innerHTML=text;
				document.getElementById("apDiv1").style.display=(document.getElementById("apDiv1").style.display=='none'?'block':'none');
			}
			function checkLogin(keyword,n) 
			{
				if (n == 0 && keyword.value == "输入您想找的关键字"){keyword.value="";}
				if (n == 1){
					if(keyword.value == "输入您想找的关键字"){keyword.value="";}	
				}
				if (n == 2 && keyword.value == "")
				{
					keyword.value = "输入您想找的关键字";
				}
			}
			function soinfo()
			{	
				var sotype=document.getElementById("sotype").value;
				var subject=document.getElementById("sowords").value;
				if(subject==""||subject=="输入您想找的关键字")
				{
					alert('输入您想找的关键字');
					return false;
				}
				URL="/fcccn_search.aspx?sotype="+sotype+"&subject="+subject+"";
				window.location=URL;
			}
