/* retate_promo.js Rotate Promotional Images on the Homepage. Aladdin Tbakhi ShopNZ - V.2.0 10S Aug. 2007 */ var interval = 5; // delay between rotating images (in seconds) var random_display = 0; // 0 = no, 1 = yes interval *= 1000; var interval_R = 6; interval_R *= 1000; var interval_S = 8; interval_S *= 1000; var image_index = 0; ALT_index = 0; HREF_index = 0; var image_index_R = 0; ALT_index_R = 0; HREF_index_R = 0; var image_index_S = 0; ALT_index_S = 0; HREF_index_S = 0; left_image_list = new Array(); left_image_ALT = new Array(); left_image_HREF = new Array(); right_image_list = new Array(); right_image_ALT = new Array(); right_image_HREF = new Array(); sky_image_list = new Array(); sky_image_ALT = new Array(); sky_image_HREF = new Array(); //********************************ADD new image details HERE ********************************** //LEFT hand Images // ********* FIRST ONE HERE left_image_list[image_index++] = "includes/languages/chinese/images/promo_offers/Fillers/nz_kechup_tw.jpg"; left_image_ALT[ALT_index++] = "Watties 番茄酱"; left_image_HREF[HREF_index++] = "http://www.shopnewzealand.co.nz/tw/cp/166"; right_image_list[image_index_R++] = "includes/languages/chinese/images/promo_offers/Fillers/easter_treat_tw.jpg"; right_image_ALT[ALT_index_R++] = "复活节巧克力及复活节糖果"; right_image_HREF[HREF_index_R++] = "http://www.shopnewzealand.co.nz/nt_tw/c/850/1263"; left_image_list[image_index++] = "includes/languages/chinese/images/promo_offers/Fillers/glosst_glass_tw.jpg"; left_image_ALT[ALT_index++] = "在线购买手工玻璃器皿"; left_image_HREF[HREF_index++] = "http://www.shopnewzealand.co.nz/tw/c/118/815"; right_image_list[image_index_R++] = "includes/languages/chinese/images/promo_offers/Fillers/fairydown_cover_tw.jpg"; right_image_ALT[ALT_index_R++] = "新款Fairydown羊毛毯 "; right_image_HREF[HREF_index_R++] = "http://www.shopnewzealand.co.nz/nt_tw/c/118/1019"; left_image_list[image_index++] = "includes/languages/chinese/images/promo_offers/Fillers/canterbury_newboots_tw.jpg"; left_image_ALT[ALT_index++] = "Canterbury Leather 皮毛一体雪地靴"; left_image_HREF[HREF_index++] = "http://www.shopnewzealand.co.nz/tw/c/%E9%9B%AA%E5%9C%B0%E9%9D%B4_%E7%B3%BB%E5%88%97"; right_image_list[image_index_R++] = "includes/languages/chinese/images/promo_offers/Fillers/runga_newarrival_tw.jpg"; right_image_ALT[ALT_index_R++] = "新款 Boh Runga 珠宝"; right_image_HREF[HREF_index_R++] = "http://www.shopnewzealand.co.nz/nt_tw/c/55/972/1446"; sky_image_list[image_index_S++] = "includes/languages/chinese/images/promo_offers/Fillers/bbn_goats_milk_500g_tw.jpg"; sky_image_ALT[ALT_index_S++] = "购买羊奶粉"; sky_image_HREF[HREF_index_S++] = "http://www.shopnewzealand.co.nz/tw/cp/%E5%A9%B4%E5%84%BF%E7%BE%8A%E5%A5%B6%E7%B2%89"; sky_image_list[image_index_S++] = "includes/languages/chinese/images/promo_offers/Fillers/gs_chocolate_rush_tw.jpg"; sky_image_ALT[ALT_index_S++] = "令人愉悦的有机饼干"; sky_image_HREF[HREF_index_S++] = "http://www.shopnewzealand.co.nz/nt_ko/c/90/1439"; //************************************************************************************************ var number_of_image = left_image_list.length; var number_of_image_R = right_image_list.length; var number_of_image_S = sky_image_list.length; // MAIN FUNTION function rotateImage(place,image_link) { if (place =='left_image') { //var new_image = getNextImage(); //fading effect here if(navigator.appName == "Microsoft Internet Explorer") { document.images.left_image.style.filter="blendTrans(duration=2)" document.images.left_image.style.filter="blendTrans(duration=crossFadeDuration)" document.images.left_image.filters.blendTrans.Apply() document.images.left_image.filters.blendTrans.Play() } image_index = (image_index+1) % number_of_image; document[place].src = left_image_list[image_index]; document[place].alt = left_image_ALT[image_index]; document[place].title = left_image_ALT[image_index]; document.getElementById("left_link").href = left_image_HREF[image_index]; var recur_call = "rotateImage('"+place+"','"+image_link+"')"; setTimeout(recur_call, interval); } if (place =='right_image') { //var new_image = getNextImage_R(); //fading effect here if(navigator.appName == "Microsoft Internet Explorer") { document.images.right_image.style.filter="blendTrans(duration=2)" document.images.right_image.style.filter="blendTrans(duration=crossFadeDuration)" document.images.right_image.filters.blendTrans.Apply() document.images.right_image.filters.blendTrans.Play() } image_index_R = (image_index_R+1) % number_of_image_R; document[place].src = right_image_list[image_index_R]; document[place].alt = right_image_ALT[image_index_R]; document[place].title = right_image_ALT[image_index_R]; document.getElementById("right_link").href = right_image_HREF[image_index_R]; var recur_call = "rotateImage('"+place+"','"+image_link+"')"; setTimeout(recur_call, interval_R); } if (place =='sky_image') { //var new_image = getNextImage_R(); //fading effect here if(navigator.appName == "Microsoft Internet Explorer") { document.images.sky_image.style.filter="blendTrans(duration=2)" document.images.sky_image.style.filter="blendTrans(duration=crossFadeDuration)" document.images.sky_image.filters.blendTrans.Apply() document.images.sky_image.filters.blendTrans.Play() } image_index_S = (image_index_S+1) % number_of_image_S; document[place].src = sky_image_list[image_index_S]; document[place].alt = sky_image_ALT[image_index_S]; document[place].title = sky_image_ALT[image_index_S]; document.getElementById("sky_link").href = sky_image_HREF[image_index_S]; var recur_call = "rotateImage('"+place+"','"+image_link+"')"; setTimeout(recur_call, interval_S); } }