/** * Image src URLs */ var imageList = ["/artists_pics/109_carousel.jpg", "/artists_pics/151_carousel.jpg", "/artists_pics/172_carousel.jpg", "/artists_pics/163_carousel.jpg", "/artists_pics/294_carousel.jpg", "/artists_pics/108_carousel.jpg", "/artists_pics/88_carousel.jpg", "/artists_pics/231_carousel.jpg", "/artists_pics/155_carousel.jpg", "/artists_pics/196_carousel.jpg", "/artists_pics/114_carousel.jpg", "/artists_pics/125_carousel.jpg", "/artists_pics/125_carousel.jpg", "/artists_pics/108_carousel.jpg", "/artists_pics/203_carousel.jpg", "/artists_pics/195_carousel.jpg", "/artists_pics/127_carousel.jpg", "/artists_pics/177_carousel.jpg", "/artists_pics/203_carousel.jpg", "/artists_pics/231_carousel.jpg", "/artists_pics/167_carousel.jpg", "/artists_pics/128_carousel.jpg", "/artists_pics/90_carousel.jpg", "/artists_pics/172_carousel.jpg", "/artists_pics/124_carousel.jpg", "/artists_pics/88_carousel.jpg", "/artists_pics/94_carousel.jpg", "/artists_pics/201_carousel.jpg", "/artists_pics/151_carousel.jpg", "/artists_pics/118_carousel.jpg", "/artists_pics/221_carousel.jpg", "/artists_pics/91_carousel.jpg", "/artists_pics/166_carousel.jpg", "/artists_pics/201_carousel.jpg", "/artists_pics/107_carousel.jpg", "/artists_pics/111_carousel.jpg", "/artists_pics/100_carousel.jpg", "/artists_pics/186_carousel.jpg", "/artists_pics/168_carousel.jpg", "/artists_pics/164_carousel.jpg", "/artists_pics/113_carousel.jpg", "/artists_pics/159_carousel.jpg", "/artists_pics/124_carousel.jpg", "/artists_pics/172_carousel.jpg", "/artists_pics/175_carousel.jpg", "/artists_pics/151_carousel.jpg", "/artists_pics/241_carousel.jpg", "/artists_pics/175_carousel.jpg", "/artists_pics/165_carousel.jpg", "/artists_pics/171_carousel.jpg", "/artists_pics/125_carousel.jpg", "/artists_pics/188_carousel.jpg", "/artists_pics/203_carousel.jpg", "/artists_pics/157_carousel.jpg", "/artists_pics/124_carousel.jpg", "/artists_pics/159_carousel.jpg", "/artists_pics/100_carousel.jpg", "/artists_pics/177_carousel.jpg", "/artists_pics/127_carousel.jpg", "/artists_pics/100_carousel.jpg", "/artists_pics/196_carousel.jpg", "/artists_pics/122_carousel.jpg", "/artists_pics/241_carousel.jpg", "/artists_pics/127_carousel.jpg", "/artists_pics/194_carousel.jpg", "/artists_pics/294_carousel.jpg", "/artists_pics/294_carousel.jpg", "/artists_pics/137_carousel.jpg", "/artists_pics/143_carousel.jpg", "/artists_pics/121_carousel.jpg", "/artists_pics/91_carousel.jpg", "/artists_pics/186_carousel.jpg", "/artists_pics/116_carousel.jpg", "/artists_pics/109_carousel.jpg", "/artists_pics/241_carousel.jpg"]; var imageListTitle = ["Max MacAndrews @ Old Town", "Jo Harrison @ Modern Body Art", "Horimyo @ 13 Project", "Adam da Punk @ New Wave Tattoo Studio", "Rob Ratcliffe @ Border Rose Tattoo", "Gray Silva @ Rampant Ink", "George Bardadim @ Bardadim", "Sween @ 21st Century Tattoo", "Hazel Nicholls @ Design 4 Life", "Andy @ Mystery Touch Tattoo", "Ian & Jim @ Comedian Tattoo", "Woody @ Woodys Tattoo Studio", "Woody @ Woodys Tattoo Studio", "Gray Silva @ Rampant Ink", "Rob Hoskins @ Idle Hand Tattoo", "Naresh @ Flamin Eight Tattoo", "Robin @ Squid Ink", "Terry Fuller @ Full On Ink", "Rob Hoskins @ Idle Hand Tattoo", "Sween @ 21st Century Tattoo", "Mac @ Punctured Body Piercing", "Jin O @ Middleton Tattoo Studio", "Suzi Q @ Hold Fast Tattoo", "Horimyo @ 13 Project", "Lal Hardy @ New Wave Tattoo", "George Bardadim @ Bardadim", "Patrick @ Tattoo Mangon", "Sister Sammy @ Fallen Angel", "Jo Harrison @ Modern Body Art", "Chris Jones @ Physical Graffiti", "Jason Butcher @ Immortal Ink", "Cory Ferguson @ Enlightened Art", "Johnna McCreary @ Liquid Courage", "Sister Sammy @ Fallen Angel", "Bez @ Triplesix Studios", "Gary Wiedenhof @ Inkredible...", "Paris Pierides @ Paris Tattoos", "Leo @ Naked Trust Tattoo", "Mick & Keith @ Underground", "Luca @ New Wave Tattoo", "Cooky @ Artful Ink", "Needles @ Monkey Mojo", "Lal Hardy @ New Wave Tattoo", "Horimyo @ 13 Project", "Milosch @ Milosch Tattoo", "Jo Harrison @ Modern Body Art", "Dave & Wendy @ Tribal Child", "Milosch @ Milosch Tattoo", "Graham & Marcus @ Holier Than Thou", "Hata @ Ink Rat Tattoo", "Woody @ Woodys Tattoo Studio", "Ezequiel 'Eze' Nunez @ Ezequiel Tattoo", "Rob Hoskins @ Idle Hand Tattoo", "Wes Diffie @ Against The Grain Tattoo", "Lal Hardy @ New Wave Tattoo", "Needles @ Monkey Mojo", "Paris Pierides @ Paris Tattoos", "Terry Fuller @ Full On Ink", "Robin @ Squid Ink", "Paris Pierides @ Paris Tattoos", "Andy @ Mystery Touch Tattoo", "John Treharne @ Skin Creation", "Dave & Wendy @ Tribal Child", "Robin @ Squid Ink", "Daveee @ Kult Tattoo", "Rob Ratcliffe @ Border Rose Tattoo", "Rob Ratcliffe @ Border Rose Tattoo", "Gerrit @ Tattoo Mania", "Rick @ Veni Vidi Vici Tattoo", "Shaun @ Images On Skin", "Cory Ferguson @ Enlightened Art", "Leo @ Naked Trust Tattoo", "Roy & Paul Priestly @ Skin Shokz", "Max MacAndrews @ Old Town", "Dave & Wendy @ Tribal Child"]; var imageListLink = ["/Artists/31/Max_MacAndrews___Old_Town", "/Artists/87/Jo_Harrison___Modern_Body_Art", "/Artists/107/Horimyo___13_Project", "/Artists/103/Adam_da_Punk___New_Wave_Tattoo_Studio", "/Artists/32/Rob_Ratcliffe___Border_Rose_Tattoo", "/Artists/30/Gray_Silva___Rampant_Ink", "/Artists/12/George_Bardadim___Bardadim", "/Artists/48/Sween___21st_Century_Tattoo", "/Artists/91/Hazel_Nicholls___Design_4_Life", "/Artists/129/Andy___Mystery_Touch_Tattoo", "/Artists/36/Ian___Jim___Comedian_Tattoo", "/Artists/47/Woody___Woodys_Tattoo_Studio", "/Artists/47/Woody___Woodys_Tattoo_Studio", "/Artists/30/Gray_Silva___Rampant_Ink", "/Artists/131/Rob_Hoskins___Idle_Hand_Tattoo", "/Artists/128/Naresh___Flamin_Eight_Tattoo", "/Artists/49/Robin___Squid_Ink", "/Artists/117/Terry_Fuller___Full_On_Ink", "/Artists/131/Rob_Hoskins___Idle_Hand_Tattoo", "/Artists/48/Sween___21st_Century_Tattoo", "/Artists/82/Mac___Punctured_Body_Piercing", "/Artists/50/Jin_O___Middleton_Tattoo_Studio", "/Artists/14/Suzi_Q___Hold_Fast_Tattoo", "/Artists/107/Horimyo___13_Project", "/Artists/46/Lal_Hardy___New_Wave_Tattoo", "/Artists/12/George_Bardadim___Bardadim", "/Artists/18/Patrick___Tattoo_Mangon", "/Artists/130/Sister_Sammy___Fallen_Angel", "/Artists/87/Jo_Harrison___Modern_Body_Art", "/Artists/40/Chris_Jones___Physical_Graffiti", "/Artists/89/Jason_Butcher___Immortal_Ink", "/Artists/15/Cory_Ferguson___Enlightened_Art", "/Artists/106/Johnna_McCreary___Liquid_Courage", "/Artists/130/Sister_Sammy___Fallen_Angel", "/Artists/29/Bez___Triplesix_Studios", "/Artists/33/Gary_Wiedenhof___Inkredible___", "/Artists/23/Paris_Pierides___Paris_Tattoos", "/Artists/121/Leo___Naked_Trust_Tattoo", "/Artists/81/Mick___Keith___Underground", "/Artists/104/Luca___New_Wave_Tattoo", "/Artists/35/Cooky___Artful_Ink", "/Artists/94/Needles___Monkey_Mojo", "/Artists/46/Lal_Hardy___New_Wave_Tattoo", "/Artists/107/Horimyo___13_Project", "/Artists/115/Milosch___Milosch_Tattoo", "/Artists/87/Jo_Harrison___Modern_Body_Art", "/Artists/80/Dave___Wendy___Tribal_Child", "/Artists/115/Milosch___Milosch_Tattoo", "/Artists/105/Graham___Marcus___Holier_Than_Thou", "/Artists/108/Hata___Ink_Rat_Tattoo", "/Artists/47/Woody___Woodys_Tattoo_Studio", "/Artists/123/Ezequiel__Eze__Nunez___Ezequiel_Tattoo", "/Artists/131/Rob_Hoskins___Idle_Hand_Tattoo", "/Artists/92/Wes_Diffie___Against_The_Grain_Tattoo", "/Artists/46/Lal_Hardy___New_Wave_Tattoo", "/Artists/94/Needles___Monkey_Mojo", "/Artists/23/Paris_Pierides___Paris_Tattoos", "/Artists/117/Terry_Fuller___Full_On_Ink", "/Artists/49/Robin___Squid_Ink", "/Artists/23/Paris_Pierides___Paris_Tattoos", "/Artists/129/Andy___Mystery_Touch_Tattoo", "/Artists/44/John_Treharne___Skin_Creation", "/Artists/80/Dave___Wendy___Tribal_Child", "/Artists/49/Robin___Squid_Ink", "/Artists/127/Daveee___Kult_Tattoo", "/Artists/32/Rob_Ratcliffe___Border_Rose_Tattoo", "/Artists/32/Rob_Ratcliffe___Border_Rose_Tattoo", "/Artists/68/Gerrit___Tattoo_Mania", "/Artists/85/Rick___Veni_Vidi_Vici_Tattoo", "/Artists/43/Shaun___Images_On_Skin", "/Artists/15/Cory_Ferguson___Enlightened_Art", "/Artists/121/Leo___Naked_Trust_Tattoo", "/Artists/38/Roy___Paul_Priestly___Skin_Shokz", "/Artists/31/Max_MacAndrews___Old_Town", "/Artists/80/Dave___Wendy___Tribal_Child"]; var lastRan = -1; var fmtItem = function(imgUrl, url, title, index) { var innerHTML = '<\/a>'; return innerHTML; }; /** * Custom inital load handler. Called when the carousel loads the initial * set of data items. Specified to the carousel as the configuration * parameter: loadInitHandler **/ var loadInitialItems = function(type, args) { var start = args[0]; var last = args[1]; load(this, start, last); }; /** * Custom load next handler. Called when the carousel loads the next * set of data items. Specified to the carousel as the configuration * parameter: loadNextHandler **/ var loadNextItems = function(type, args) { var start = args[0]; var last = args[1]; var alreadyCached = args[2]; if(!alreadyCached) { load(this, start, last); } }; /** * Custom load previous handler. Called when the carousel loads the previous * set of data items. Specified to the carousel as the configuration * parameter: loadPrevHandler **/ var loadPrevItems = function(type, args) { var start = args[0]; var last = args[1]; var alreadyCached = args[2]; if(!alreadyCached) { load(this, start, last); } }; var load = function(carousel, start, last) { for(var i=start;i<=last;i++) { var liItem = carousel.addItem(i, fmtItem(imageList[i], imageListLink[i], imageListTitle[i], i)); /* // If you want to add handlers for mouse over, mouse out or other events, // here is the pattern YAHOO.util.Event.addListener(liItem, "mouseover", function(e) { //console.log("mouseover>>"+this.id); }); YAHOO.util.Event.addListener(liItem, "mouseout", function(e) { //console.log("mouseout<<"+this.id); }); */ } } /** * Custom button state handler for enabling/disabling button state. * Called when the carousel has determined that the previous button * state should be changed. * Specified to the carousel as the configuration * parameter: prevButtonStateHandler **/ var handlePrevButtonState = function(type, args) { var enabling = args[0]; var leftImage = args[1]; if(enabling) { leftImage.src = "images/left-enabled.gif"; } else { leftImage.src = "images/left-disabled.gif"; } }; var carousel; // for ease of debugging; globals generally not a good idea /** * You must create the carousel after the page is loaded since it is * dependent on an HTML element (in this case 'dhtml-carousel'.) See the * HTML code below. */ var pageLoad = function() { carousel = new YAHOO.extension.Carousel("dhtml-carousel", { numVisible: 9, animationSpeed: 0.5, scrollInc: 1, navMargin: 40, prevElement: "prev-arrow", nextElement: "next-arrow", loadInitHandler: loadInitialItems, loadNextHandler: loadNextItems, loadPrevHandler: loadPrevItems, prevButtonStateHandler: handlePrevButtonState, autoPlay: 3000, size: 30, wrap:true } ); }; // YAHOO.extension.Carousel.prototype.startAutoPlay = function(interval) { // if(this._isValidObj(interval)) { // this.autoPlay = interval; // } // if(this.autoPlayTimer !== null) { // return this.autoPlayTimer; // } // var oThis = this; // var autoScroll = function() { oThis.scrollPrev(); }; // this.autoPlayTimer = setTimeout( autoScroll, this.autoPlay ); // return this.autoPlayTimer; // }; // // YAHOO.extension.Carousel.prototype.scrollPrev= function() { // this._scrollPrev(null, this); // this.autoPlayTimer = null; // if(this.autoPlay !== 0) { // this.autoPlayTimer = this.startAutoPlay(); // } // }; // // YAHOO.extension.Carousel.prototype._scrollPrev = function(e, carousel) { // if(carousel.scrollPrevAnim.isAnimated()) { // return false; // } // var currStart = carousel.firstVisible; // if(carousel.wrap && currStart == 1) { // carousel.scrollTo(carousel.size - carousel.numVisible + 1); // } else if(e !== null) { // event fired this so disable autoplay // carousel.stopAutoPlay(); // carousel._scrollPrevInc(carousel, carousel.scrollInc, (carousel.getProperty("animationSpeed") !== 0)); // } else { // carousel._scrollPrevInc(carousel, carousel.scrollInc, (carousel.getProperty("animationSpeed") !== 0)); // } // }; /** * Illustrates stop autoplay */ var stopAutoPlay = function(e) { YAHOO.util.Dom.get("status").innerHTML = "Auto Play Stopped!"; carousel.stopAutoPlay(); }; /** * Illustrates start autoplay */ var startAutoPlay = function(e) { YAHOO.util.Dom.get("status").innerHTML = "Auto Play Started!"; carousel.startAutoPlay(2000); }; YAHOO.util.Event.addListener(window, 'load', pageLoad); YAHOO.util.Event.addListener("stop-button", 'click', stopAutoPlay); YAHOO.util.Event.addListener("start-button", 'click', startAutoPlay);