function ShowDialog(url,dialogSettings)
{ 
var var1 = "";  
if(dialogSettings==null||dialogSettings=="")
{
   dialogSettings = "Center:yes;Resizable:no;DialogHeight:255px;DialogWidth:335px;Status:no";
}
   window.showModalDialog(url,var1,dialogSettings);
}
//
function DrawImage(ImgD,WidthD,HeightD){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= WidthD/HeightD){
     if(image.width>WidthD){
     ImgD.width=WidthD;
     ImgD.height=(image.height*WidthD)/image.width;
     }else{
     ImgD.width=image.width;
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    else{
     if(image.height>HeightD){
     ImgD.height=HeightD;
     ImgD.width=(image.width*HeightD)/image.height;
     }else{
     ImgD.width=image.width;
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"×"+image.height;
     }
    }
}
//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{timer=setInterval ("scrollwindow ()",30);}
function sc()
{clearInterval(timer);}
function scrollwindow()
{currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();}
document.onmousedown=sc;
document.ondblclick=initialize;

function myopen(objID)
{
	if (document.getElementById(objID).style.display == "none") {
		document.getElementById(objID).style.display = "";
	}else{
		document.getElementById(objID).style.display = "none";
	}
}
//内容里的图片缩放效果
function ContentImage(ImgD){ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if(image.width>0 && image.height>0){ 
        flag=true; 
        if(image.width>=500){ 
            ImgD.width=500; 
            ImgD.height=(image.height*500)/image.width; 
        }else{ 
            ImgD.width=image.width; 
            ImgD.height=image.height; 
        }  
    } 
} 
function cgimg(o){
var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
return false;
}
// 新闻、文章的字体大小改变函数
function ContentSize(size)
{
var obj=document.getElementById("size");obj.style.fontSize=size+"px";
}
function OpenWindow(Url,Width,Height,WindowObj)
{
	var ReturnStr=showModalDialog(Url,WindowObj,'dialogWidth:'+Width+'pt;dialogHeight:'+Height+'pt;status:no;help:no;scroll:yes;');
	return ReturnStr;
}