var pic_list = new Array(); var link_list = new Array(); pic_list[0] = "lead_management.jpg"; pic_list[1] = "auto_emails.jpg"; pic_list[2] = "scenario_calculator.jpg"; pic_list[3] = "custom_reports.jpg"; pic_list[4] = "prospect_mining.jpg"; pic_list[5] = "accelerating_leads.jpg"; link_list[0] = "loxfeatures.html"; link_list[1] = "lead_integration.html"; link_list[2] = "auto_emails.html"; link_list[3] = "scenario_calculator.html"; link_list[4] = "custom_reports.html"; link_list[5] = "prospect_mining.html"; var shuffleTimer, timer1, timer2, timer3; //allow to use clearTimeout var slideshowLength = 9000; var current_pic = 1; var through_once = false; var toggle = false; var slideshow_active = true; function fade_out (dur) { new Effect.Parallel ([ //new Effect.Scale ('main_pic', 1, { sync: true, scaleFromCenter: true, scaleFrom: 100.0 } ), new Effect.Opacity ('main_pic2', {sync: true, from: 1, to: 0} ) ], { duration: dur } ); } function fade_in (dur) { new Effect.Parallel ([ //new Effect.Scale ('main_pic', 100, { sync: true, scaleFromCenter: true, scaleFrom: 0 } ), new Effect.Opacity ('main_pic2', {sync: true, from: 0, to: 1} ) ], { duration: dur } ); } function start_shuffle () { if (slideshow_active) { if (current_pic >= pic_list.length) { current_pic = 0; through_once = false; } next_pic = current_pic + 1; if (next_pic >= pic_list.length) { next_pic = 0; } if (toggle) { fade_in(1); timer1 = setTimeout ("$('main_pic').src = 'images/slideshow/" + pic_list[current_pic] + "';", 1500); toggle = false; } else { fade_out(1); timer2 = setTimeout ("$('main_pic2').src = 'images/slideshow/" + pic_list[current_pic] + "';", 1500); toggle = true; } $('main_pic_link').href = 'home/' + link_list[current_pic]; $('main_pic2_link').href = 'home/' + link_list[current_pic]; shuffleTimer = setTimeout ("start_shuffle()", slideshowLength); //PRE-LOAD NEXT IMAGE: if (! through_once) { nextimg = new Image; nextimg.src = 'images/slideshow/' + pic_list[next_pic]; } current_pic++; } } function feature_change(e) { box = $A(arguments)[1]; pic = $A(arguments)[2]; link = $A(arguments)[3]; tab = $A(arguments)[4]; //stop slideshow stop_slideshow(); //set top pic if (toggle) top_pic = $('main_pic'); else top_pic = $('main_pic2'); if (toggle) top_div = $('feature_image_div'); else top_div = $('hidden_image_div'); //replace with current picture/link top_pic.src='/loxpress/images/slideshow/' + pic; $('main_pic2_link').href = link; $('main_pic_link').href = link; //show correct tab tabs = $$('.rightTab'); for (x = 0; x < tabs.length; x++) { tabs[x].hide(); } $('tab' + tab).show(); //add listener so will stick on main image /* Event.stopObserving ('feature_image_div'); Event.stopObserving ('hidden_image_div'); Event.observe (top_div, 'mouseover', feature_change.bindAsEventListener (top_div, box, pic, link, tab)); Event.observe(top_div, 'mouseout', function(event) { Event.stopObserving ('feature_image_div'); Event.stopObserving ('hidden_image_div'); stop_slideshow(); timer3 = setTimeout ("restart_slideshow()", 500); } ); */ } function restart_slideshow() { //Event.stopObserving ('feature_image_div'); //Event.stopObserving ('hidden_image_div'); tabs = $$('.rightTab'); for (x = 0; x < tabs.length; x++) { tabs[x].hide(); } if (!toggle) { $('main_pic').src = '/loxpress/images/slideshow/lead_management.jpg'; $('main_pic2').src='/loxpress/images/slideshow/accelerating_leads.jpg'; } else { $('main_pic2').src = '/loxpress/images/slideshow/lead_management.jpg'; $('main_pic').src='/loxpress/images/slideshow/accelerating_leads.jpg'; } $('main_pic_link').href='loxfeatures.html'; $('main_pic2_link').href='loxfeatures.html'; current_pic = 1; // toggle = true; slideshow_active = true; shuffleTimer = setTimeout ("start_shuffle();", slideshowLength); } function stop_slideshow() { slideshow_active = false; // Event.stopObserving ('main_pic'); // Event.stopObserving ('main_pic2'); clearTimeout (shuffleTimer); clearTimeout (timer1); clearTimeout (timer2); clearTimeout (timer3); } function load_mouseovers () { Event.observe ('lead_integration_box', 'mouseover', feature_change.bindAsEventListener (window, 'lead_integration_box', 'lead_management.jpg', 'home/lead_integration.html', '1') ); Event.observe ('auto_emails_box', 'mouseover', feature_change.bindAsEventListener (window, 'auto_emails_box', 'auto_emails.jpg', 'home/auto_emails.html', '2') ); Event.observe ('scenario_calculator_box', 'mouseover', feature_change.bindAsEventListener (window, 'scenario_calculator_box', 'scenario_calculator.jpg', 'home/scenario_calculator.html', '3') ); Event.observe ('custom_reporting_box', 'mouseover', feature_change.bindAsEventListener (window, 'custom_reporting_box', 'custom_reports.jpg', 'home/custom_reporting.html', '4') ); Event.observe ('prospect_mining_box', 'mouseover', feature_change.bindAsEventListener (window, 'prospect_mining_box', 'prospect_mining.jpg', 'home/prospect_mining.html', '5') ); Event.observe ('lead_integration_box', 'mouseout', function () { timer3 = setTimeout("restart_slideshow()", slideshowLength); } ); Event.observe ('auto_emails_box', 'mouseout', function () { timer3 = setTimeout("restart_slideshow()", slideshowLength); } ); Event.observe ('scenario_calculator_box', 'mouseout', function () { timer3 = setTimeout("restart_slideshow()", slideshowLength); } ); Event.observe ('custom_reporting_box', 'mouseout', function () { timer3 = setTimeout("restart_slideshow()", slideshowLength); } ); Event.observe ('prospect_mining_box', 'mouseout', function () { timer3 = setTimeout("restart_slideshow()", slideshowLength); } ); } function rand(top_range) { var now=new Date(); var num=(now.getSeconds())%top_range; var num=num+1; return num; } Event.observe (window, 'load', function() {load_mouseovers();} ); Event.observe (window, 'load', function() { shuffleTimer = setTimeout ("start_shuffle();", slideshowLength); }, false); Event.observe (window, 'load', function() { $('feature_image_div').show(); }, false); //Show random Testimonials content /* Event.observe (window, 'load', function() { contentBlocks = $$('.bottomContent'); for (x = 0; x < contentBlocks.length; x++) { contentBlocks[x].hide(); } num = rand (contentBlocks.length); if (Object.isElement ($('bottom_section_' + num))) $('bottom_section_' + num).show(); }); */ linkHover = function() { links = $$('.featureGreenBox'); for (x = 0; x < links.length; x++) { //add to ul links[x].onmouseenter=function() { this.className+=" featureGreenBoxHover"; this.className+=" featureGreenBoxHover"; } links[x].onmouseleave=function() { this.className=this.className.replace(new RegExp(" featureGreenBoxHover\\b"), ""); this.className=this.className.replace(new RegExp(" featureGreenBoxHover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", linkHover);