﻿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];}
}
/// <summary>
/// 内容从右向左移动
/// </summary>
/// <param name="scollID">
/// 待移动控件的ID
/// </param>
/// <param name="leftID">
/// 实际存放内容控件的ID
/// </param>
/// <param name="rightID">
/// 存放内容右边控件的ID
/// </param>
//function SetScroll(scollID,leftID,rightID)
//{
//    //速度数值越大速度越慢
//    var speed=30; 
//    function Marquee3()
//    {
//        rightID.innerHTML=leftID.innerHTML;
//        if (rightID.offsetWidth-scollID.scrollLeft<=0)
//        {
//            scollID.scrollLeft-=leftID.offsetWidth;
//        }
//        else
//        {
//            scollID.scrollLeft++;
//        }
//    }
//    //设置计时器  
//    var MyMar3=setInterval(Marquee3,speed);
//    //鼠标移上去，停止移动  
//    scollID.onmouseover=function() { clearInterval(MyMar3); }
//    //鼠标离开，继续移动    
//    scollID.onmouseout=function() { MyMar3=setInterval(Marquee3,speed); }    
//}
//var speed=30;//速度数值越大速度越慢
//butong_net_left2.innerHTML=butong_net_left1.innerHTML;
//function Marquee3()
//{
//    if (butong_net_left2.offsetWidth-butong_net_left.scrollLeft<=0)
//    {
//        butong_net_left.scrollLeft-=butong_net_left1.offsetWidth;
//    }
//    else
//    {
//        butong_net_left.scrollLeft++;
//    }
//}
//var MyMar3=setInterval(Marquee3,speed);
//butong_net_left.onmouseover=function() { clearInterval(MyMar3);}
//butong_net_left.onmouseout=function() { MyMar3=setInterval(Marquee3,speed);}

//        //调用向右滚动
//        toright("demo00","demo01","demo02",40)
//        function $(id){return document.getElementById(id)}
//        //向右滚动函数，demo包含demo1与demo2,speed是滚动速度，flag一个网页内有多个时设置为不同的任意字符。
//        function toright(demo,demo1,demo2,speed,flag){
//        demo=$(demo);demo1=$(demo1);demo2=$(demo2)
//        demo2.innerHTML=demo1.innerHTML
//        function Marquee(){
//        if(demo.scrollLeft<=0){
//        demo.scrollLeft=demo2.offsetWidth
//        }
//        else{
//        demo.scrollLeft--
//        }
//        }
//        flag=setInterval(Marquee,speed)
//        demo.onmouseover=function(){clearInterval(flag);}
//        demo.onmouseout=function(){flag=setInterval(Marquee,speed);}
//    }



