// JavaScript Document

var counts=4; //图片数量
var lunhuantime=4000; //轮换时间
img1=new Image ();img1.src='images/tu1.jpg';
img2=new Image ();img2.src='images/tu2.jpg';
img3=new Image ();img3.src='images/tu3.jpg';
img4=new Image ();img4.src='images/tu4.jpg';

tupianlianjie1=new Image ();
tupianlianjie1.src="newlongkouvermicelli.html";

tupianlianjie2=new Image ();
tupianlianjie2.src="sweetpotatovermicelli.html";

tupianlianjie3=new Image ();
tupianlianjie3.src="crushedgarlic.html";

tupianlianjie4=new Image ();
tupianlianjie4.src='cooking.html';

biaoti1="NEW LONGKOU VERMICELLI";
biaoti2="SWEET POTATO VERMICELLI";
biaoti3="FRESH CRUSHED GARLIC";
biaoti4="COOKING";

wenben1="Longkou Vermicelli is a traditional Chinese foodstuff. Our new Longkou Vermicelli is made of Green Beans or Peas with top quality, and dried by steaming which is much more sanitary than traditionally processed vermicelli.";
wenben2="Our sweet potato vermicelli is made of 100% sweet-potatp-starch, which has good quality at competitive price.";
wenben3="Our crushed garlic is made of fresh garlic, which remains the natural flavour of garlic, and is suitable for families as well as restaurants.";
wenben4="With our top quoality products, you can make great dishes. Have a try, and enjoy!";

var nn=1;
var tt;
var key=0;
function change_img()
{
  if(key==0) {key=1;}
  else 
    if(document.all)
      {document.getElementById("turn").filters[0].Apply(); 
       document.getElementById("turn").filters[0].Play(duration=1);}

    eval('document.getElementById("turn").src=img'+nn+'.src');
eval('document.getElementById("tupianlianjie").href=tupianlianjie'+nn+'.src');
eval('document.getElementById("wenzi-p1").href=tupianlianjie'+nn+'.src');
biaoti="biaoti"+nn;
wenben="wenben"+nn;
eval('document.getElementById("wenzi-p1").innerHTML='+biaoti);
eval('document.getElementById("wenzi-p2").innerHTML='+wenben);
for (var i=1;i<=counts;i++){

document.getElementById("button-a"+i).className='axx';
}

    document.getElementById("button-a"+nn).className='bxx';
    nn++;
    if(nn>counts){nn=1;}
    tt=setTimeout('change_img()',lunhuantime);}
	
function changeimg(n)
{nn=n;window.clearTimeout(tt);change_img();}

function   jixu() 
{window.clearTimeout(tt); 
tt=setTimeout('change_img()',lunhuantime);
} 

function   zanting() 
{ 
clearTimeout(tt); 
} 

