/*双击自动滚屏*/
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

/*最大化窗口*/
<!-- Begin 
//self.moveTo(0,0) 
//self.resizeTo(screen.availWidth,screen.availHeight) 
// End -->

/*鼠标经过图像*/
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

//字体大小
function doZoom(size,sizeh)
{
	var obj=document.all.zoom;
	obj.style.fontSize=size+"px";
	obj.style.lineheight=sizeh+"px";
}

//视力保护色
//setColor
function setColor(color_val) {
	document.getElementById('myTable').style.backgroundColor = color_val;
}
//getColor
function getColor() {
  myTable.style.backgroundColor = "#FFFFFF";
	var bg_color = readCookie("bgColor_cookie");
	if (bg_color != null) {
    	myTable.style.backgroundColor = bg_color
	}
}

// 复制文本
function copyText(obj) 
{
var rng = document.body.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);
}
// 复制网址
function CopyUrl(){ 
var clipBoardContent=""; 
clipBoardContent+=document.title; 
clipBoardContent+=""; 
clipBoardContent+=this.location.href; 
window.clipboardData.setData("Text",clipBoardContent); 
alert("复制成功，请粘贴到您的QQ/MSN上推荐给您的好友"); 
} 

// 图片缩放脚本
var flag=true; 
function DrawImage(ImgD){ 
    var image=new Image(); 
    image.src=ImgD.src; 
    if(image.width>0 && image.height>0){ 
        flag=true; 
        if(image.width>=700){ 
            ImgD.width=700; 
            ImgD.height=(image.height*700)/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;
}

//防止查看源代码 例如<body onload=clear()>
//function clear(){
	//Source=document.body.firstChild.data;
	//document.open();
	//document.close();
	//document.title="看不到源代码";
	//document.body.innerHTML=Source;
//}

//显示关闭项目
<!--
    function xfboy(AgreeSet){
    AgreeSet.style.display=(AgreeSet.style.display=="none")?"":"none";
    }
//-->

//打开窗口
//调用方式 <a href="javaScript:OpenWindow('"&AutoLink&"',400,600,450,110,'')"> 链接地址，窗口宽度，窗口高度，距离左边，距离顶部
function OpenWindow(url,width,height,left,top)
{
  var win = window.open(url,"null",'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',resizable=no,scrollbars=yes,menubar=no,status=no,location=no' );
}

//点击自动滚屏
function click() {
if (event.button==2) {
	if(document.all.auto.status==true){document.all.auto.status=false;alert("自动滚屏已经停止了！")}
	scroller();
	}
}
document.onmousedown=click

//屏蔽js错误的小技巧 
<!-- 
/*屏蔽所有的js错误*/ 
function killerrors() { 
return true; 
} 
window.onerror = killerrors; 
//-->

/*替换输入框的Class及输入框所在容器的Class属性*/
function onReplacestyle(objid,boxid){
    var ot = eval(objid);
	if (ot.className != "Inputbox"){
		ot.className = "Inputbox";
		$(boxid).className = "Inputbox";
	}
	else
	{
		ot.className = "";
		$(boxid).className = "User_Biaodan";
	}
}
