var PopupGalleryMovie = Class.create(); Object.extend(Object.extend(PopupGalleryMovie.prototype, PopupGallery.prototype), { movieController: false, initialize: function(items) { this.items = items; //console.log(items) if (this.items.length>0) { this.createPopup(); this.setDefaults(); this.setItemAttributes(); } if (location.hash) { var initial = location.hash.substring(location.hash.indexOf('#')+1, location.hash.length); if (initial=='demo') this.showDemo(); } }, createPopup: function() { this.closeBtn = Builder.node('a', {href:'#close', 'class':'close'}, 'Close'); Event.observe(this.closeBtn, 'click', this.close.bindAsEventListener(this), false); this.displayPanel = Builder.node('div', {'class':'movie'}); this.controllerPanel = Builder.node('div', {'class':'controller'}); this.descriptionPanel = Builder.node('div', {'class':'description'}); this.popup = Builder.node('div', {'id':'popupmovie', 'class':'popup'}, [ this.closeBtn, this.descriptionPanel, this.displayPanel, this.controllerPanel ]); this.popupshadow = Builder.node('div', {id:'popupmovieshadow', 'class':'popupshadow'}, [ Builder.node('img', {src:'imagenes/bg/popup_movieshadow20070807.png', alt:'', border:0}) ]); document.body.appendChild(this.popupshadow); document.body.appendChild(this.popup); }, onClick: function(evt, item, i) { // store the small size and position for later this.width = (item.offsetWidth>80) ? 80 : item.offsetWidth; this.left = evt.pageX || evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); this.left -= this.width/2; this.left = this.left || document.body.getDimensions().width / 2; this.height = item.offsetHeight; this.top = evt.pageY || evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); this.top -= this.height/2; if (AC.Detector.isiPhone()) { this.left = 3; this.top = 200; } // stop the default event Event.stop(evt); // track this click if (item.trackClick) item.trackClick(); // unset the click events if a movie if (!this.controllerPanel.innerHTML == "") { this.beforeClose(); this.afterClose(); } // do the image this.prepPop(evt, item, i); }, setItemAttributes: function() { for (var i=0; i