var splash_current_item = 0; var splash_img_width = 624; var splash_active = false; var splash_playing = true; var splash_items = Array("/sites/default/files/home-splash-image-001.jpg","/sites/default/files/home-splash-image-002.jpg","/sites/default/files/home-splash-image-004.jpg","/sites/default/files/home-splash-image-003.jpg","/sites/default/files/home-splash-image-005.jpg") var splash_info = Array("Start a Home Recycling Program Today!|Check out ecolife\'s a-z recycling guide","Discover Voluntourism on Your Next Vacation|Check out our guide on taking a meaningful trip","Get the Worm Composting Low-Down|Discover how to start a worm compost","Facial Care Without Chemicals|Our complete guide to natural facial care","Baby Bath Time|Wash your Baby with Natural Baby Shampoos and Soaps"); var splash_urls = Array("/recycling/tips-basics/home-recycling.html","/travel/voluntourism/guide-to-volunteer-holidays.html","/garden/composting/worm-composting-how-to-guide.html","/beauty/natural-facial-care/organic-skin-care.html","/parenting/organic-baby-body/natural-baby-soap-shampoo.html"); var splash_nav_items = "
"; var splash_imgs = ""; var splash_info_divs = ""; var splash_timer = ""; var splash_btn = "/sites/all/themes/ecolife/images/home-splash-control-item.png"; var splash_btn_trans = "/sites/all/themes/ecolife/images/home-splash-control-active.png"; var splash_btn_active = "/sites/all/themes/ecolife/images/home-splash-control-active.png"; var splash_btn_pause = "/sites/all/themes/ecolife/images/home-splash-control-pause.png"; var splash_btn_play = "/sites/all/themes/ecolife/images/home-splash-control-play.png"; function splash(){ for(i=0;i"; splash_info_split = splash_info[i].split("|"); splash_info_divs += "
" + splash_info_split[0] + "
" + splash_info_split[1] + "
"; } splash_imgs += "\"\"\"\"\"\""; splash_nav_items += "\"\""; splash_nav_items += "
Read More
"; document.getElementById("home-splash-control").innerHTML = splash_nav_items; document.getElementById("home-splash_nav_0").src = splash_btn_active; document.getElementById("home-splash-img").style.width = splash_img_width * splash_items.length + "px"; document.getElementById("home-splash-img").innerHTML = splash_imgs; document.getElementById("home-splash-info").innerHTML = splash_info_divs; $("#home-splash_info_div_0").fadeIn(); splash_timer = setTimeout("splash_next()", 3500); document.getElementById('home-splash-click').href = splash_urls[0]; document.getElementById('home-splash_nav_read_url').href = splash_urls[0]; } function splash_next(){ if( splash_current_item < ( splash_items.length - 1) ){ splash_select( splash_current_item + 1 ); } else{ splash_select(0); } } function splash_complete(){ splash_active = false; document.getElementById("home-splash_nav_" + splash_current_item).src = splash_btn_active; $("#home-splash_info_div_" + splash_current_item).fadeIn(); if( splash_playing ){ splash_timer = setTimeout("splash_next()", 3500); } } function splash_select(item){ if( splash_active == false ){ splash_active = true; clearTimeout(splash_timer); if( splash_current_item !== item ){ document.getElementById("home-splash_nav_" + splash_current_item).src = splash_btn; document.getElementById("home-splash_nav_" + item).src = splash_btn_trans; var old_item = splash_current_item; var new_item = item; var last_item = splash_items.length - 1; $("#home-splash_info_div_" + splash_current_item).fadeOut(); splash_current_item = item; if( splash_current_item == last_item ){ var next_item = 0; } else{ var next_item = splash_current_item + 1; } //$("#splash_img_bottom").attr('src', splash_items[ old_item ]; $("#splash_img_top").attr('src', splash_items[ new_item ]); $("#splash_img_top").fadeIn('slow', function() { $("#splash_img_bottom").attr('src', splash_items[ new_item ]); $("#splash_img_top").hide(); $("#splash_img_pre").attr('src', splash_items[ next_item ]); splash_complete(); }); document.getElementById('home-splash-click').href = splash_urls[ splash_current_item ]; document.getElementById('home-splash_nav_read_url').href = splash_urls[ splash_current_item ]; } } } function togglePlay(){ if( splash_playing ){ splash_playing = false; clearTimeout(splash_timer); document.getElementById('home-splash_nav_pause').src = splash_btn_play; } else if( !splash_playing ){ splash_playing = true; splash_next(); clearTimeout(splash_timer); document.getElementById('home-splash_nav_pause').src = splash_btn_pause; } }