
//将内容复制到剪贴板上
function CopyInfo(copyStr)
{
if (clipboardData.setData("text",copyStr))
{alert("内容已成功复制到剪贴板!")}
else
{alert("复制失败!")}
}

// 改变编辑区高度
function sizeChange(formID,size){
	//if (!BrowserInfo.IsIE55OrMore){
		//alert("此功能需要IE5.5版本以上的支持！");
		//return false;
	//}
	//for (var i=0; i<parent.frames.length; i++){
		//if (parent.frames[i].document==self.document){
			//var obj=parent.frames[i].frameElement;
			var obj=formID;
			var height = parseInt(obj.offsetHeight);
			if (height+size>=118){
				obj.style.height=height+size;
			}
			//break;
		//}
	//}
}

//取得浏览器地址栏内容
function getAddr()
{
 var addr=self.location;
 return addr;
}
//自动等比例变换缩放图片
function  DrawImage(ImgD,ImgW,ImgH){  
//调用示例：onload="javascript:DrawImage(this,160,120);"
	 var  flag=false;  
	 var  image=new  Image();  
	 image.src=ImgD.src;  
     if(image.width>0  &&  image.height>0){  
       flag=true;  
       if(image.width/image.height>=  ImgW/ImgH){  
         if(image.width>ImgW){      
         ImgD.width=ImgW;  
         ImgD.height=(image.height*ImgW)/image.width;  
         }else{  
         ImgD.width=image.width;      
         ImgD.height=image.height;  
         }  
         ImgD.alt=image.width+"×"+image.height;  
         }  
       else{  
         if(image.height>ImgH){      
         ImgD.height=ImgH;  
         ImgD.width=(image.width*ImgH)/image.height;            
         }else{  
         ImgD.width=image.width;      
         ImgD.height=image.height;  
         }  
         ImgD.alt=image.width+"×"+image.height;  
         }  
       }  
}    
//改变CSS样式
function Change_css_over(PicID)
{
 PicID.className="Pic_Alpha_over";
}
function Change_css_out(PicID)
{
 PicID.className="Pic_Alpha_out";
}

//信息提示功能------------------------------------------------

//在几秒后执行某操作
function TimeRun(Times,temp)
{
 CommandStr=temp
 i_clock=Times;
 clock();
}
//在几秒后执行某操作
function TimeRun(Times,temp)
{
 CommandStr=temp
 i_clock=Times;
 clock();
}
//TimeRun的附件函数
function clock()
{
i_clock=i_clock-1;
//document.title="个人信息系统，"+i_clock+"秒后执行操作!";
if(i_clock>0)
{setTimeout("clock();",1000);}
else
{eval(CommandStr)}
}

function SlowShow(Div_show,Times)  //渐渐显示功能,Div层ID,Times延迟时间
{
 o_show = document.getElementById(Div_show);
 //alert(o_show)
 i_show=0;
 o_show.style.display="block";
 o_show.style.filter = "Alpha(Opacity=0)";
 window.setInterval(SlowShowFun,Times);
}
function SlowHid(Div,Times)  //渐渐隐藏功能,Div层ID,Times延迟时间
{
 o = document.getElementById(Div);
 i_hid=100;
 window.setInterval(SlowHidFun,Times);
}
function SlowShowFun()//渐渐出现函数
{
  //alert("run here");
  //i_show++;
  i_show=i_show+20
  if(i_show<101)
  {
  if(document.all) o_show.style.filter = "Alpha(Opacity=" + i_show + ")"; //for IE	
  else o_show.style.opacity = i_show /100; //for FF
  }
}
function SlowHidFun()//渐渐消失函数
{
  i_hid--;
  if(i_hid>0)
  {
  if(document.all) o.style.filter = "Alpha(Opacity=" + i_hid + ")"; //for IE	
  else o.style.opacity = i_hid/100; //for FF
  }
  if (i_hid==0)
  {o.style.display='none';}
}
//信息提示功能-------------------------------------------------

//播放flash函数
function playFlash(we,hi,f_name,flashID,str){ 
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+we+'" height="'+hi+'" id="'+flashID+'" '+str+'>');
document.write('<param name="movie" value="'+f_name+'">');
document.write('<param name="quality" value="high">');
document.write('<param name="wmode" value="transparent">');
document.write('<embed src="'+f_name+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+we+'" height="'+hi+'" wmode="transparent"></embed>');
document.write('</object>');
}

//播放Flash或图片,依存函数 需playFlash(we,hi,f_name,a)
function playAdv(w,h,addr,href,str)
{
 if(addr.indexOf(".swf")>0)
 {
  playFlash(w,h,addr,"",str);
 }
 else
 {
  document.write("<a href='"+href+"' target='_blank'><img src='"+addr+"'width='"+w+"' height='"+h+"' border=0 "+str+"/></a>");
 }
}

//加载图片
function preloadimg(url,obj){
var img=new Image();
//obj.innerHTML="<p>图片加载中...</p>";
img.onload=function(){obj.src = this.src;}
//img.onerror=function(){obj.innerHTML="图片加载失败！"};
img.src=url; //img.src一定要写在img.onload之后，否则在IE中会出现问题
}

function keyClose() { 
if (event.altKey &&event.keyCode==67)  window.close(); //按下alt+C 关闭本页面
}
