/********************  Home page animator - Chinese **************************/

/* this variable will keep the number of the image displayed notice that it is global so that different functions can change and see it */
var count_zh =0;

// these are the dynamic targets (changed depending on picture displayed)
var targ = new Array(3);
targ[0] = "http://www.moen.cn/enzh/categories/kitchen-faucet-suites?productFamily=119";
targ[1] = "http://www.moen.cn/enzh/categories/bathroom-faucet-suites?productFamily=155";
targ[2] = "http://www.moen.cn/enzh/products/275";

// these are the alt values for the rotating images (changed depending on picture displayed)
var altxt = new Array(3);
altxt[0] = "Camerist Kitchen Faucet";
altxt[1] = "Duna Bathroom Sink Faucet";
altxt[2] = "ExactTemp Vertical Spa";

// preload your images
var images_zh = new Array(3);  // image array (again, assuming three pictures)
for (var i = 0; i < 3; i++)
{
		images_zh[i] = new Image();
        images_zh[i].src = "images/homebanner" + i + "_zh.jpg";
        /* this assums you named your images picture0.gif, picture1.gif, and
picture2.gif
        // and put them in the "images" directory */
}

function do_animation_zh() // this will animate your picture (China's Chinese site - different images w/Chinese text
{
    if (count_zh==3) count_zh = 0;  // reset the counter if it gets to the last picture
	
    document.animation.src = images_zh[count_zh].src;  // changes your picture appropriately
	document.getElementById('animation-link').href = targ[count_zh]; // change href 
	document.getElementById('animation').alt = altxt[count_zh]; // change text for alt tag
    setTimeout("do_animation_zh()", 5000); // delay before the next switch
    // make the number higher for a longer pause between switching

    count_zh++; // increment the counter
}

do_animation_zh();




