/* 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/2011/gh_5for1_en.jpg"; left_image_ALT[ALT_index++] = "Buy 5 bottles Strawberry Colostrum Chewable,150 tablets and get 1 bottle Free"; left_image_HREF[HREF_index++] = "http://www.thehealthstore.co.nz/en/cp/Supplements_Colostrum"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/2011/mah_free_suckles_en.jpg"; right_image_ALT[ALT_index_R++] = "Buy 3 x Manuka Honey Kids Syrup, and get a Free MGO 400+ Honey Suckles Lozenges 100g"; right_image_HREF[HREF_index_R++] = "http://www.thehealthstore.co.nz/en/cp/Immune_System_Support"; left_image_list[image_index++] = "includes/languages/english/images/promo_offers/2011/com_free_bodywash_en.jpg"; left_image_ALT[ALT_index++] = "Purchase a Medihoney Gentle Body Lotion and get a Free Medihoney Gentle Body Wash –200ml"; left_image_HREF[HREF_index++] = "http://www.thehealthstore.co.nz/en/cp/Medihoney_Antibacterial_Honey"; right_image_list[image_index_R++] = "includes/languages/english/images/promo_offers/2011/nzs_20off_en.jpg"; right_image_ALT[ALT_index_R++] = "Nature Source Products 20% off"; right_image_HREF[HREF_index_R++] = "http://www.thehealthstore.co.nz/en/c/Natures_Source"; sky_image_list[image_index_S++] = "includes/languages/english/images/promo_offers/2011/free_calendar_2012_en.jpg"; sky_image_ALT[ALT_index_S++] = "Purchase NZ$ 100.00 and above in a single order Get a Free 2012 calendar ( worth NZ $19.90) While stock last"; sky_image_HREF[HREF_index_S++] = "http://www.thehealthstore.co.nz"; //************************************************************************************************ 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); } }