var Mediabox;
(function(){
var options, images, activeImage, prevImage, nextImage, top, left, fx, preload, preloadPrev=new Image(), preloadNext=new Image(), foxfix=false, iefix=false,
overlay, center, image, bottom, captionSplit, title, caption, prevLink, number, nextLink,
URL, WH, WHL, elrel, mediaWidth, mediaHeight, mediaType="none", mediaSplit, mediaId="mediaBox", mediaFmt;
window.addEvent("domready", function(){
$(document.body).adopt(
$$([
overlay=new Element("div",{id: "mbOverlay"}).addEvent("click", close),
center=new Element("div",{id: "mbCenter"})
]).setStyle("display", "none")
);
image=new Element("div",{id: "mbImage"}).injectInside(center);
bottom=new Element("div",{id: "mbBottom"}).injectInside(center).adopt(
new Element("a",{id: "mbCloseLink", href: "#"}).addEvent("click", close),
nextLink=new Element("a",{id: "mbNextLink", href: "#"}).addEvent("click", next),
prevLink=new Element("a",{id: "mbPrevLink", href: "#"}).addEvent("click", previous),
title=new Element("div",{id: "mbTitle"}),
number=new Element("div",{id: "mbNumber"}),
caption=new Element("div",{id: "mbCaption"})
);
fx={overlay: new Fx.Tween(overlay,{property: "opacity", duration: 360}).set(0),
image: new Fx.Tween(image,{property: "opacity", duration: 360, onComplete: captionAnimate}),
bottom: new Fx.Tween(bottom,{property: "opacity", duration: 240}).set(0)
};});
Mediabox={close: function(){close();}, 
open: function(_images, startImage, _options){options=$extend({loop: false,
stopKey: true,
overlayOpacity: 0.7,
resizeOpening: true,
resizeDuration: 240,
resizeTransition: false,
initialWidth: 320,
initialHeight: 180,
defaultWidth: 640,
defaultHeight: 360,
showCaption: true,
showCounter: true,
counterText:'({x}of{y})',
scriptaccess:'true',
fullscreen:'true',
fullscreenNum:'1',
autoplay:'true',
autoplayNum:'1',
autoplayYes:'yes',
bgcolor:'#000000',
wmode:'opaque',
playerpath: setPlayerPath(),
backcolor:  '000000',
frontcolor:'999999',
lightcolor:'000000',
screencolor:'000000',
controlbar:'over',
controller:'true',
flInfo:'true',
revverID:'187866',
revverFullscreen:'true',
revverBack:'000000',
revverFront:'ffffff',
revverGrad:'000000',
usViewers:'true',
ytBorder:'0',
ytColor1:'000000',
ytColor2:'333333',
ytQuality:'&ap=%2526fmt%3D18',
ytRel:'0',
ytInfo:'1',
ytSearch:'0',
vuPlayer:'basic',
vmTitle:'1',
vmByline:'1',
vmPortrait:'1',
vmColor:'ffffff'
}, _options ||{});
if ((Browser.Engine.gecko)&& (Browser.Engine.version<19)){foxfix=true;
options.overlayOpacity=1;
overlay.className='mbOverlayFF';}
if (typeof _images=="string"){_images=[[_images,startImage,_options]];
startImage=0;}
images=_images;
options.loop=options.loop && (images.length > 1);
if ((Browser.Engine.trident)&& (Browser.Engine.version<5)){iefix=true;
overlay.className='mbOverlayIE';
overlay.setStyle("position", "absolute");
position();}
size();
setup(true);
top=window.getScrollTop()+(window.getHeight()/2);
left=window.getScrollLeft()+(window.getWidth()/2);
fx.resize=new Fx.Morph(center, $extend({duration: options.resizeDuration, onComplete: imageAnimate}, options.resizeTransition ?{transition: options.resizeTransition}:{}));
center.setStyles({top: top, left: left, width: options.initialWidth, height: options.initialHeight, marginTop: -(options.initialHeight/2), marginLeft: -(options.initialWidth/2), display: ""});
fx.overlay.start(options.overlayOpacity);
return changeImage(startImage);}};
Element.implement({mediabox: function(_options, linkMapper){$$(this).mediabox(_options, linkMapper);
return this;}});
Elements.implement({
mediabox: function(_options, linkMapper, linksFilter){linkMapper=linkMapper||function(el){elrel=el.rel.split(/[\[\]]/);
elrel=elrel[1];
return [el.href, el.title, elrel];};
linksFilter=linksFilter||function(){return true;};
var links=this;
links.removeEvents("click").addEvent("click", function(){
var filteredArray=links.filter(linksFilter, this);
var filteredLinks=[];
var filteredHrefs=[];
filteredArray.each(function(item, index){if(filteredHrefs.indexOf(item.toString())< 0){filteredLinks.include(filteredArray[index]);
filteredHrefs.include(filteredArray[index].toString());};});
return Mediabox.open(filteredLinks.map(linkMapper), filteredHrefs.indexOf(this.toString()), _options);});
return links;}});
function position(){overlay.setStyles({top: window.getScrollTop(), left: window.getScrollLeft()});}
function size(){overlay.setStyles({width: window.getWidth(), height: window.getHeight()});}
function setup(open){
["object", window.ie ? "select" : "embed"].forEach(function(tag){Array.forEach(document.getElementsByTagName(tag), function(el){if (open)el._mediabox=el.style.visibility;
el.style.visibility=open ? "hidden" : el._mediabox;});});
overlay.style.display=open ? "" : "none";
var fn=open ? "addEvent" : "removeEvent";
if (iefix)window[fn]("scroll", position);
window[fn]("resize", size);
document[fn]("keydown", keyDown);}
function keyDown(event){switch(event.code){case 27:
case 88:
case 67:
close();
break;
case 37:
case 80:
previous();
break;
case 39:
case 78:
next();}
if (options.stopKey){return false;};}
function previous(){return changeImage(prevImage);}
function next(){return changeImage(nextImage);}
function changeImage(imageIndex){if (imageIndex >=0){image.set('html', '');
activeImage=imageIndex;
prevImage=((activeImage||!options.loop)? activeImage : images.length)- 1;
nextImage=activeImage+1;
if (nextImage==images.length)nextImage=options.loop ? 0 : -1;
stop();
center.className="mbLoading";
WH=images[imageIndex][2].split(' ');
WHL=WH.length;
if (WHL>1){mediaWidth=(WH[WHL-2].match("%"))? (window.getWidth()*("0."+(WH[WHL-2].replace("%", ""))))+"px" : WH[WHL-2]+"px";
mediaHeight=(WH[WHL-1].match("%"))? (window.getHeight()*("0."+(WH[WHL-1].replace("%", ""))))+"px" : WH[WHL-1]+"px";}else{mediaWidth="";
mediaHeight="";}
URL=images[imageIndex][0];
captionSplit=images[activeImage][1].split('::');
if (URL.match(/quietube\.com/i)){mediaSplit=URL.split('v.php/');
URL=mediaSplit[1];}else if (URL.match(/\/\/yfrog/i)){mediaType=(URL.substring(URL.length-1));
if (mediaType.match(/b|g|j|p|t/i))mediaType='image';
if (mediaType=='s')mediaType='flash';
if (mediaType.match(/f|z/i))mediaType='video';
URL=URL+":iphone";}
if (URL.match(/\.gif|\.jpg|\.png|twitpic\.com/i)|| mediaType=='image'){mediaType='img';
URL=URL.replace(/twitpic\.com/i, "twitpic.com/show/full");
preload=new Image();
preload.onload=startEffect;
preload.src=URL;}else if (URL.match(/\.flv|\.mp4/i)|| mediaType=='video'){mediaType='obj';
mediaWidth=mediaWidth||options.defaultWidth;
mediaHeight=mediaHeight||options.defaultHeight;
if (options.useNB){preload=new Swiff(''+options.NBpath+'?mediaURL='+URL+'&allowSmoothing=true&autoPlay='+options.autoplay+'&buffer=6&showTimecode='+options.showTimecode+'&loop='+options.NBloop+'&controlColour='+options.controllerColor+'&scaleIfFullScreen=true&showScalingButton=true',{id:'MediaboxSWF',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});}else{preload=new Swiff(''+options.playerpath+'?file='+URL+'&backcolor='+options.backcolor+'&frontcolor='+options.frontcolor+'&lightcolor='+options.lightcolor+'&screencolor='+options.screencolor+'&autostart='+options.autoplay+'&controlbar='+options.controlbar,{id:'MediaboxSWF',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});}
startEffect();}else if (URL.match(/\.mp3|\.aac|tweetmic\.com|tmic\.fm/i)|| mediaType=='audio'){mediaType='obj';
mediaWidth=mediaWidth||options.defaultWidth;
mediaHeight=mediaHeight||"20px";
if (URL.match(/tweetmic\.com|tmic\.fm/i)){URL=URL.split('/');
URL[4]=URL[4]||URL[3];
URL="http://media4.fjarnet.net/tweet/tweetmicapp-"+URL[4]+'.mp3';}
preload=new Swiff(''+options.playerpath+'?file='+URL+'&backcolor='+options.backcolor+'&frontcolor='+options.frontcolor+'&lightcolor='+options.lightcolor+'&screencolor='+options.screencolor+'&autostart='+options.autoplay,{id:'MediaboxSWF',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/\.swf/i)|| mediaType=='flash'){mediaType='obj';
mediaWidth=mediaWidth||options.defaultWidth;
mediaHeight=mediaHeight||options.defaultHeight;
preload=new Swiff(URL,{id:'MediaboxSWF',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/blip\.tv/i)){mediaType='obj';
mediaWidth=mediaWidth||"640px";
mediaHeight=mediaHeight||"390px";
preload=new Swiff(URL,{src: URL,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/break\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"464px";
mediaHeight=mediaHeight||"376px";
mediaId=URL.match(/\d{6}/g)
preload=new Swiff('http://embed.break.com/'+mediaId,{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/dailymotion\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"480px";
mediaHeight=mediaHeight||"381px";
preload=new Swiff(URL,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/facebook\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"320px";
mediaHeight=mediaHeight||"240px";
mediaSplit=URL.split('v=');
mediaSplit=mediaSplit[1].split('&');
mediaId=mediaSplit[0];
preload=new Swiff('http://www.facebook.com/v/'+mediaId,{movie:'http://www.facebook.com/v/'+mediaId,
classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/flickr\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"500px";
mediaHeight=mediaHeight||"375px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[5];
preload=new Swiff('http://www.flickr.com/apps/video/stewart.swf',{id: mediaId,
classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
width: mediaWidth,
height: mediaHeight,
params:{flashvars:'photo_id='+mediaId+'&amp;show_info_box='+options.flInfo, wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/fliggo\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"425px";
mediaHeight=mediaHeight||"355px";
URL=URL.replace('/video/', '/embed/');
preload=new Swiff(URL,{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/gametrailers\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"480px";
mediaHeight=mediaHeight||"392px";
mediaId=URL.match(/\d{5}/g)
preload=new Swiff('http://www.gametrailers.com/remote_wrap.php?mid='+mediaId,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/google\.com\/videoplay/i)){mediaType='obj';
mediaWidth=mediaWidth||"400px";
mediaHeight=mediaHeight||"326px";
mediaSplit=URL.split('=');
mediaId=mediaSplit[1];
preload=new Swiff('http://video.google.com/googleplayer.swf?docId='+mediaId+'&autoplay='+options.autoplayNum,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/justin\.tv/i)){mediaType='obj';
mediaWidth=mediaWidth||"353px";
mediaHeight=mediaHeight||"295px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[3];
preload=new Swiff('http://www.justin.tv/widgets/jtv_player.swf',{id:'jtv_player_flash',
width: mediaWidth,
height: mediaHeight,
params:{flashvars:'channel='+mediaId, wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/megavideo\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"640px";
mediaHeight=mediaHeight||"360px";
mediaSplit=URL.split('=');
mediaId=mediaSplit[1];
preload=new Swiff('http://wwwstatic.megavideo.com/mv_player.swf?v='+mediaId,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/metacafe\.com\/watch/i)){mediaType='obj';
mediaWidth=mediaWidth||"400px";
mediaHeight=mediaHeight||"345px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[4];
preload=new Swiff('http://www.metacafe.com/fplayer/'+mediaId+'/.swf?playerVars=autoPlay='+options.autoplayYes,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/myspacetv\.com|vids\.myspace\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"425px";
mediaHeight=mediaHeight||"360px";
mediaSplit=URL.split('=');
mediaId=mediaSplit[2];
preload=new Swiff('http://lads.myspace.com/videos/vplayer.swf?m='+mediaId+'&v=2&a='+options.autoplayNum+'&type=video',{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/revver\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"480px";
mediaHeight=mediaHeight||"392px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[4];
preload=new Swiff('http://flash.revver.com/player/1.0/player.swf?mediaId='+mediaId+'&affiliateId='+options.revverID+'&allowFullScreen='+options.revverFullscreen+'&autoStart='+options.autoplay+'&backColor=#'+options.revverBack+'&frontColor=#'+options.revverFront+'&gradColor=#'+options.revverGrad+'&shareUrl=revver',{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/rutube\.ru/i)){mediaType='obj';
mediaWidth=mediaWidth||"470px";
mediaHeight=mediaHeight||"353px";
mediaSplit=URL.split('=');
mediaId=mediaSplit[1];
preload=new Swiff('http://video.rutube.ru/'+mediaId,{movie:'http://video.rutube.ru/'+mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/seesmic\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"435px";
mediaHeight=mediaHeight||"355px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[5];
preload=new Swiff('http://seesmic.com/Standalone.swf?video='+mediaId,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/tudou\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"400px";
mediaHeight=mediaHeight||"340px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[5];
preload=new Swiff('http://www.tudou.com/v/'+mediaId,{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/twitvid\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"600px";
mediaHeight=mediaHeight||"338px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[3];
preload=new Swiff('http://www.twitvid.com/player/'+mediaId,{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/twitvid\.io/i)){mediaType='obj';
mediaWidth=mediaWidth||"580px";
mediaHeight=mediaHeight||"323px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[3];
preload=new Swiff('http://twitvid.io/embed/'+mediaId,{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/ustream\.tv/i)){mediaType='obj';
mediaWidth=mediaWidth||"400px";
mediaHeight=mediaHeight||"326px";
preload=new Swiff(URL+'&amp;viewcount='+options.usViewers+'&amp;autoplay='+options.autoplay,{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/youku\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"480px";
mediaHeight=mediaHeight||"400px";
mediaSplit=URL.split('id_');
mediaId=mediaSplit[1];
preload=new Swiff('http://player.youku.com/player.php/sid/'+mediaId+'=/v.swf',{width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/youtube\.com\/watch/i)){mediaType='obj';
mediaSplit=URL.split('v=');
mediaId=mediaSplit[1];
if (mediaId.match(/fmt=18/i)){mediaFmt='&ap=%2526fmt%3D18';
mediaWidth=mediaWidth||"560px";
mediaHeight=mediaHeight||"345px";}else if (mediaId.match(/fmt=22/i)){mediaFmt='&ap=%2526fmt%3D22';
mediaWidth=mediaWidth||"640px";
mediaHeight=mediaHeight||"385px";}else{mediaFmt=options.ytQuality;
mediaWidth=mediaWidth||"480px";
mediaHeight=mediaHeight||"295px";}
preload=new Swiff('http://www.youtube.com/v/'+mediaId+'&autoplay='+options.autoplayNum+'&fs='+options.fullscreenNum+mediaFmt+'&border='+options.ytBorder+'&color1=0x'+options.ytColor1+'&color2=0x'+options.ytColor2+'&rel='+options.ytRel+'&showinfo='+options.ytInfo+'&showsearch='+options.ytSearch,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/youtube\.com\/view/i)){mediaType='obj';
mediaSplit=URL.split('p=');
mediaId=mediaSplit[1];
mediaWidth=mediaWidth||"480px";
mediaHeight=mediaHeight||"385px";
preload=new Swiff('http://www.youtube.com/p/'+mediaId+'&autoplay='+options.autoplayNum+'&fs='+options.fullscreenNum+mediaFmt+'&border='+options.ytBorder+'&color1=0x'+options.ytColor1+'&color2=0x'+options.ytColor2+'&rel='+options.ytRel+'&showinfo='+options.ytInfo+'&showsearch='+options.ytSearch,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/veoh\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"410px";
mediaHeight=mediaHeight||"341px";
mediaSplit=URL.split('videos/');
mediaId=mediaSplit[1];
preload=new Swiff('http://www.veoh.com/videodetails2.swf?permalinkId='+mediaId+'&player=videodetailsembedded&videoAutoPlay='+options.AutoplayNum,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/viddler\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"437px";
mediaHeight=mediaHeight||"370px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[4];
preload=new Swiff(URL,{id:'viddler_'+mediaId,
movie: URL,
classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen, id:'viddler_'+mediaId, movie: URL}});
startEffect();}else if (URL.match(/viddyou\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"416px";
mediaHeight=mediaHeight||"312px";
mediaSplit=URL.split('=');
mediaId=mediaSplit[1];
preload=new Swiff('http://www.viddyou.com/get/v2_'+options.vuPlayer+'/'+mediaId+'.swf',{id: mediaId,
movie:'http://www.viddyou.com/get/v2_'+options.vuPlayer+'/'+mediaId+'.swf',
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/vimeo\.com/i)){mediaType='obj';
mediaWidth=mediaWidth||"640px";
mediaHeight=mediaHeight||"360px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[3];
preload=new Swiff('http://www.vimeo.com/moogaloop.swf?clip_id='+mediaId+'&amp;server=www.vimeo.com&amp;fullscreen='+options.fullscreenNum+'&amp;autoplay='+options.autoplayNum+'&amp;show_title='+options.vmTitle+'&amp;show_byline='+options.vmByline+'&amp;show_portrait='+options.vmPortrait+'&amp;color='+options.vmColor,{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/12seconds\.tv/i)){mediaType='obj';
mediaWidth=mediaWidth||"430px";
mediaHeight=mediaHeight||"360px";
mediaSplit=URL.split('/');
mediaId=mediaSplit[5];
preload=new Swiff('http://embed.12seconds.tv/players/remotePlayer.swf',{id: mediaId,
width: mediaWidth,
height: mediaHeight,
params:{flashvars:'vid='+mediaId+'', wmode: options.wmode, bgcolor: options.bgcolor, allowscriptaccess: options.scriptaccess, allowfullscreen: options.fullscreen}});
startEffect();}else if (URL.match(/\#mb_/i)){mediaType='inline';
mediaWidth=mediaWidth||options.defaultWidth;
mediaHeight=mediaHeight||options.defaultHeight;
URLsplit=URL.split('#');
preload=$(URLsplit[1]).get('html');
startEffect();}else{mediaType='url';
mediaWidth=mediaWidth||options.defaultWidth;
mediaHeight=mediaHeight||options.defaultHeight;
mediaId="mediaId_"+new Date().getTime();
preload=new Element('iframe',{'src': URL,
'id': mediaId,
'width': mediaWidth,
'height': mediaHeight,
'frameborder': 0
});
startEffect();}}
return false;}
function startEffect(){if (mediaType=="img"){mediaWidth=preload.width;
mediaHeight=preload.height;
image.setStyles({backgroundImage: "url("+URL+")", display: ""});}else if (mediaType=="obj"){if (Browser.Plugins.Flash.version<8){image.setStyles({backgroundImage: "none", display: ""});
image.set('html', '<div id="mbError"><b>Error</b><br/>Adobe Flash is either not installed or not up to date, please visit <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" title="Get Flash" target="_new">Adobe.com</a> to download the free player.</div>');
mediaWidth=options.DefaultWidth;
mediaHeight=options.DefaultHeight;}else{image.setStyles({backgroundImage: "none", display: ""});
preload.inject(image);}}else if (mediaType=="inline"){image.setStyles({backgroundImage: "none", display: ""});
image.set('html', preload);}else if (mediaType=="url"){image.setStyles({backgroundImage: "none", display: ""});
preload.inject(image);}else{image.setStyles({backgroundImage: "none", display: ""});
image.set('html', '<div id="mbError"><b>Error</b><br/>This file type is not supported, please visit <a href="iaian7.com/webcode/mediaboxAdvanced" title="mediaboxAdvanced" target="_new">iaian7.com</a> or contact the website author for more information.</div>');
mediaWidth=options.defaultWidth;
mediaHeight=options.defaultHeight;}
image.setStyles({width: mediaWidth, height: mediaHeight});
title.set('html', (options.showCaption)? captionSplit[0] : "");
caption.set('html', (options.showCaption && (captionSplit.length > 1))? captionSplit[1] : "");
number.set('html', (options.showCounter && (images.length > 1))? options.counterText.replace(/{x}/, activeImage+1).replace(/{y}/, images.length): "");
if ((prevImage >=0)&& (images[prevImage][0].match(/\.gif|\.jpg|\.png|twitpic\.com/i)))preloadPrev.src=images[prevImage][0].replace(/twitpic\.com/i, "twitpic.com/show/full");
if ((nextImage >=0)&& (images[nextImage][0].match(/\.gif|\.jpg|\.png|twitpic\.com/i)))preloadNext.src=images[nextImage][0].replace(/twitpic\.com/i, "twitpic.com/show/full");
mediaWidth=image.offsetWidth;
mediaHeight=image.offsetHeight+bottom.offsetHeight;
if (options.resizeOpening){fx.resize.start({width: mediaWidth, height: mediaHeight, marginTop: -(mediaHeight/2), marginLeft: -mediaWidth/2});}else{center.setStyles({width: mediaWidth, height: mediaHeight, marginTop: -(mediaHeight/2), marginLeft: -mediaWidth/2});imageAnimate();}}
function imageAnimate(){fx.image.start(1);}
function captionAnimate(){center.className="";
if (prevImage >=0)prevLink.style.display="";
if (nextImage >=0)nextLink.style.display="";
fx.bottom.start(1);}
function stop(){if (preload)preload.onload=$empty;
fx.resize.cancel();
fx.image.cancel().set(0);
fx.bottom.cancel().set(0);
$$(prevLink, nextLink).setStyle("display", "none");}
function close(){if (activeImage >=0){preload.onload=$empty;
image.set('html', '');
for (var f in fx)fx[f].cancel();
center.setStyle("display", "none");
fx.overlay.chain(setup).start(0);}
return false;}})();
Mediabox.scanPage=function(){var links=$$("a").filter(function(el){return el.rel && el.rel.test(/^lightbox/i);});
$$(links).mediabox({/* Put custom options here */}, null, function(el){var rel0=this.rel.replace(/[[]|]/gi," ");
var relsize=rel0.split(" ");
return (this==el)|| ((this.rel.length > 8)&& el.rel.match(relsize[1]));});};
window.addEvent("domready", Mediabox.scanPage);

