function cutDate(data, length){
	if (data.length > length){
		data = data.substring(0,length) + "...";
	} 
	return data;
}

function DrawImage(ImgD,iwidth,iheight){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= iwidth/iheight){
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
		}else{
				ImgD.height=iheight;
				ImgD.width=(image.width*iheight)/image.height; 
		}
	}
}

function DrawImageWidth(ImgD,iwidth){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.width >= iwidth){
				ImgD.width=iwidth;
				ImgD.height=(image.height*iwidth)/image.width;
		}
	}
}

function DrawImageHeight(ImgD,iheight){
	var image=new Image();
	image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		flag=true;
		if(image.height >= iheight){
			ImgD.height=iheight;
			ImgD.width=(image.width*iheight)/image.height;
		}
	}
}

//打印 --chris

function printDocContent(){
	
	var str = document.body.innerHTML;
	//alert(str);
	//str = str.split("abc").join("xyz");
	var printContent = document.getElementById("DocContent").innerHTML;
	//alert(printContent);
	document.body.innerHTML="<div id=DocContent><table width=600 border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + document.getElementById("DocContent").innerHTML + "</td></tr><tr><td>"+window.location.href+"</td></tr></table></div>";
   window.print();
	}

function printContentDoc(){
	
	var str = document.body.innerHTML;
	var printContent = document.getElementById("ContentDoc").innerHTML;
	document.body.innerHTML="<div class=txt_con style=border-top:0;width:100%;text-align:center;overflow:hidden;><div class=left style=float:center;><div class=txt_ms style=width:600;><div id=DocContent><table width=600 border=0 cellspacing=0 cellpadding=0 align=center><tr><td align=left>" + document.getElementById("ContentDoc").innerHTML + "</td></tr><tr><td>"+window.location.href+"</td></tr></table></div></div></div></div>";
   window.print();
	}


//此为正文大中小文字显示的效果脚本
function setFontSize(obj,size){
document.getElementById('newsdetail-content-text').style.fontSize=size+'px';
}

String.prototype.Trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");};