/*
	FlowBox V1.06 an enhanced branch of the colorbox v1.1.6 - built specifically for integration of FlowPlayer to web pages
	FlowBox and the additional methods to talk to the Flash Player contained herein ¬© 2009 SymfoniP.com - Ronan Cashell / Kevin Burns- all rights reserved
*/
(function(k){var z,n,f,r,b,m,E,A,q,t,x,l,j,C,h,w,e,p,B,u,v,g,d,o,s;function a(){l.css({position:"absolute",width:k(window).width(),height:k(window).height(),top:k(window).scrollTop(),left:k(window).scrollLeft()})}function c(F){if(F.keyCode==37){F.preventDefault();k(document).unbind("keydown",c);k("a#contentPrevious").click()}else{if(F.keyCode==39){F.preventDefault();k(document).unbind("keydown",c);k("a#contentNext").click()}}}function D(){if(k("#flowboxInlineTemp").length>0){C.children().each(function(){if(this.id=="contentCurrent"||this.id=="contentNext"||this.id=="contentPrevious"||this.id=="contentTitle"){k(this).remove()}});C.children().insertAfter("#flowboxInlineTemp")}if(k("#modalLoadedContent #modalVideo")){k("#modalVideo").appendTo("body").hide()}if(A){k(A).remove()}}function y(F,G){return(typeof F=="string")?(F.match(/%/)?(G/100)*parseInt(F,10):parseInt(F,10)):F}jQuery.noConflict();jQuery(document).ready(function(F){F("body").append(l=F('<div id="modalBackgroundOverlay" />').hide(),q=F('<div id="flowbox" />').css("opacity",0));F('<div id="modalWrap" />').appendTo(q).append(F('<div><div id="borderTopLeft" /><div id="borderTopCenter" /><div id="borderTopRight" /></div>'),e=F('<div id="borderMiddleLeft" />'),j=F('<div id="modalContent" />'),p=F('<div id="borderMiddleRight" />'),F('<div><div id="borderBottomLeft" /><div id="borderBottomCenter" /><div id="borderBottomRight" /></div>'));j.append(C=F('<div id="modalLoadedContent"><a id="contentNext" href="#"></a><a id="contentPrevious" href="#"></a><span id="contentCurrent"></span><span id="contentTitle"></span><div id="preloadPrevious"></div><div id="preloadNext"></div><div id="preloadClose"></div></div>'),$flowPlayer=F('<div id="modalVideo" />'),x=F('<div id="modalLoadingOverlay" />'),h=F('<a id="modalClose" href="#"></a>'));F(document).bind("keydown.colorClose",function(G){if(G.keyCode==27){G.preventDefault();F.fn.flowbox.close()}});h.click(function(G){G.preventDefault();F.fn.flowbox.close()});w=F("#borderTopCenter");B=F("#borderBottomCenter");r=w.height()+B.height()+j.outerHeight(true)-j.height();b=e.width()+p.width()+j.outerWidth(true)-j.width();f=C.outerHeight(true);n=C.outerWidth(true);C.empty();q.css({"padding-bottom":r,"padding-right":b}).hide();F("#contentPrevious, #contentNext, #modalClose").live("mouseover",function(){F(this).addClass("hover")});F("#contentPrevious, #contentNext, #modalClose").live("mouseout",function(){F(this).removeClass("hover")})});k.fn.flowbox=function(H,M,N){function F(R,V,T,Q){var P=document.documentElement.clientHeight;var S=P/2-V/2;var O=document.documentElement.clientWidth/2-R/2;if(V>P){S-=(V-P)}if(S<0){S=0}if(O<0){O=0}S+=k(window).scrollTop();O+=k(window).scrollLeft();R=R-b;V=V-r;function U(W){j[0].style.width=w[0].style.width=B[0].style.width=W.style.width;j[0].style.height=e[0].style.height=p[0].style.height=W.style.height}q.animate({height:V,width:R,top:S,left:O},{duration:T,complete:function(){if(Q){Q()}U(this);if(k.browser.msie&&k.browser.version<7){a()}},step:function(){U(this)}})}var J=[];function L(){if(H.preloading!==false&&E.length>1&&E[m].href.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)){var P,O;P=m>0?E[m-1].href:E[E.length-1].href;O=m<E.length-1?E[m+1].href:E[0].href;return[k("<img />").attr("src",O),k("<img />").attr("src",P)]}return false}function G(){x.show();if(k(this).attr("id")=="contentPrevious"){m=m>0?m-1:E.length-1}else{m=m<E.length-1?m+1:0}I(E[m].href,E[m].title);return false}function K(R,Q){if(q.data("open")!==true){return false}var T=H.transition=="none"?0:H.transitionSpeed;C.remove();C=k(R);centerVideo=0;if(E[m].href.match(/\.(flv|mp4|m4v|mov|f4v|FLV|MP4|M4V|MOV|F4V)(?:\?([^#]*))?(?:#(.*))?$/i)){centerVideo=u}else{centerVideo=0}C.hide().appendTo("body").css({width:(H.fixedWidth)?H.fixedWidth-n-b:C.width()-centerVideo}).css({height:(H.fixedHeight)?H.fixedHeight-f-r:C.height()+centerVideo}).attr({id:"modalLoadedContent"}).append(Q).prependTo(j);if(k("#modalPhoto").length>0&&H.fixedHeight){var P=(parseInt(C[0].style.height,10)-parseInt(k("#modalPhoto")[0].style.height,10))/2;k("#modalPhoto").css({marginTop:(P>0?P:0)})}function O(U){F(parseInt(C[0].style.width,10)+n+b,parseInt(C[0].style.height,10)+f+r,U,function(){if(q.data("open")!==true){return false}C.show();x.hide();k(document).bind("keydown",c);if(N){N()}if(H.transition==="fade"){q.animate({opacity:1},T)}return true})}if(H.transition=="fade"){q.animate({opacity:0},T,function(){O(0)})}else{O(T)}var S=L();return true}function I(P,Q){D();var O="<p id='contentTitle'>"+Q+"</p>";if(P.match(/\.(flv|mp4|m4v|mov|f4v|FLV|MP4|M4V|MOV|F4V)(?:\?([^#]*))?(?:#(.*))?$/i)){contentType=""}else{contentType=""}if(E.length>1){O+="<span id='contentCurrent'> "+contentType+H.contentCurrent+"</span>";O=O.replace(/\{current\}/,m+1).replace(/\{total\}/,E.length);O+="<a id='contentPrevious' href='#'>"+H.contentPrevious+"</a><a id='contentNext' href='#'>"+H.contentNext+"</a> "}if(E[m].name=="inline"||H.inline){tmp=P.split("/");tmp1=tmp[tmp.length-1].split("#");P="#"+tmp1[tmp1.length-1];A=k('<div id="flowboxInlineTemp" />').hide().insertBefore(k(P)[0]);K(k(P).wrapAll("<div />").parent(),O)}else{if(H.iframe){K(k("<div><iframe name='iframe_"+new Date().getTime()+" 'frameborder=0 src ="+P+"></iframe></div>"),O)}else{if(P.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(.*))?$/i)){A=new Image();A.onload=function(){A.onload=null;K(k("<div />").css({width:this.width,height:this.height}).append(k(this).css({width:this.width,height:this.height,display:"block",margin:"auto"}).attr("id","modalPhoto")),O);if(E.length>1){k(this).css({cursor:"pointer"}).click(G)}};A.src=P}else{if(P.match(/\.(flv|mp4|m4v|mov|f4v|FLV|MP4|M4V|MOV|F4V)(?:\?([^#]*))?(?:#(.*))?$/i)){if(typeof defWidth=="undefined"){defWidth=parseInt(k("#modalVideo").width());defHeight=parseInt(k("#modalVideo").height())}classWidth=defWidth;classHeight=defHeight;anchorClasses=k(E[m]).attr("class").split(" ");for(i=0;i<anchorClasses.length;i++){className=anchorClasses[i];if(className.substring(0,3)=="sym"){tmpDim=className.substring(3).split("x");classWidth=parseInt(tmpDim[0]);classHeight=parseInt(tmpDim[1])}}k("#modalVideo").width(classWidth).height(classHeight);K(k("<div />").css({width:(classWidth+u),height:(classHeight+u)}),O);k("#modalVideo").prependTo(k("#modalLoadedContent")).show();if(typeof M.flowplayerloc!="undefined"){g=M.flowplayerloc}else{g="/swf/flowplayer-3.1.4.swf"}M.clip.url=P;M.screen.width=classWidth;M.screen.height=classHeight;$f("modalVideo",g,M)}else{A=k("<div />").load(P,function(R,S){if(S=="success"){K(k(this),O)}else{K(k("<p>Request unsuccessful.</p>"))}})}}}}}if(typeof H.bgOpacity!="undefined"&&parseFloat(H.bgOpacity)>=1){H.bgOpacity=parseInt(H.bgOpacity)/100}u=5;k(this).unbind("click.flowbox").bind("click.flowbox",function(){if(H.fixedWidth){H.fixedWidth=y(H.fixedWidth,document.documentElement.clientWidth)}if(H.fixedHeight){H.fixedHeight=y(H.fixedHeight,document.documentElement.clientHeight)}if(this.rel&&this.rel!="nofollow"&&this.rel!="self"){E=k("a[rel='"+this.rel+"']");m=k(E).index(this)}else{E=k(this);m=0}if(q.data("open")!==true){k(document).bind("keydown",c);h.html(H.modalClose);l.css({opacity:H.bgOpacity}).show();q.data("open",true).css({opacity:1});if(H.overlayClass!=""){l.attr("class",H.overlayClass)}else{if(H.overlayImage!=""){l.css({"background-image":"url("+H.overlayImage+")","background-repeat":"repeat","background-position":"0 0",opacity:H.bgOpacity})}else{l.css({"background-color":H.overlayColor,opacity:H.bgOpacity})}}F(y(H.initialWidth,document.documentElement.clientWidth),y(H.initialHeight,document.documentElement.clientHeight),0);if(k.browser.msie&&k.browser.version<7){k(window).bind("resize scroll",a)}}I(H.href?H.href:E[m].href,H.title?H.title:E[m].title);k("a#contentPrevious, a#contentNext").die().live("click",G);if(H.overlayClose!==false){l.css({cursor:"pointer"}).click(function(){k.fn.flowbox.close()})}return false});if(H.open!==false&&q.data("open")!==true){k(this).triggerHandler("click.flowbox")}return this.each(function(){})};k.fn.flowbox.close=function(){k("#contentTitle").remove();D();l.css({cursor:"auto"}).fadeOut("fast");q.stop(true,false).removeData("open").fadeOut("fast",function(){C.remove()});k(document).unbind("keydown",c);k(window).unbind("resize scroll",a);return false};k.fn.flowbox.settings={transition:"elastic",transitionSpeed:250,initialWidth:"400",initialHeight:"400",fixedWidth:false,fixedHeight:false,inline:false,iframe:false,href:false,title:false,bgOpacity:0.5,preloading:true,contentCurrent:" {current} of {total}",contentPrevious:"previous",contentNext:"next",modalClose:"close",open:false,overlayClose:true,overlayCursor:"pointer",overlayImage:"",overlayColor:"#7f7f7f",overlayClass:"",showImages:true,flowboxVideo:"a[href$=flv],a[href$=mp4],a[href$=m4v],a[href$=mov],a[href$=f4v],a[href$=MOV],a[href$=MP4],a[href$=F4V],a[href$=M4V]",flowboxImage:"a[href$=png],a[href$=PNG],a[href$=jpg],a[href$=JPG],a[href$=gif],a[href$=GIF]"};k.fn.flowbox.fp_settings={key:"",clip:{scaling:"scale",url:"",autoPlay:false,accelerated:true,autoBuffering:true},play:{label:"Play",replayLabel:"Play again"},logo:{url:"",fullscreenOnly:true,displayTime:15},screen:{width:640,height:360},plugins:{controls:{backgroundColor:"#131313",backgroundGradient:[0.3,0],autoHide:"always",all:false,play:true,mute:false,fullscreen:true,scrubber:true,height:20,buttonColor:"#8C838A",sliderColor:"#333333",progressColor:"#CCCCCC",bufferColor:"#666666"}}};k.fn.flowbox.initFlowbox=function(H,G,F){o=k.extend({},k.fn.flowbox.settings,H);d=k.extend({},k.fn.flowbox.fp_settings,F);lifb=k.extend({},o,G);lifb.iframe=true;if(o.showImages){k(k.fn.flowbox.settings.flowboxImage).flowbox(o,d)}k("a[name='iframe']").flowbox(lifb,d);k("a[name='inline'],a[name='flash'],a[name='ajax']").flowbox(o,d);k(k.fn.flowbox.settings.flowboxVideo).flowbox(o,d)}})(jQuery);
