var portfolio; var SlideShowImages; var Portfolio = new Class({ initialize : function(container) { this.ie6 = Browser.Engine.trident && Browser.Engine.version == 4; this.slideShowImages = null; this.slideShowText = null; this.slideShowLinks = null; this.remooz = null; this.slideShowCounter = 0; this.portfolioIndex = 1; this.portfolios = null; this.slideShowImage = $('SlideShowImage'); this.container = $(container); this.initializeSlideShowImageOSD(); this.initializeControls(); this.initializePortfolios(this, { 'index' : '1', 'portfolios' : [ {'thumbnail' : '/assets/johnnykahalawai/images/2921200127/133963160.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Horse+Post+dot+com&cid=2462979187'},{'thumbnail' : '/assets/johnnykahalawai/images/469013976/3146296299.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Buzz%27s+Catering&cid=200946728'},{'thumbnail' : '/assets/johnnykahalawai/images/2709356261/3486646374.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Buzz%27s+Wharf&cid=1603639302'},{'thumbnail' : '/assets/johnnykahalawai/images/698077252/699079882.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Markea+Prawns&cid=4202469570'},{'thumbnail' : '/assets/johnnykahalawai/images/2933892151/1563887935.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Tahiti+Valley+dot+com&cid=2405118710'},{'thumbnail' : '/assets/johnnykahalawai/images/3567460407/1171369088.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Chez+Paul+dot+not&cid=1427252402'},{'thumbnail' : '/assets/johnnykahalawai/images/589524812/1179086743.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Haleaina&cid=568341130'},{'thumbnail' : '/assets/johnnykahalawai/images/3087660265/727276396.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Kapili&cid=1039565724'},{'thumbnail' : '/assets/johnnykahalawai/images/2887294460/3837415738.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=A+Royal+Hawaii+Wedding+Planner&cid=2107962823'},{'thumbnail' : '/assets/johnnykahalawai/images/3689374649/166106298.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Cloud+Prime&cid=3093970957'},{'thumbnail' : '/assets/johnnykahalawai/images/3234168544/890725993.jpg','link' : '/cgi-bin/WebObjects/Kahalawai.woa/wa/portfolioImageRequestor?title=Maui+Giclee&cid=888407037'} ] }); this.initializeSlideShow({ 'date' : '03/01/09', 'link' : 'http://www.horsepost.com', 'images' : [ { 'description' : 'Horse Post is an advertising platform for horse breeders and related products and services. In less than six months the Horse Post community has grown to thousands of members marketing thousands of horses. Kahalwai created Horse Post from the ground up including all the artwork, programming and hosting. Horse Post uses the following technologies XHTML, CSS, JavaScript (Prototype/Scriptaculous/YUI), Java, WebObjects, XML, Google Maps, YouTube API and MySQL.','link' : 'null','src' : '/assets/johnnykahalawai/images/2921200127/1015798739.gif'},{ 'description' : 'Horse Post was the first horse advertising platform that enabled users to upload full quality images for their ad. In addition Horse Post uses Java2D to allow users to crop and rotate their images.','link' : 'null','src' : '/assets/johnnykahalawai/images/1537938043/1930899008.jpg'},{ 'description' : 'Horse Post utilizes youTube\'s video api to enable users to publish videos directly from their Horse Post user account to youTube. This way connecting a youTube video to their Horse Post advertisement is just a single click.','link' : 'null','src' : '/assets/johnnykahalawai/images/570921159/1639619356.jpg'},{ 'description' : 'The Horse Post user portal is the most functional horse advertising portal in the world today. Users can add as many documents, video and images to their horse, stallion or horse product advertisement as they wish. In addition users can crop and rotate images, create slide shows, upload videos to youTube and much more.','link' : 'null','src' : '/assets/johnnykahalawai/images/3199874157/2218469836.jpg'},{ 'description' : 'Horse Post\'s intelligent search results enable users to easily filter by breed, price, discipline, age et al until they find the horse exact horse they are looking for. Horse Post is integrated into Google\'s AdSense and eBay\'s API to generate ad revenue for the site. All advertisements are indexed for search via the Lucene open source API.','link' : 'null','src' : '/assets/johnnykahalawai/images/1078972253/3390235905.jpg'} ], 'title' : 'Horse Post dot com' }); }, initializeControls : function() { this.initializeLinks(); }, initializeLinks : function() { this.initializePortfolioTypeSelectors(); this.initializePortfolioSelectors(); }, initializePortfolioTypeSelectors : function() { $$('#PortfolioRequestorLinks a').each(function(link) { link.addEvent('click', function(event) { event.preventDefault(); $('Portfolios').getChildren().each(function(el) { el.destroy(); }); $('PortfolioSelectorBody').addClass("LoadingPortfolio"); $$('#PortfolioRequestorLinks a.selected').each(function(el) { el.removeClass('selected'); }); link.addClass('selected'); new Request.HTML({ url : this.get('href'), onComplete : function() { $('PortfolioSelectorBody').removeClass("LoadingPortfolio"); } }).send(); }.bind(link)); }); }, initializePortfolioSelectors : function() { $$('#Portfolios a').each(function(link) { link.addEvent('click', function(event) { event.preventDefault(); $('SlideShowImage').src = '/WebObjects/Kahalawai.woa/Contents/WebServerResources/images/portfolio/loading.gif'; new Request.HTML({ url : this.get('href'), onComplete: function() { portfolio.slideShowCounter = 0; $('SlideShowIndex').set('html', '1'); } }).send(); }.bind(link)); }); }, setSlideShowImage : function(index) { var ssTween = new Fx.Tween($('SlideShowImage'), { link : 'chain' }); ssTween.start('opacity', 0).chain(function() { $('SlideShowImage').src = portfolio.slideShowImages[index].src; ssTween.start('opacity', 1).chain(function() { $('SlideShowIndex').set('html', (index+1)); }); }); $('SlideText').set('html', portfolio.slideShowText[index]); if(portfolio.portfolios.index > 1) { $('SlideShowExternalLink').set('href', portfolio.slideShowLinks[index]); $('SlideLink').set('href', portfolio.slideShowLinks[index]); $('SlideLink').removeEvents('click'); new ReMooz($('SlideLink'), { 'origin': 'img', 'shadow': 'onOpenEnd', // fx is faster because shadow appears after resize animation 'resizeFactor': 0.8, // resize to maximum 80% of screen size 'cutOut': false, // don't hide the original 'opacityResize': 0.4, // opaque resize 'dragging': false, // disable dragging 'centered': true // resize to center of the screen, not relative to the source element }); } }, initializeSlideShow : function(slideShowObject) { var slideShowImages = new Array(slideShowObject.images.length); this.slideShowText = new Array(slideShowObject.images.length); this.slideShowLinks = new Array(slideShowObject.images.length); $('SlideShowTitle').set('html', slideShowObject.title); $('SlideShowDate').set('html', 'Launched ' + slideShowObject.date); $('SlideShowExternalLink').set({ 'href' : this.portfolios.index == 1 ? slideShowObject.link : slideShowObject.images[0].link, 'html' : this.portfolios.index == 1 ? "View Site" : "View Fullsize" }); $('SlideLink').set({ 'href': this.portfolios.index == 1 ? slideShowObject.link : slideShowObject.images[0].link, 'title' : this.portfolios.index == 1 ? "Click to View Web Site" : "Click to View Full Size" }); for(i=0;i 1) { $('SlideLink').set('href', portfolio.slideShowLinks[0]); new ReMooz($('SlideLink'), { 'origin': 'img', 'shadow': 'onOpenEnd', // fx is faster because shadow appears after resize animation 'resizeFactor': 0.8, // resize to maximum 80% of screen size 'cutOut': false, // don't hide the original 'opacityResize': 0.4, // opaque resize 'dragging': false, // disable dragging 'centered': true // resize to center of the screen, not relative to the source element }); } }.bind(this) }); }, initializePortfolios : function(portfolio, portfolioObject) { portfolio.portfolioIndex = 0; portfolio.portfolios = portfolioObject; portfolio.setCurrentPortfolios(portfolio, 0); $('PortfolioSelectorIndex').set('html', '1'); $('PortfolioSelectorCount').set('html', Math.ceil(portfolio.portfolios.portfolios.length/6)); }, displayPreviousPortfolioSection: function() { portfolio.portfolioIndex--; if(portfolio.portfolioIndex < 0) { portfolio.portfolioIndex = $('PortfolioSelectorCount').get('html').toInt() - 1; } portfolio.setCurrentPortfolios(portfolio, portfolio.portfolioIndex); }, displayNextPortfolioSection : function() { portfolio.portfolioIndex++; var totalSections = $('PortfolioSelectorCount').get('html').toInt(); if(totalSections <= portfolio.portfolioIndex) portfolio.portfolioIndex = 0; portfolio.setCurrentPortfolios(portfolio, portfolio.portfolioIndex); }, setCurrentPortfolios : function(portfolio, index) { var i = (index>0) ? index * 6 : 0; var steps; $('Portfolios').set('html', ''); steps = (i+6) > portfolio.portfolios.portfolios.length ? portfolio.portfolios.portfolios.length : i + 6; for(i; i < steps; i++) { var obj = portfolio.portfolios.portfolios[i]; var img = new Element('img', { src : obj.thumbnail }); var link = new Element('a', { href : obj.link.replace('&', '&') }); var listItem = new Element('li', {}); img.inject(link); link.inject(listItem); listItem.inject($('Portfolios')); portfolio.initializePortfolioSelectors(); } $('PortfolioSelectorIndex').set('html', portfolio.portfolioIndex + 1); }, initializeSlideShowImageOSD : function() { $$('a.pslider').each(function(el) { el.addEvent('click', function(event) { event.preventDefault(); if(el.hasClass('left')) { portfolio.slideShowCounter--; if(portfolio.slideShowCounter < 0) portfolio.slideShowCounter = portfolio.slideShowText.length - 1; } else { portfolio.slideShowCounter++; if(portfolio.slideShowCounter >= portfolio.slideShowText.length) portfolio.slideShowCounter = 0; } portfolio.setSlideShowImage(portfolio.slideShowCounter); }); }); $('SlideShowImage').addEvents({ 'mouseover' : function() { slideCoords = this.getCoordinates(); scrollX = slideCoords.left + 160; scrollY = slideCoords.top + 246; if(portfolio.ie6) scrollY += window.getScroll().y; $('SlideOSDBatchControl').setStyles({ 'left' : scrollX, 'top' : scrollY, 'visibility' : 'visible' }); $('SlideOSDBatchControl').addEvents({ 'mouseenter' : function() { this.setStyle('visibility', 'visible'); }.bind($('SlideOSDBatchControl')), 'mouseleave' : function() { this.setStyle('visibility', 'hidden'); }.bind($('SlideOSDBatchControl')) }); }.bind($('SlideShowImage')), 'mouseleave' : function(e) { $('SlideOSDBatchControl').setStyle('visibility', 'hidden'); }.bind($('SlideShowImage')) }); } }); window.addEvent('domready', function() { portfolio = new Portfolio('PortfolioStage'); });