
var scrollerwidth=757;
var scrollerheight=85;
var scrollerbgcolor="#FFFFFF";
var scrollerbackground="";
var JPi;

var nIndex = 0;
var messages=new Array();
var arrTypes = new Array();
var arrProducts = new Array();
arrTypes[nIndex]="白酒";
arrProducts[nIndex]="<a href='http://www.cjsh.com' target='_blank' class='p12'>成吉思汗</a>";
nIndex++;
arrTypes[nIndex]="白酒";
arrProducts[nIndex]="<a href='http://www.quanjiafujiu.cn' target='_blank' class='p12'>全家福</a>";
nIndex++;
arrTypes[nIndex]="白酒";
arrProducts[nIndex]="<a href='http://www.wulongbin.com' target='_blank' class='p12'>五龙宾</a>";
nIndex++;
arrTypes[nIndex]="包装防伪";
arrProducts[nIndex]="<a href='http://www.dsgm.tjkx.com' target='_blank' class='p12'>德山工贸</a>";
nIndex++;
arrTypes[nIndex]="包装用纸";
arrProducts[nIndex]="<a href='http://www.ldjh99.com' target='_blank' class='p12'>酒道设计</a>";
nIndex++;
arrTypes[nIndex]="玻璃及陶瓷包装容器";
arrProducts[nIndex]="<a href='http://www.jindiaook.com' target='_blank' class='p12'>金雕包装</a>";
nIndex++;
arrTypes[nIndex]="玻璃及陶瓷包装容器";
arrProducts[nIndex]="<a href='http://www.hansong.tjkx.com' target='_blank' class='p12'>含松陶瓷</a>";
nIndex++;
arrTypes[nIndex]="玻璃及陶瓷包装容器";
arrProducts[nIndex]="<a href='http://www.gemrayhan.com.cn' target='_blank' class='p12'>金锐恒</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.yihedesign.com' target='_blank' class='p12'>宜禾设计</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.sunsoar.com.cn' target='_blank' class='p12'>先行品牌</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.jinwenhua.com' target='_blank' class='p12'>金文华设计</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.oneangle.cn' target='_blank' class='p12'>一度映象</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.ypgz.tjkx.com' target='_blank' class='p12'>壹品工造</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.chinattsd.com' target='_blank' class='p12'>陶唐仕设计</a>";
nIndex++;
arrTypes[nIndex]="广告服务";
arrProducts[nIndex]="<a href='http://www.bh99.com' target='_blank' class='p12'>丙火机构</a>";
nIndex++;
arrTypes[nIndex]="礼品促销品";
arrProducts[nIndex]="<a href='http://www.flhsj.tjkx.com' target='_blank' class='p12'>富利华水晶</a>";
nIndex++;
arrTypes[nIndex]="葡萄酒";
arrProducts[nIndex]="<a href='http://www.miscelle.com' target='_blank' class='p12'>博洛哥庄园</a>";
nIndex++;
arrTypes[nIndex]="葡萄酒";
arrProducts[nIndex]="<a href='http://www.martinwine.cn' target='_blank' class='p12'>马丁葡萄酒</a>";
nIndex++;
arrTypes[nIndex]="葡萄酒";
arrProducts[nIndex]="<a href='http://www.hongqting.tjkx.com' target='_blank' class='p12'>鸿廷酒业</a>";
nIndex++;
arrTypes[nIndex]="其他";
arrProducts[nIndex]="<a href='http://www.xxys2005.com.cn' target='_blank' class='p12'>喜形悦色</a>";
nIndex++;
arrTypes[nIndex]="商标服务";
arrProducts[nIndex]="<a href='http://www.gbicom.cn' target='_blank' class='p12'>商标转让</a>";
nIndex++;

var arrAlls = new Array();
nIndex = 0;
var n1 = 0;
var tempTypes = "";
var nPageCount = 24;
var nRowCount = 6;
for(n1=0;n1<arrTypes.length;n1++)
{
	if(nIndex % nPageCount == 0)
	{
		tempTypes = arrTypes[n1];
		arrAlls[nIndex] = "<td width='10%' class='td05'><strong>"+arrTypes[n1]+"</strong></td>";
		nIndex ++;
	}
	else if(arrTypes[n1] != tempTypes)
	{
		tempTypes = arrTypes[n1];
		arrAlls[nIndex] = "<td width='10%' class='td05'><strong>"+arrTypes[n1]+"</strong></td>";
		nIndex ++;
		if(nIndex % nPageCount == 0)
		{
			tempTypes = arrTypes[n1];
			arrAlls[nIndex] = "<td width='10%' class='td05'><strong>"+arrTypes[n1]+"</strong></td>";
			nIndex ++;
		}
	}
	arrAlls[nIndex] = "<td width='10%'>"+arrProducts[n1]+"</td>";
	nIndex ++;
}
n1 = 0;
nIndex = nRowCount - arrAlls.length % nRowCount;
for(n1=0;n1<nIndex;n1++)
{
	arrAlls[arrAlls.length] = "<td width='10%'>&nbsp;</td>";
}
n1=0;
nIndex =0;
tempTypes = "";
var nCurrentCount = 0;
for(n1=0;n1<arrAlls.length;n1++)
{
	if(nCurrentCount % nPageCount == 0)
	{
		tempTypes += "<table width='98%' border='0' align='center' cellpadding='0' cellspacing='0'>";
	}
	if(nCurrentCount % nRowCount == 0)
	{
		tempTypes += "<tr height='20'>";
	}
	tempTypes += arrAlls[n1];
	nCurrentCount ++;
	if(nCurrentCount % nRowCount == 0)
	{
		tempTypes += "</tr>";
	}
	if(nCurrentCount % nPageCount == 0 || n1==arrAlls.length-1)
	{
		tempTypes += "</table>";
		messages[nIndex] = tempTypes;
		tempTypes = "";
		nIndex ++;
	}
}

//if (messages.length>1)
//	JPi=2;
//else
	JPi=0;

function move1(whichlayer)
{
	tlayer=eval(whichlayer);
	if (tlayer.top>0&&tlayer.top<=5)
	{
		tlayer.top=0;
		setTimeout("move1(tlayer)",15000);
		setTimeout("move2(document.main.document.second)",5000);
		return;
	}
	if (tlayer.top>=tlayer.document.height*-1)
	{
		tlayer.top-=5;
		setTimeout("move1(tlayer)",100);
	}
	else
	{
		tlayer.top=scrollerheight;
		tlayer.document.write(messages[JPi]);
		tlayer.document.close();
		if (JPi==messages.length-1)
			JPi=0;
		else
			JPi++;
	}
}

function move2(whichlayer)
{
	tlayer2=eval(whichlayer);
	if (tlayer2.top>0&&tlayer2.top<=5)
	{
		tlayer2.top=0;
		setTimeout("move2(tlayer2)",15000);
		setTimeout("move1(document.main.document.first)",5000);
		return;
	}
	if (tlayer2.top>=tlayer2.document.height*-1)
	{
		tlayer2.top-=5;
		setTimeout("move2(tlayer2)",100);
	}
	else
	{
		tlayer2.top=scrollerheight;
		tlayer2.document.write(messages[JPi]);
		tlayer2.document.close();	
		if (JPi==messages.length-1)
			JPi=0;
		else
			JPi++;
	}
}

function move3(whichdiv)
{
	tdiv=eval(whichdiv);
	if (tdiv.style.pixelTop>0&&tdiv.style.pixelTop<=5)
	{
		tdiv.style.pixelTop=0;
		setTimeout("move3(tdiv)",15000);
		setTimeout("move4(second2)",15000);
		return
	}
	if (tdiv.style.pixelTop>=tdiv.offsetHeight*-1)
	{
		tdiv.style.pixelTop-=5;
		setTimeout("move3(tdiv)",100);
	}
	else
	{
		tdiv.style.pixelTop=scrollerheight;
		tdiv.innerHTML=messages[JPi];
		if (JPi==messages.length-1)
			JPi=0;
		else
			JPi++;
	}
}

function move4(whichdiv)
{
	tdiv2=eval(whichdiv);
	if (tdiv2.style.pixelTop>0&&tdiv2.style.pixelTop<=5)
	{
		tdiv2.style.pixelTop=0;
		setTimeout("move4(tdiv2)",15000);
		setTimeout("move3(first2)",15000);
		return;
	}
	if (tdiv2.style.pixelTop>=tdiv2.offsetHeight*-1){
		tdiv2.style.pixelTop-=5;
		setTimeout("move4(second2)",100);
	}
	else
	{
		tdiv2.style.pixelTop=scrollerheight;
		tdiv2.innerHTML=messages[JPi];
		if (JPi==messages.length-1)
			JPi=0;
		else
			JPi++;
	}
}

function startscroll()
{
	if (document.all)
	{
		move3(first2);
		second2.style.top=scrollerheight;
		second2.style.visibility='visible';
	}
	else if (document.layers)
	{
		document.main.visibility='show';
		move1(document.main.document.first);
		document.main.document.second.top=scrollerheight+5;
		document.main.document.second.visibility='show';
	}
}

function createLayer()
{
	if (document.layers)
	{
		document.writeln('<ilayer id="main" width='+scrollerwidth+'; height='+scrollerheight+'; bgColor='+scrollerbgcolor+'; background='+scrollerbackground+'; visibility=hide>');
		document.writeln('<layer id="first" left=0 top=1 width=' +scrollerwidth+ ' 200>');
		document.write(messages[0]);
		document.writeln('</layer>');
		document.writeln('<layer id="second" left=0 top=0 width='+ scrollerwidth +'; visibility=hide>');
		document.write(messages[1]);
		document.writeln('</layer>');
		document.writeln('</ilayer>');
	}
	else if (document.all)
	{
		document.writeln('<span id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hiden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">');
		document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0;top:0">');
		document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0;top:1;">');
		document.write(messages[0]);
		document.writeln('</div>');
		document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0;top:0;visibility:hidden">');
		document.write(messages[1]);
		document.writeln('</div>');
		document.writeln('</div>');
		document.writeln('</span>');
	}
}
