//==================================================== //CREATE ARRAY OF PRODUCTS //==================================================== Product_Name = new Array(); Product_Pic = new Array(); Product_Name[0] = "test"; Product_Pic[0] = new Image(); Product_Pic[0].src = "picture_library/slides/original/21_532_974_WS.jpg"; Product_Name[1] = " "; Product_Pic[1] = new Image(); Product_Pic[1].src = "picture_library/slides/original/31_schonbeck gallia.jpg"; Product_Name[2] = "Bedrooms by Lexington"; Product_Pic[2] = new Image(); Product_Pic[2].src = "picture_library/slides/original/23_01_0801_174C_2.jpg"; Product_Name[3] = " "; Product_Pic[3] = new Image(); Product_Pic[3].src = "picture_library/slides/original/22_329_537_01_silo.jpg"; Product_Name[4] = " "; Product_Pic[4] = new Image(); Product_Pic[4].src = "picture_library/slides/original/25_01_0801_968_2.jpg"; Product_Name[5] = " "; Product_Pic[5] = new Image(); Product_Pic[5].src = "picture_library/slides/original/26_7640-11R.jpg"; Product_Name[6] = "hb"; Product_Pic[6] = new Image(); Product_Pic[6].src = "picture_library/slides/original/30_sitcom.jpg"; Product_Name[7] = " "; Product_Pic[7] = new Image(); Product_Pic[7].src = "picture_library/slides/original/32_866_9385_Hamilton_Black_Crystal_Chandelier_by_Schonbek_e92889d0c708_zoom.jpg"; Product_Name[8] = " "; Product_Pic[8] = new Image(); Product_Pic[8].src = "picture_library/slides/original/35_kalkin-roomdivider.jpg"; Product_Name[9] = " "; Product_Pic[9] = new Image(); Product_Pic[9].src = "picture_library/slides/original/37_LL_1865_11_9505_72_Silo.jpg"; //==================================================== //DOCUMENT READY //==================================================== var AllProducts = Product_Name.length - 1; var Timer; var CurrentDisplay = 0; //==================================================== //DOCUMENT READY //==================================================== $(document).ready(function(){ //Load Initial Product if(Product_Name[0] == "") { alert('no products'); } else { TimedSwitch(); } //FADER LOADER $("#home_fader").animate({ opacity: 0 }, 1); $("#home_product_info").animate({ opacity: 0 }, 1); $("#home_welcome_fader").animate({ opacity: 0 }, 1); document.getElementById('home_fader').style.display="block"; document.getElementById('home_product_info').style.visibility="visible"; $("#home_fader").animate({ opacity: 0.6 }, 1000, function() { $("#home_product_info").animate({ opacity: 1 }, 1000); }); }); function TimedSwitch() { HomeSwitch(CurrentDisplay); CurrentDisplay = CurrentDisplay + 1; if(CurrentDisplay > AllProducts) { CurrentDisplay = 0; } Timer=setTimeout("TimedSwitch()",7000); } function HomeSwitch(Index) { $("#home_product_picture").animate({ opacity: 0 }, 500, function() { document.getElementById('home_product_picture').style.backgroundImage='url('+Product_Pic[Index].src+')'; //document.getElementById('home_product_picture').src = Product_Pic[Index].src; $("#home_product_name").text(Product_Name[Index]); $("#home_product_picture").animate({ opacity: 1 }, 500) }); }