/* 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/jointamine_save20_en.jpg"; left_image_ALT[ALT_index++] = "NEW PRODUCT Save 20% off Jointamine dietary supplement. Made from Green Lipped Mussel Oil, Hoki Oil and Omega-3 fatty acids. For Joint Care and Maintenance."; left_image_HREF[HREF_index++] = "http://www.thehealthstore.co.nz/en/cp/Natural_Joint_Supplement"; right_image_list[image_index_R++] = "includes/languages//english/images/promo_offers/Fillers/mother_well_bath_en.jpg"; right_image_ALT[ALT_index_R++] = "Mother Health"; right_image_HREF[HREF_index_R++] = "http://www.thehealthstore.co.nz/en/c/Mother_Health"; left_image_list[image_index++] = "includes/languages//english/images/promo_offers/Fillers/comvita_medical_h_50g_en.jpg"; left_image_ALT[ALT_index++] = "Medihoney and Honey Cream"; left_image_HREF[HREF_index++] = "http://www.thehealthstore.co.nz/en/cp/Medical_Honey?osCsid=931n2n3b3j1l36bfaq5tjd1936"; right_image_list[image_index_R++] = "includes/languages//english/images/promo_offers/Fillers/riolife_acai_en.jpg"; right_image_ALT[ALT_index_R++] = "Acai Berry"; right_image_HREF[HREF_index_R++] = "http://www.thehealthstore.co.nz/en/cp/Acai_Berry"; sky_image_list[image_index_S++] = "includes/languages//english/images/promo_offers/Fillers/nz_health_umfjar_en.jpg"; sky_image_ALT[ALT_index_S++] = "NZ Manuka Honey"; sky_image_HREF[HREF_index_S++] = "http://www.thehealthstore.co.nz/advanced_search_result.php?keywords=&search_in_cat=1&search_in_description=1&x=0&y=0&categories_id=&inc_subcat=1&manufacturers_id=253&pfrom=0&pto=899999&dfrom=&dto="; sky_image_list[image_index_S++] = "includes/languages//english/images/promo_offers/Fillers/manukax_propolis_en.jpg"; sky_image_ALT[ALT_index_S++] = "Propolis Capsules"; sky_image_HREF[HREF_index_S++] = "http://www.thehealthstore.co.nz/en/cp/Bee_Products"; //************************************************************************************************ 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); } }