﻿// JScript 文件

 var speed = 50; 
					var intAWidth = 905;
					var intAHeight = 15;
					var direction = "left";
					var collectScroll;
					var tab;
					var tab1;
					var tab2;
					var MyMar;
					function autoScroll(){
					 this.items = [];
					 this.addItem = function(adURL,strURL,strBak,intTarget,strPname){
					  var newItem  = {};
					  newItem.adURL = adURL;
					  newItem.strURL = strURL;
					  newItem.strBak = strBak;
					  newItem.intTarget = intTarget;
					  newItem.strPname = strPname;
					  this.items[this.items.length] = newItem;
					 }
					 this.play = function(){
					  collectScroll = this.items
					  scrollHtml()
					  tab=document.getElementById("demo");
					  tab1=document.getElementById("demo1");
					  tab2=document.getElementById("demo2");
					  tab2.innerHTML=tab1.innerHTML;
					  MyMar=setInterval(Marquee,speed);
					 }
					}
					function scrollHtml(){
					 var imgHtml = ""
					 for(var i=0;i<collectScroll.length;i++){
					  var a = collectScroll[i]
					  //imgHtml += "<a href=\""+a.strURL+"\" target=\""+a.intTarget+"\"><img src=\""+a.adURL+"\" alt=\""+a.strBak+"\" border=\"0\" /></a>"
					  imgHtml +="<a href=\""+a.strURL+"\" target=\""+a.intTarget+"\"><img src=\""+a.adURL+"\" alt=\""+a.strBak+"\" border=\"0\" width=\"0\" height=\"0\" /></a><a href=\""+a.strURL+"\" target=\""+a.intTarget+"\">"+ a.strPname +"</a>"
					 }
					 var b,c,d,e
					 if(direction == "left" || direction == "right"){
					  b = "<div id=\"indemo\" style=\"float: left;width: 800%\">"
					  c = " style=\"float: left\""
					  d = "</div>"
					 //Msy增加产品标题
					 e ="<ul class=\"itemlist1\">";
					 f=" </ul>";
					 }else{
                      b = "<div id=\"indemo\" style=\"float: down;width: 800%\">"
					  c = " style=\"float: top\""
					  d = "</div>"
					 //Msy增加产品标题
					 e ="<ul class=\"itemlist1\">";
					 f=" </ul>";
					 }
					 document.writeln("<div id=\"demo\" onmouseover=\"clearInterval(MyMar)\" onmouseout=\"MyMar=setInterval(Marquee,speed)\" style=\"overflow:hidden; width:"+intAWidth+"px;height:"+intAHeight+"px\">")
					 document.writeln(b+"<div id=\"demo1\""+c+">")
					 document.writeln(e)
					 document.writeln(imgHtml)
					 document.writeln(f)
					 document.writeln("</div><div id=\"demo2\""+c+" >"+d+"</div></div>")
					}
					function Marquee()
					{
					 if(direction == "top")
					 {
					  if(tab2.offsetHeight-tab.scrollTop<=0){
					   tab.scrollTop-=tab1.offsetHeight
					  }else{
					   tab.scrollTop++
					  }
					 }
					  else if(direction == "left")
					 {
					  if(tab2.offsetWidth-tab.scrollLeft<=0)
					   tab.scrollLeft-=tab1.offsetWidth
					  else{
					   tab.scrollLeft++;
					  }
					 }
					 else if(direction == "down")
					 {
					  if(tab1.offsetHeight-tab.scrollTop>=0)
					   tab.scrollTop+=tab2.offsetHeight
					  else{
					   tab.scrollTop--
					  }
					 }
					
					 else if(direction == "right")
					 {
					    if(tab.scrollLeft<=0)
					     tab.scrollLeft+=tab2.offsetWidth
					     else
					    {
					      tab.scrollLeft--
					     }
					 }
					}

