/************************************************************** Script : multiBox Version : 1.4 Authors : Samuel Birch Desc : Supports jpg, gif, png, flash, flv, mov, wmv, mp3, html, iframe Licence : Open Source MIT Licence **************************************************************/ var multiBox = new Class({ getOptions: function(){ return { initialWidth: 250, initialHeight: 250, container: document.body, //this will need to be setup to the box open in relation to this. overlay: false, //this will be a reference to an overlay instance. - TODO: implement below. contentColor: '#6b5f4f', showNumbers: false, showControls: true, //showThumbnails: false, //autoPlay: false, //waitDuration: 2000, descClassName: false, descMinWidth: 400, descMaxWidth: 600, movieWidth: 400, movieHeight: 300, offset: {x:0, y:-140}, fixedTop: false, path: 'files/', _onOpen: function(){}, _onClose: function(){}, openFromLink: true, orientation: false, voting:true //relativeToWindow: true }; }, initialize: function(className, options){ this.setOptions(this.getOptions(), options); this.openClosePos = {}; this.timer = 0; this.contentToLoad = {}; this.index = 0; this.opened = false; this.contentObj = {}; this.containerDefaults = {}; this.createArray = []; if(this.options.useOverlay){ this.overlay = new Overlay({container: this.options.container, onClick:this.close.bind(this)}); } this.overlay = this.options.overlay; if(this.overlay){ this.overlay.setOnClick(this.close.bind(this)); } this.content = $$('.'+className); if(this.options.descClassName){ this.descriptions = $$('.'+this.options.descClassName); this.descriptions.each(function(el){ el.setStyle('display', 'none'); }); } this.container = new Element('div').addClass('MultiBoxContainer').inject(this.options.container); this.iframe = new Element('iframe').setProperties({ 'id': 'multiBoxIframe', 'name': 'mulitBoxIframe', 'src': 'javascript:void(0);', 'frameborder': 0, 'scrolling': 'no' }).setStyles({ 'position': 'absolute', 'top': -20, 'left': -20, 'filter': 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)', 'opacity': 0 }).inject(this.container); this.box = new Element('div').addClass('MultiBoxContent').inject(this.container); this.closeButton = new Element('div').addClass('MultiBoxClose').inject(this.container).addEvent('click', this.close.bind(this)); this.controlsContainer = new Element('div').addClass('MultiBoxControlsContainer').inject(this.container); this.controls = new Element('div').addClass('MultiBoxControls').inject(this.controlsContainer); this.vote = new Element('div').addClass('MultiBoxVote').set('text','Głosuję!'); this.voteValue=new Element('a').inject(this.vote); this.vote.inject(this.controlsContainer).addEvent('click',function(e){ e.stop(); this.voting(this.vote); }.bind(this)); if(!this.options.voting){ this.vote.setStyle('display','none'); } this.previousButton = new Element('div').addClass('MultiBoxPrevious').inject(this.container).addEvent('click', this.previous.bind(this)); this.nextButton = new Element('div').addClass('MultiBoxNext').inject(this.container).addEvent('click', this.next.bind(this)); this.title = new Element('div').addClass('MultiBoxTitle').inject(this.controls); this.titleMargin = this.title.getStyle('margin-left'); // this.number = new Element('div').addClass('MultiBoxNumber').inject(this.controls); this.description = new Element('div').addClass('MultiBoxDescription').inject(this.controls); if(this.content.length == 1){ this.title.setStyles({ 'margin-left': 0 }); this.description.setStyles({ 'margin-left': 0 }); this.previousButton.setStyle('display', 'none'); this.nextButton.setStyle('display', 'none'); // this.number.setStyle('display', 'none'); } new Element('div').setStyle('clear', 'both').inject(this.controls); this.content.each(function(el,i){ el.index = i; el.addEvent('click', function(e){ e.stop(); this.open(el); }.bind(this)); if(el.href.indexOf('#') > -1){ el.content = $(el.href.substr(el.href.indexOf('#')+1)); if(el.content){el.content.setStyle('display','none');} } }, this); this.containerEffects = new Fx.Morph(this.container, {duration: 400, transition: Fx.Transitions.Sine.easeInOut}); this.iframeEffects = new Fx.Morph(this.iframe, {duration: 400, transition: Fx.Transitions.Sine.easeInOut}); this.controlEffects = new Fx.Morph(this.controlsContainer, {duration: 300, transition: Fx.Transitions.Sine.easeInOut}); this.reset(); /* var _this=this; window.addEvent('scroll', function(){ _this.replaceBox(); }); */ }, setContentType: function(link){ var str = link.href.substr(link.href.lastIndexOf('.')+1).toLowerCase(); var contentOptions = {}; if($chk(link.rel)){ var optArr = link.rel.split(','); optArr.each(function(el){ var ta = el.split(':'); contentOptions[ta[0]] = ta[1]; contentOptions[ta[2]] = ta[3]; contentOptions[ta[4]] = ta[5]; }); } if(contentOptions.type != undefined){ str = contentOptions.type; } this.contentObj = {}; if(this.options.orientation){ orient='&r='+($(this.options.orientation).value)*(-90); } else{ orient=''; } this.contentObj.url = link.href+orient; this.contentObj.src = link.href+orient; this.contentObj.xH = 0; if(contentOptions.width){ this.contentObj.width = contentOptions.width; }else{ this.contentObj.width = this.options.movieWidth; } if(contentOptions.height){ this.contentObj.height = contentOptions.height; }else{ this.contentObj.height = this.options.movieHeight; } if(contentOptions.panel){ this.panelPosition = contentOptions.panel; }else{ this.panelPosition = this.options.panel; } switch(str){ case 'jpg': case 'image': case 'gif': case 'png': this.type = 'image'; break; case 'swf': this.type = 'flash'; break; case 'youtube': this.type = 'youtube'; break; case 'flv': this.type = 'flashVideo'; this.contentObj.xH = 70; break; case 'mov': this.type = 'quicktime'; break; case 'wmv': this.type = 'windowsMedia'; break; case 'rv': case 'rm': case 'rmvb': this.type = 'real'; break; case 'mp3': this.type = 'flashMp3'; this.contentObj.width = 320; this.contentObj.height = 70; break; case 'element': this.type = 'htmlelement'; this.elementContent = link.content; this.elementContent.setStyles({ display: 'block', opacity: 0 }) if(this.elementContent.getStyle('width') != 'auto'){ this.contentObj.width = this.elementContent.getStyle('width'); } this.contentObj.height = this.elementContent.getSize().y; this.elementContent.setStyles({ display: 'none', opacity: 1 }) break; default: this.type = 'iframe'; if(contentOptions.ajax){ this.type = 'ajax'; } break; } }, reset: function(){ this.container.setStyles({ 'opacity': 0, 'display': 'none' }); this.controlsContainer.setStyles({ 'height': 0 }); this.removeContent(); this.previousButton.removeClass('MultiBoxButtonDisabled'); this.nextButton.removeClass('MultiBoxButtonDisabled'); this.opened = false; }, getOpenClosePos: function(el){ if (this.options.openFromLink) { if (el.getFirst()) { var w = el.getFirst().getCoordinates().width - (this.container.getStyle('border').toInt() * 2); if (w < 0) { w = 0 } var h = el.getFirst().getCoordinates().height - (this.container.getStyle('border').toInt() * 2); if (h < 0) { h = 0 } this.openClosePos = { width: w, height: h, top: el.getFirst().getCoordinates().top, left: el.getFirst().getCoordinates().left }; } else { var w = el.getCoordinates().width - (this.container.getStyle('border').toInt() * 2); if (w < 0) { w = 0 } var h = el.getCoordinates().height - (this.container.getStyle('border').toInt() * 2); if (h < 0) { h = 0 } this.openClosePos = { width: w, height: h, top: el.getCoordinates().top, left: el.getCoordinates().left }; } }else{ var border = this.container.getStyle('border').toInt(); if(this.options.fixedTop){ var top = this.options.fixedTop; }else{ var top = ((window.getHeight()/2)-(this.options.initialHeight/2) - border)+this.options.offset.y; } this.openClosePos = { width: this.options.initialWidth, height: this.options.initialHeight, top: top, left: ((window.getWidth()/2)-(this.options.initialWidth/2)-border)+this.options.offset.x }; } return this.openClosePos; }, open: function(el){ this.options._onOpen(); $$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'hidden' }); this.index = this.content.indexOf(el); this.openId = el.getProperty('id'); var border = this.container.getStyle('border').toInt(); if(!this.opened){ this.opened = true; if(this.options.overlay){ this.overlay.show(); } if($(document.body).getElement('span.swiff-uploader-box')) $(document.body).getElement('span.swiff-uploader-box').setStyle('visibility','hidden'); this.container.setStyles(this.getOpenClosePos(el)); this.container.setStyles({ opacity: 0, display: 'block' }); var top; if(this.options.fixedTop){ top = this.options.fixedTop; }else{ top = ((window.getHeight()/2)-(this.options.initialHeight/2) - border)+this.options.offset.y; } this.containerEffects.start({ width: this.options.initialWidth, height: this.options.initialHeight, top: top, left: ((window.getWidth()/2)-(this.options.initialWidth/2)-border)+this.options.offset.x, opacity: [0, 1] }); this.load(this.index); }else{ if (this.options.showControls) { this.hideControls(); } this.getOpenClosePos(this.content[this.index]); this.timer = this.hideContent.bind(this).delay(500); this.timer = this.load.pass(this.index, this).delay(1100); } }, create: function(obj){ /* obj = { url: 'myurl', * title: 'my title', description: 'my description', type: 'image', width: 400, height: 300 } */ if(this.createArray.contains(obj.url)){ var index = this.createArray.indexOf(obj.url); var a = this.content[index]; }else{ var id = 'mbDirect_' + $time(); var rel = []; if(obj.type){rel.push('type:'+obj.type)} if(obj.width){rel.push('width:'+obj.width)} if(obj.height){rel.push('height:'+obj.height)} var a = new Element('a', { 'href': obj.url, 'id': id, 'title': obj.title || '', 'rel': rel.join(',') }); var desc = new Element('div', { 'class': id, 'html': obj.description || '' }) this.createArray.push(obj.url); this.content.push(a); var index = this.content.length-1; if(this.options.descClassName){ this.descriptions.include(desc); } } this.open(a); }, getContent: function(index){ this.setContentType(this.content[index]); var desc = false; if(this.options.descClassName){ this.descriptions.each(function(el,i){ if(el.hasClass(this.openId)){ desc = el.clone(); } },this); } this.contentToLoad = { title: this.content[index].retrieve('title') || ' ', desc: desc, number: index+1 }; }, close: function(){ if(this.options.overlay){ this.overlay.hide(); } if (this.options.showControls) { this.hideControls(); } this.hideContent(); this.containerEffects.cancel(); this.zoomOut.bind(this).delay(500); this.options._onClose(); (function(){$$('select', 'object', 'embed').each(function(node){ node.style.visibility = 'visible' });}).delay(1000); }, zoomOut: function(){ this.iframeEffects.start({ width: this.openClosePos.width, height: this.openClosePos.height }); this.containerEffects.start({ width: this.openClosePos.width, height: this.openClosePos.height, top: this.openClosePos.top, left: this.openClosePos.left, opacity: 0 }); this.reset.bind(this).delay(500); if($(document.body).getElement('span.swiff-uploader-box')) $(document.body).getElement('span.swiff-uploader-box').setStyle('visibility','visible'); }, load: function(index){ this.box.addClass('MultiBoxLoading'); this.getContent(index); if(this.type == 'image'){ var xH = this.contentObj.xH; var url=this.content[index].href; var orient=($(this.options.orientation))?('&r='+($(this.options.orientation).value)*(-90)):''; this.contentObj = new Asset.image(url+orient, {onload: this.resize.bind(this)}); this.contentObj.xH = xH; }else{ this.resize(); } }, voting: function(el){ return; var _this=this; var ids=(this.content[this.index].getParent().getParent().getElement('.vote').get('href')).split('_'); var r=new Request.JSON({ url:'./index.php', onSuccess: function(json,text){ if(json.status=='OK'){ var amount=el.getElement('a').get('text').toInt()+1; el.getElement('a').set('text',amount); _this.content[_this.index].getParent().getParent().getElement('div i').set('text',amount); var suma=$('galeria').getElement('div.przedszkole-'+ids[1]+' b'); suma.set('text',suma.get('text').toInt()+1); var title=(_this.contentToLoad.title).split('#'); _this.contentToLoad.title=title[0]+'#'+amount; _this.voteValue.set('text',amount); } Sexy.alert(json.msg,{textBoxBtnOk: 'OK'}); } }); r.send({ method:'post', data:'id='+_this.content[_this.index].getParent().getParent().getElement('.vote').get('href')+'&main=glosowanie' }); }, resize: function(){ if(this.tempSRC != this.contentObj.src){ var orientation=this.contentObj.src.split('#'); var wiek=orientation[2]; if(orientation[1]){ this.orientation=orientation[1]; } else{ ($(this.options.orientation).value%2==0)?this.orientation='l':this.orientation='p'; } var bh=$(document.body).getSize().y; if(bh<1025&&this.content[this.index].hasClass('p')){ var scale=bh/1025; this.container.setStyles({'-webkit-transform':'scale('+scale+')','-moz-transform':'scale('+scale+')','-o-transform':'scale('+scale+')','-ms-transform':'scale('+scale+')','transform':'scale('+scale+')'}); top = ((window.getHeight()/2)-(this.options.initialHeight*scale/2) - border)+this.options.offset.y; } else{ var scale=1; this.container.setStyles({'-webkit-transform':'scale('+scale+')','-moz-transform':'scale('+scale+')','-o-transform':'scale('+scale+')','-ms-transform':'scale('+scale+')','transform':'scale('+scale+')'}); } if(this.orientation=='p'){ this.contentObj.width=597; this.contentObj.height=794; this.container.removeClass('mbL').addClass('mbP'); if(wiek!=''&&wiek!=undefined){ if(wiek=='maluch') this.container.addClass('zmaluch'); else this.container.addClass('zstarszak'); } this.controlsContainer.removeClass('MBCCL').addClass('MBCCP'); this.previousButton.removeClass('MBPL').addClass('MBPP'); this.nextButton.removeClass('MBNL').addClass('MBNP'); this.closeButton.addClass('MBCP'); } else{ this.contentObj.height=597; this.contentObj.width=794; this.container.removeClass('mbP').addClass('mbL'); if(wiek!=''&&wiek!=undefined){ if(wiek=='maluch') this.container.addClass('zmaluch'); else this.container.addClass('zstarszak'); } this.controlsContainer.removeClass('MBCCP').addClass('MBCCL'); this.previousButton.removeClass('MBPP').addClass('MBPL'); this.nextButton.removeClass('MBNP').addClass('MBNL'); this.closeButton.removeClass('MBCP'); } var border = this.container.getStyle('border').toInt(); if (this.options.fixedTop) { var top = this.options.fixedTop; } else { var top = ((window.getHeight() / 2) - ((Number(this.contentObj.height) + this.contentObj.xH+this.container.getStyle('padding-top').toInt()+this.container.getStyle('padding-bottom').toInt()+50) / 2) - border + window.getScrollTop()) + this.options.offset.y; // var top = (20 - border + window.getScrollTop()) + this.options.offset.y; } var left = ((window.getWidth() / 2) - ((this.contentObj.width.toInt()+this.container.getStyle('padding-left').toInt()+this.container.getStyle('padding-right').toInt()) / 2) - border) + this.options.offset.x; if (top < 0) { top = 0 } if (left < 0) { left = 0 } this.containerEffects.cancel(); this.containerEffects.set({ width: this.contentObj.width+this.container.getStyle('padding-left').toInt()+this.container.getStyle('padding-right').toInt(), height: Number(this.contentObj.height) + this.contentObj.xH+this.container.getStyle('padding-top').toInt()+this.container.getStyle('padding-bottom').toInt(), top: top, left: left, opacity: 1 }); this.iframeEffects.set({ width: Number(this.contentObj.width) + (border*2), height: Number(this.contentObj.height) + this.contentObj.xH + (border*2) }); this.timer = this.showContent.bind(this).delay(500); this.tempSRC = this.contentObj.src; } this.replaceBox(); }, replaceBox: function() { if(this.MoveBox) this.MoveBox.cancel(); var frameH=(Number(this.contentObj.height)) +this.container.getStyle('padding-top').toInt()+this.container.getStyle('padding-bottom').toInt()+70; var top=((window.getHeight() / 2) - (frameH / 2) + window.getScrollTop()) + this.options.offset.y+200; var top=window.getScrollTop(); // console.log(window.getHeight()+' '+frameH+' '+window.getScrollTop()); // if(top>window.getScrollTop()-750) // top=window.getScrollTop()-750; this.MoveBox = new Fx.Tween(this.container, { duration: 1000, transition: Fx.Transitions.Quad.easeOut }); this.MoveBox.addEvent('onComplete',function(){ this.overlay.setHeight(); }.bind(this)); this.MoveBox.start('top',top); }, showContent: function(){ this.tempSRC = ''; this.box.removeClass('MultiBoxLoading'); this.removeContent(); this.contentContainer = new Element('div').setProperties({id: 'MultiBoxContentContainer'}).setStyles({opacity: 0, width: this.contentObj.width, height: (Number(this.contentObj.height)+this.contentObj.xH)}).inject(this.box); if(this.type == 'image'){ this.contentObj.inject(this.contentContainer); }else if(this.type == 'iframe'){ var tmp=new Element('iframe').setProperties({ id: 'iFrame'+new Date().getTime(), width: this.contentObj.width, height: this.contentObj.height, frameborder: 0, scrolling: 'auto' }).inject(this.contentContainer); var iframedoc = tmp.document; if (tmp.contentDocument) iframedoc = tmp.contentDocument; else if (tmp.contentWindow) iframedoc = tmp.contentWindow.document; /* var rotate=0; if(this.content[this.index].hasClass('rot1')){ rotate=90; } else if(this.content[this.index].hasClass('rot2')){ rotate=180; } else if(this.content[this.index].hasClass('rot3')){ rotate=270; } var imgStyle=''; if(rotate==0) imgStyle+=';max-width:100%;height:auto;'; if(rotate==90||rotate==270){ var cellStyle='position:absolute;-webkit-transform:rotate('+rotate+'deg) translateY(-50%) translateX(-50%);-webkit-transform-origin:0 0;-moz-transform-origin:0 0;-moz-transform:rotate('+rotate+'deg) translateY(-50%) translateX(-50%);-o-transform-origin:0 0;-o-transform:rotate('+rotate+'deg) translateY(-50%) translateX(-50%);-ms-transform-origin:0 0;-ms-transform:rotate('+rotate+'deg) translateY(-50%) translateX(-50%);transform-origin:0 0;transform:rotate('+rotate+'deg) translateY(-50%) translateX(-50%);top:50%;left:50%;'; if(this.content[this.index].hasClass('ratiook')) imgStyle+=';width: 794px;'; else imgStyle+=';height: 76%;'; } else var cellStyle='-webkit-transform:rotate('+rotate+'deg);-moz-transform:rotate('+rotate+'deg);-o-transform:rotate('+rotate+'deg);-ms-transform:rotate('+rotate+'deg);transform:rotate('+rotate+'deg);'; */ var rotate=0; var cellStyle=''; var imgStyle=''; if(this.contentObj.width
"); iframedoc.close(); if(rotate==0){ var _this=this; Asset.image(this.contentObj.url, { onload:function(){ var img=iframedoc.querySelector('img'); var imgStyles=img.style; img.style.height='auto'; img.style.width='auto'; if(img.offsetWidth<_this.contentObj.width&&img.offsetHeight<_this.contentObj.height){ var ratio=img.offsetWidth/img.offsetHeight; if(img.offsetWidth>=img.offsetHeight){ if(ratio>1.3299){ img.style.width='100%'; img.style.height='auto'; img.style.maxWidth='none'; } else{ img.style.height='100%'; img.style.width='auto'; img.style.maxWidth='none'; } } else{ if(ratio>0.75){ img.style.width='100%'; img.style.height='auto'; img.style.maxWidth='none'; } else{ img.style.height='100%'; img.style.width='auto'; img.style.maxWidth='none'; } } } } }); } } // var tmp=tmp.contentWindow.document.body; if(Browser.ie9) tmp.innerHTML="
"; tmp.style.margin='0'; // src: this.contentObj.url, }else if(this.type == 'htmlelement'){ this.elementContent.clone().setStyle('display','block').inject(this.contentContainer); }else if(this.type == 'ajax'){ new Request.HTML({ update: $('MultiBoxContentContainer'), autoCancel: true }).get(this.contentObj.url); }else{ var obj = this.createEmbedObject().inject(this.contentContainer); if(this.str != ''){ $('MultiBoxMediaObject').innerHTML = this.str; } } this.contentEffects = new Fx.Morph(this.contentContainer, {duration: 500, transition: Fx.Transitions.linear}); this.contentEffects.start({ opacity: 1 }); var title=(this.contentToLoad.title).split('#'); this.title.set('html',title[0]); if(this.options.voting) this.voteValue.set('text',title[1]); /* if(this.content.length > 1){ this.number.set('html', this.contentToLoad.number+' of '+this.content.length); }else{ this.number.set('html',''); } */ if (this.options.descClassName) { if (this.description.getFirst()) { this.description.getFirst().destroy(); } if(this.contentToLoad.desc){ this.contentToLoad.desc.inject(this.description).setStyles({ display: 'block' }); } } //this.removeContent.bind(this).delay(500); if (this.options.showControls) { if(this.contentToLoad.title != ' ' || this.content.length > 1){ //this.timer = this.showControls.bind(this).delay(800); } } }, hideContent: function(){ this.box.addClass('MultiBoxLoading'); this.contentEffects.start({ opacity: 0 }); this.removeContent.bind(this).delay(500); }, removeContent: function(){ if($('MultiBoxMediaObject')){ $('MultiBoxMediaObject').empty(); $('MultiBoxMediaObject').destroy(); } if($('MultiBoxContentContainer')){ //$('MultiBoxContentContainer').empty(); $('MultiBoxContentContainer').destroy(); } }, showControls: function(){ this.clicked = false; if(this.container.getStyle('height') != 'auto'){ this.containerDefaults.height = this.container.getStyle('height') // this.containerDefaults.backgroundColor = this.options.contentColor; } this.container.setStyles({ //'backgroundColor': this.controls.getStyle('backgroundColor'), 'height': 'auto' }); if(this.content.length > 1){ this.previousButton.setStyle('visibility', 'visible'); this.nextButton.setStyle('visibility', 'visible'); this.title.setStyle('margin-left', this.titleMargin); if(this.contentToLoad.number == 1){ var prev=$('galeria').getElement('div.prev a'); if(!prev) this.previousButton.addClass('MultiBoxPreviousDisabled'); }else{ this.previousButton.removeClass('MultiBoxPreviousDisabled'); } if(this.contentToLoad.number == this.content.length){ var next=$('galeria').getElement('div.next a'); if(!next) this.nextButton.addClass('MultiBoxNextDisabled'); }else{ this.nextButton.removeClass('MultiBoxNextDisabled'); } }else{ this.previousButton.setStyle('visibility', 'hidden'); this.nextButton.setStyle('visibility', 'hidden'); this.title.setStyle('margin-left', 0); } // if(!this.options.voting) // this.controlEffects.start({'height': this.controls.getCoordinates().height}); // else this.controlEffects.start({'height': this.controls.getCoordinates().height+this.vote.getCoordinates().height}); this.iframeEffects.start({'height': this.iframe.getStyle('height').toInt()+this.controls.getStyle('height').toInt()}); if(!this.options.voting){ if(this.orientation=='l') this.controlsContainer.setStyles({'margin-left':-10,'margin-top':80}); else this.controlsContainer.setStyles({'margin-left':-106,'margin-top':60}); } if(this.options.overlay){ this.options.overlay.position(); } }, hideControls: function(num){ this.iframeEffects.start({'height': this.iframe.getStyle('height').toInt()-this.controls.getStyle('height').toInt()}); this.controlEffects.start({'height': 0}).chain(function(){ this.container.setStyles(this.containerDefaults); }.bind(this)); }, showThumbnails: function(){ }, next: function(){ if(this.index==this.content.length-1){ var next=$('galeria').getElement('div.next a'); if(next){ window.location.href=next.href; // next.fireEvent('click',this,0); } } if(this.index < this.content.length-1){ this.index++; this.openId = this.content[this.index].getProperty('id'); if (this.options.showControls) { this.hideControls(); } this.getOpenClosePos(this.content[this.index]); //this.getContent(this.index); this.timer = this.hideContent.bind(this).delay(500); this.timer = this.load.pass(this.index, this).delay(1100); } }, previous: function(){ if(this.index==0){ var prev=$('galeria').getElement('div.prev a'); if(prev) window.location.href=prev.href; } if(this.index > 0){ this.index--; this.openId = this.content[this.index].getProperty('id'); if (this.options.showControls) { this.hideControls(); } this.getOpenClosePos(this.content[this.index]); //this.getContent(this.index); this.timer = this.hideContent.bind(this).delay(500); this.timer = this.load.pass(this.index, this).delay(1000); } }, createEmbedObject: function(){ if(this.type == 'flash'){ var url = this.contentObj.url; var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'}); this.str = '' this.str += ''; this.str += ''; this.str += ''; } if(this.type == 'youtube'){ var url = this.contentObj.url; var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'}); this.str = '' this.str += ''; this.str += ''; this.str += ''; this.str += ''; } if(this.type == 'flashVideo'){ //var url = this.contentObj.url.substring(0, this.contentObj.url.lastIndexOf('.')); var url = this.contentObj.url; var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'}); this.str = '' this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += '' this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; } if(this.type == 'windowsMedia'){ var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'}); this.str = ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; } if(this.type == 'real'){ var obj = new Element('div').setProperties({id: 'MultiBoxMediaObject'}); this.str = ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; this.str += ''; } return obj; } }); multiBox.implement(new Options); multiBox.implement(new Events);