var totalads = 15;
var exchangetime = 18000;

theLink = new Array();
theLink[0] ="http://www.sanygroup.com/group/zh-cn/";
theLink[1] = "http://www.cnyishan.com/";
theLink[2] = "http://www.sunward.com.cn";
theLink[3] = "http://www.cnfuwa.com";
theLink[4] = "http://www.china-jingong.com";
theLink[5] = "http://www.fotonhi.com.cn/";
theLink[6] = "http://www.ihisce.com";
theLink[7] = "http://www.masfy.com/";
theLink[8] = "http://www.zljt.com/";
theLink[9] = "http://www.takeuchi-china.com/";
theLink[10] ="http://www.xiagong.com/";
theLink[11] ="http://www.isuzupowertrain.com";
theLink[12] ="http://www.xzxinyuan.com/";
theLink[13] ="http://cn.doosaninfracore.co.kr/";
theLink[14] ="http://www.jcb.com.cn/";

theSrc = new Array();
theSrc[0] = "http://www.21-sun.com/gg2006/468-60ads/sany468.gif";
theSrc[1] = "http://www.21-sun.com/adbanner/yishan-banner.gif";
theSrc[2] = "http://www.21-sun.com/gg2006/468-60ads/shzn468-60.gif";
theSrc[3] = "http://www.21-sun.com/gg2006/468-60ads/fuwa468-1.gif";
theSrc[4] = "http://www.21-sun.com/gg2006/jingong/jingong.gif";
theSrc[5] = "http://www.21-sun.com/gg2006/468-60ads/LOVOL468.GIF";
theSrc[6] = "http://www.21-sun.com/gg2006/468-60ads/ihi468.gif";
theSrc[7] = "http://www.21-sun.com/gg2006/468-60ads/fuanyuan-468.gif";
theSrc[8] = "http://www.21-sun.com/gg2006/468-60ads/zhonglian2.gif";
theSrc[9] = "http://www.21-sun.com/gg2006/468-60ads/takeuchi.gif";
theSrc[10] = "http://www.21-sun.com/gg2006/468-60ads/xiagong.gif";
theSrc[11] = "http://www.21-sun.com/gg2006/468-60ads/isuzu468.gif";
theSrc[12] = "http://www.21-sun.com/gg2006/468-60ads/xinyuan.gif";
theSrc[13] = "http://www.21-sun.com/mk2006/doosan/DOOSAN468.gif";
theSrc[14] = "http://www.21-sun.com/gg2006/468-60ads/jcb468.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;
theType[10] = 2;
theType[11] = 2;
theType[12] = 2;
theType[13] = 2;
theType[14] = 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;
theRatio[11] = 1;
theRatio[12] = 1;
theRatio[13] = 1;
theRatio[14] = 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>');
