/* 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/activon_new_en.jpg"; left_image_ALT[ALT_index++] = "Activon Medical Honey"; left_image_HREF[HREF_index++] = "http://www.thehealthstore.co.nz/en/c/Advancis_Medical"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/Fillers/flu&cols_en.jpg"; right_image_ALT[ALT_index_R++] = "Cold Remedies"; right_image_HREF[HREF_index_R++] = "http://www.thehealthstore.co.nz/en/c/Cough_Cold_and_Flu"; left_image_list[image_index++] = "includes/languages/english/images/promo_offers/Fillers/healthy&happyb_en.jpg"; left_image_ALT[ALT_index++] = "Baby Health Products"; left_image_HREF[HREF_index++] = "http://www.thehealthstore.co.nz/en/c/Mother_and_Baby"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/Fillers/herb_farm_en.jpg"; right_image_ALT[ALT_index_R++] = "The Herb Farm"; right_image_HREF[HREF_index_R++] = "http://www.thehealthstore.co.nz/en/cp/Stressfree_Purse_Pack"; sky_image_list[image_index_S++] = "includes/languages/english/images/promo_offers/Fillers/back_pain_relife_en.jpg"; sky_image_ALT[ALT_index_S++] = "Relief From Back Pain"; sky_image_HREF[HREF_index_S++] = "http://www.thehealthstore.co.nz/en/c/Back_Pain"; sky_image_list[image_index_S++] = "includes/languages/english/images/promo_offers/Fillers/bbn_savepack_en.jpg"; sky_image_ALT[ALT_index_S++] = "Body By Nature"; sky_image_HREF[HREF_index_S++] = "http://www.thehealthstore.co.nz/en/c/Body_Nature"; //************************************************************************************************ 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); } }