/* 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/english/images/promo_offers/Fillers/nz_kechup_en.jpg"; left_image_ALT[ALT_index++] = "Watties Tomato Sauce"; left_image_HREF[HREF_index++] = "http://www.shopnewzealand.co.nz/en/cp/Tomato_Sauce_Ketchup_575g"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/Fillers/easter_treat_en.jpg"; right_image_ALT[ALT_index_R++] = "Easter Treats"; right_image_HREF[HREF_index_R++] = "http://www.shopnewzealand.co.nz/en/c/Easter_Candy"; left_image_list[image_index++] = "includes/languages/english/images/promo_offers/Fillers/glosst_glass_en.jpg"; left_image_ALT[ALT_index++] = "Glass Tableware"; left_image_HREF[HREF_index++] = "http://www.shopnewzealand.co.nz/en/c/Home_Garden/JULIE_O_HANDCRAFTED_GLASSWARE"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/Fillers/fairydown_cover_en.jpg"; right_image_ALT[ALT_index_R++] = "Fairydown Blankets"; right_image_HREF[HREF_index_R++] = "http://www.shopnewzealand.co.nz/en/c/Fairydown"; left_image_list[image_index++] = "includes/languages/english/images/promo_offers/Fillers/canterbury_newboots_en.jpg"; left_image_ALT[ALT_index++] = "Canterbury Sheepskin Boots"; left_image_HREF[HREF_index++] = "http://www.shopnewzealand.co.nz/en/c/Wool_Boots"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/Fillers/runga_newarrival_en.jpg"; right_image_ALT[ALT_index_R++] = "Boh Runga Jewellery"; right_image_HREF[HREF_index_R++] = "http://www.shopnewzealand.co.nz/en/c/Feather_Kisses_Silver_Jewerly"; sky_image_list[image_index_S++] = "includes/languages/english/images/promo_offers/Fillers/body_by_nature_goat20_en.jpg"; sky_image_ALT[ALT_index_S++] = "Body By Nature Goats Milk"; sky_image_HREF[HREF_index_S++] = "http://www.shopnewzealand.co.nz/en/cp/Powder_Milk"; sky_image_list[image_index_S++] = "includes/languages/english/images/promo_offers/Fillers/gs_chocolate_rush_en.jpg"; sky_image_ALT[ALT_index_S++] = "Organic Cookie Delights"; sky_image_HREF[HREF_index_S++] = "http://www.shopnewzealand.co.nz/en/c/Organic_Cookie_Delights"; //************************************************************************************************ 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); } }