var totalads = 11;
var exchangetime = 12000;

theLink = new Array();
theLink[0] ="http://www.sany.com.cn/";
theLink[1] = "http://www.zjhcht.com/";
theLink[2] = "http://www.roady-china.com/";
theLink[3] = "http://www.fjttm.com/";
theLink[4] = "http://www.sumitomokenki.com.cn/";
theLink[5] = "http://www.lmjx.net/";
theLink[6] = "http://www.zljt.com/";
theLink[7] = "http://www.nflg.com/";
theLink[8] = "http://www.rm.com.cn/";
theLink[9] = "http://www.gaoyuansg.com/";
theLink[10] = "http://www.crtketai.com/";

theSrc = new Array();
theSrc[0] = "http://www.lmjx.net/lamdjsx/468-60/sany.gif";
theSrc[1] = "http://www.lmjx.net/lamdjsx/468-60/huatong.gif";
theSrc[2] = "http://www.lmjx.net/lamdjsx/468-60/roady.gif";
theSrc[3] = "http://www.lmjx.net/lamdjsx/468-60/tietuo.gif";
theSrc[4] = "http://www.lmjx.net/lamdjsx/468-60/zhuyou.gif";
theSrc[5] = "http://www.lmjx.net/lamdjsx/468-60/lmjx.GIF";
theSrc[6] = "http://www.lmjx.net/lamdjsx/468-60/zoomlion.gif";
theSrc[7] = "http://www.lmjx.net/lamdjsx/468-60/nflg.gif";
theSrc[8] = "http://www.lmjx.net/lamdjsx/468-60/zjxz.GIF";
theSrc[9] = "http://www.lmjx.net/lamdjsx/468-60/gaoyuan.gif";
theSrc[10] = "http://www.lmjx.net/lamdjsx/468-60/ketai.gif";
 
theType = new Array();
theType[0] = 2;
theType[1] = 2;
theType[2] = 2;
theType[3] = 2;
theType[4] = 2;
theType[5] = 2;
theType[6] = 2;
theType[7] = 2;
theType[8] = 2;
theType[9] = 2;


theRatio = new Array();
theRatio[0] = 1;
theRatio[1] = 1;
theRatio[2] = 1;
theRatio[3] = 1;
theRatio[4] = 1;
theRatio[5] = 1;
theRatio[6] = 1;
theRatio[7] = 1;
theRatio[8] = 1;
theRatio[9] = 1;
theRatio[10] = 1;
 
totalRatio = new Array();
totalRatio[-1] = 0
 
for(var i=0;i<=totalads-1;i++)
{
  totalRatio[i] = totalRatio[i-1] + theRatio[i];
}
 
var num = Math.floor(Math.random() * totalRatio[totalads -1]);
i=0;

 
while(totalRatio[i] <= num) {i++;}
link = i;
num = i;

 
function change ()
{
  link = num;
  document.adimg.src=theSrc[link];
  num++;
  if (num >= totalads) {num = 0}
  setTimeout('change()',exchangetime * theRatio[link]);
}
 
function gogo ()
{
  if (theType[link] == 1)
  {parent.main.location=theLink[link]}
  else
  {
   window.open(theLink[link],'','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
  }
}
 
setTimeout('change()',exchangetime * theRatio[link]);
document.write('<a style=cursor:hand onClick=gogo()><img name=adimg src=' + theSrc[link] + '></a>');

