/** * Image src URLs */ var imageList = ["/artists_pics/151_carousel.jpg", "/artists_pics/186_carousel.jpg", "/artists_pics/172_carousel.jpg", "/artists_pics/111_carousel.jpg", "/artists_pics/114_carousel.jpg", "/artists_pics/112_carousel.jpg", "/artists_pics/176_carousel.jpg", "/artists_pics/142_carousel.jpg", "/artists_pics/178_carousel.jpg", "/artists_pics/187_carousel.jpg", "/artists_pics/104_carousel.jpg", "/artists_pics/174_carousel.jpg", "/artists_pics/90_carousel.jpg", "/artists_pics/174_carousel.jpg", "/artists_pics/85_carousel.jpg", "/artists_pics/152_carousel.jpg", "/artists_pics/80_carousel.jpg", "/artists_pics/137_carousel.jpg", "/artists_pics/112_carousel.jpg", "/artists_pics/117_carousel.jpg", "/artists_pics/118_carousel.jpg", "/artists_pics/186_carousel.jpg", "/artists_pics/115_carousel.jpg", "/artists_pics/88_carousel.jpg", "/artists_pics/102_carousel.jpg", "/artists_pics/231_carousel.jpg", "/artists_pics/176_carousel.jpg", "/artists_pics/114_carousel.jpg", "/artists_pics/206_carousel.jpg", "/artists_pics/115_carousel.jpg", "/artists_pics/188_carousel.jpg", "/artists_pics/118_carousel.jpg", "/artists_pics/174_carousel.jpg", "/artists_pics/128_carousel.jpg", "/artists_pics/163_carousel.jpg", "/artists_pics/163_carousel.jpg", "/artists_pics/122_carousel.jpg", "/artists_pics/245_carousel.jpg", "/artists_pics/164_carousel.jpg", "/artists_pics/80_carousel.jpg", "/artists_pics/239_carousel.jpg", "/artists_pics/118_carousel.jpg", "/artists_pics/90_carousel.jpg", "/artists_pics/185_carousel.jpg", "/artists_pics/194_carousel.jpg", "/artists_pics/100_carousel.jpg", "/artists_pics/142_carousel.jpg", "/artists_pics/118_carousel.jpg", "/artists_pics/80_carousel.jpg", "/artists_pics/99_carousel.jpg", "/artists_pics/94_carousel.jpg", "/artists_pics/203_carousel.jpg", "/artists_pics/194_carousel.jpg", "/artists_pics/176_carousel.jpg", "/artists_pics/185_carousel.jpg", "/artists_pics/194_carousel.jpg", "/artists_pics/164_carousel.jpg", "/artists_pics/178_carousel.jpg", "/artists_pics/201_carousel.jpg", "/artists_pics/121_carousel.jpg", "/artists_pics/175_carousel.jpg", "/artists_pics/111_carousel.jpg", "/artists_pics/125_carousel.jpg", "/artists_pics/155_carousel.jpg", "/artists_pics/182_carousel.jpg", "/artists_pics/171_carousel.jpg", "/artists_pics/92_carousel.jpg"]; var imageListTitle = ["Jo Harrison @ Modern Body Art", "Leo @ Naked Trust Tattoo", "Horimyo @ 13 Project", "Gary Wiedenhof @ Inkredible...", "Ian & Jim @ Comedian Tattoo", "Nigel Kurt @ Funhouse Tattoo", "Jack Ribeiro @ Tattoos By Jack", "Morag Sangster @ Tribe Tattoo", "Kari @ Memento Tattoo", "Cory Norris @ Classic Tattoo Studio", "Robb & Ruth @ Eternal Tattoos", "Colin Jones @ Stained Class Tattoo", "Suzi Q @ Hold Fast Tattoo", "Colin Jones @ Stained Class Tattoo", "Phil Kyle @ Magnum Opus", "Dawnii Sayers @ Painted Lady Tattoo", "Bob Tyrrell @ The Night Gallery", "Gerrit @ Tattoo Mania", "Nigel Kurt @ Funhouse Tattoo", "Nev @ Redskin Tattoo", "Chris Jones @ Physical Graffiti", "Leo @ Naked Trust Tattoo", "Gerry Carnelly @ Octopus Tattoo", "George Bardadim @ Bardadim", "Joe Myler @ JMD's Body Art", "Sween @ 21st Century Tattoo", "Jack Ribeiro @ Tattoos By Jack", "Ian & Jim @ Comedian Tattoo", "Tattoo Andy @ Off the Map Tattoo", "Gerry Carnelly @ Octopus Tattoo", "Ezequiel 'Eze' Nunez @ Ezequiel Tattoo", "Chris Jones @ Physical Graffiti", "Colin Jones @ Stained Class Tattoo", "Jin O @ Middleton Tattoo Studio", "Adam da Punk @ New Wave Tattoo Studio", "Adam da Punk @ New Wave Tattoo Studio", "John Treharne @ Skin Creation", "Artur Domagala @ Modern Body Art", "Luca @ New Wave Tattoo", "Bob Tyrrell @ The Night Gallery", "Adrian Willard @ Magnum Opus", "Chris Jones @ Physical Graffiti", "Suzi Q @ Hold Fast Tattoo", "Jeff Ortega @ Evil From The Needle", "Daveee @ Kult Tattoo", "Paris Pierides @ Paris Tattoos", "Morag Sangster @ Tribe Tattoo", "Chris Jones @ Physical Graffiti", "Bob Tyrrell @ The Night Gallery", "Bernie Luther @ Tattoo Demon", "Patrick @ Tattoo Mangon", "Rob Hoskins @ Idle Hand Tattoo", "Daveee @ Kult Tattoo", "Jack Ribeiro @ Tattoos By Jack", "Jeff Ortega @ Evil From The Needle", "Daveee @ Kult Tattoo", "Luca @ New Wave Tattoo", "Kari @ Memento Tattoo", "Sister Sammy @ Fallen Angel", "Shaun @ Images On Skin", "Milosch @ Milosch Tattoo", "Gary Wiedenhof @ Inkredible...", "Woody @ Woodys Tattoo Studio", "Hazel Nicholls @ Design 4 Life", "Mark Bailey @ Golden Dragon Tattoo", "Hata @ Ink Rat Tattoo", "Phil & Susanne @ Arctic Tattoo"]; var imageListLink = ["/Artists/87/Jo_Harrison___Modern_Body_Art", "/Artists/121/Leo___Naked_Trust_Tattoo", "/Artists/107/Horimyo___13_Project", "/Artists/33/Gary_Wiedenhof___Inkredible___", "/Artists/36/Ian___Jim___Comedian_Tattoo", "/Artists/34/Nigel_Kurt___Funhouse_Tattoo", "/Artists/116/Jack_Ribeiro___Tattoos_By_Jack", "/Artists/84/Morag_Sangster___Tribe_Tattoo", "/Artists/118/Kari___Memento_Tattoo", "/Artists/122/Cory_Norris___Classic_Tattoo_Studio", "/Artists/27/Robb___Ruth___Eternal_Tattoos", "/Artists/111/Colin_Jones___Stained_Class_Tattoo", "/Artists/14/Suzi_Q___Hold_Fast_Tattoo", "/Artists/111/Colin_Jones___Stained_Class_Tattoo", "/Artists/9/Phil_Kyle___Magnum_Opus", "/Artists/88/Dawnii_Sayers___Painted_Lady_Tattoo", "/Artists/5/Bob_Tyrrell___The_Night_Gallery", "/Artists/68/Gerrit___Tattoo_Mania", "/Artists/34/Nigel_Kurt___Funhouse_Tattoo", "/Artists/39/Nev___Redskin_Tattoo", "/Artists/40/Chris_Jones___Physical_Graffiti", "/Artists/121/Leo___Naked_Trust_Tattoo", "/Artists/37/Gerry_Carnelly___Octopus_Tattoo", "/Artists/12/George_Bardadim___Bardadim", "/Artists/25/Joe_Myler___JMD_s_Body_Art", "/Artists/48/Sween___21st_Century_Tattoo", "/Artists/116/Jack_Ribeiro___Tattoos_By_Jack", "/Artists/36/Ian___Jim___Comedian_Tattoo", "/Artists/134/Tattoo_Andy___Off_the_Map_Tattoo", "/Artists/37/Gerry_Carnelly___Octopus_Tattoo", "/Artists/123/Ezequiel__Eze__Nunez___Ezequiel_Tattoo", "/Artists/40/Chris_Jones___Physical_Graffiti", "/Artists/111/Colin_Jones___Stained_Class_Tattoo", "/Artists/50/Jin_O___Middleton_Tattoo_Studio", "/Artists/103/Adam_da_Punk___New_Wave_Tattoo_Studio", "/Artists/103/Adam_da_Punk___New_Wave_Tattoo_Studio", "/Artists/44/John_Treharne___Skin_Creation", "/Artists/90/Artur_Domagala___Modern_Body_Art", "/Artists/104/Luca___New_Wave_Tattoo", "/Artists/5/Bob_Tyrrell___The_Night_Gallery", "/Artists/136/Adrian_Willard___Magnum_Opus", "/Artists/40/Chris_Jones___Physical_Graffiti", "/Artists/14/Suzi_Q___Hold_Fast_Tattoo", "/Artists/119/Jeff_Ortega___Evil_From_The_Needle", "/Artists/127/Daveee___Kult_Tattoo", "/Artists/23/Paris_Pierides___Paris_Tattoos", "/Artists/84/Morag_Sangster___Tribe_Tattoo", "/Artists/40/Chris_Jones___Physical_Graffiti", "/Artists/5/Bob_Tyrrell___The_Night_Gallery", "/Artists/22/Bernie_Luther___Tattoo_Demon", "/Artists/18/Patrick___Tattoo_Mangon", "/Artists/131/Rob_Hoskins___Idle_Hand_Tattoo", "/Artists/127/Daveee___Kult_Tattoo", "/Artists/116/Jack_Ribeiro___Tattoos_By_Jack", "/Artists/119/Jeff_Ortega___Evil_From_The_Needle", "/Artists/127/Daveee___Kult_Tattoo", "/Artists/104/Luca___New_Wave_Tattoo", "/Artists/118/Kari___Memento_Tattoo", "/Artists/130/Sister_Sammy___Fallen_Angel", "/Artists/43/Shaun___Images_On_Skin", "/Artists/115/Milosch___Milosch_Tattoo", "/Artists/33/Gary_Wiedenhof___Inkredible___", "/Artists/47/Woody___Woodys_Tattoo_Studio", "/Artists/91/Hazel_Nicholls___Design_4_Life", "/Artists/86/Mark_Bailey___Golden_Dragon_Tattoo", "/Artists/108/Hata___Ink_Rat_Tattoo", "/Artists/16/Phil___Susanne___Arctic_Tattoo"]; 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);