(function(g){g.tools=g.tools||{};g.tools.overlay={version:"1.1.2",addEffect:function(a,b,c){f[a]=[b,c]},conf:{top:"10%",left:"center",absolute:false,speed:"normal",closeSpeed:"fast",effect:"default",close:null,oneInstance:true,closeOnClick:true,closeOnEsc:true,api:false,expose:null,target:null}};var f={};g.tools.overlay.addEffect("default",function(a){this.getOverlay().fadeIn(this.getConf().speed,a)},function(a){this.getOverlay().fadeOut(this.getConf().closeSpeed,a)});var h=[];function e(u,c){var r=this,p=g(this),q=g(window),b,a,v,s=c.expose&&g.tools.expose.version;var t=c.target||u.attr("rel");a=t?g(t):null||u;if(!a.length){throw"Could not find Overlay: "+t}if(u&&u.index(a)==-1){u.click(function(i){r.load(i);return i.preventDefault()})}g.each(c,function(i,j){if(g.isFunction(j)){p.bind(i,j)}});g.extend(r,{load:function(l){if(r.isOpened()){return r}var i=f[c.effect];if(!i){throw'Overlay: cannot find effect : "'+c.effect+'"'}if(c.oneInstance){g.each(h,function(){this.close(l)})}l=l||g.Event();l.type="onBeforeLoad";p.trigger(l);if(l.isDefaultPrevented()){return r}v=true;if(s){a.expose().load(l)}var k=c.top;var j=c.left;var m=a.outerWidth({margin:true});var n=a.outerHeight({margin:true});if(typeof k=="string"){k=k=="center"?Math.max((q.height()-n)/2,0):parseInt(k,10)/100*q.height()}if(j=="center"){j=Math.max((q.width()-m)/2,0)}if(!c.absolute){k+=q.scrollTop();j+=q.scrollLeft()}a.css({top:k,left:j,position:"absolute"});l.type="onStart";p.trigger(l);i[0].call(r,function(){if(v){l.type="onLoad";p.trigger(l)}});if(c.closeOnClick){g(document).bind("click.overlay",function(x){if(!r.isOpened()){return}var o=g(x.target);if(o.parents(a).length>1){return}g.each(h,function(){this.close(x)})})}if(c.closeOnEsc){g(document).unbind("keydown.overlay").bind("keydown.overlay",function(o){if(o.keyCode==27){g.each(h,function(){this.close(o)})}})}return r},close:function(j){if(!r.isOpened()){return r}j=j||g.Event();j.type="onBeforeClose";p.trigger(j);if(j.isDefaultPrevented()){return}v=false;f[c.effect][1].call(r,function(){j.type="onClose";p.trigger(j)});var i=true;g.each(h,function(){if(this.isOpened()){i=false}});if(i){g(document).unbind("click.overlay").unbind("keydown.overlay")}return r},getContent:function(){return a},getOverlay:function(){return a},getTrigger:function(){return u},getClosers:function(){return b},isOpened:function(){return v},getConf:function(){return c},bind:function(i,j){p.bind(i,j);return r},unbind:function(i){p.unbind(i);return r}});g.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(i,j){r[j]=function(k){return r.bind(j,k)}});if(s){if(typeof c.expose=="string"){c.expose={color:c.expose}}g.extend(c.expose,{api:true,closeOnClick:c.closeOnClick,closeOnEsc:false});var d=a.expose(c.expose);d.onBeforeClose(function(i){r.close(i)});r.onClose(function(i){d.close(i)})}b=a.find(c.close||".close");if(!b.length&&!c.close){b=g('<div class="close"></div>');a.prepend(b)}b.click(function(i){r.close(i)})}g.fn.overlay=function(a){var b=this.eq(typeof a=="number"?a:0).data("overlay");if(b){return b}if(g.isFunction(a)){a={onBeforeLoad:a}}var c=g.extend({},g.tools.overlay.conf);a=g.extend(true,c,a);this.each(function(){b=new e(g(this),a);h.push(b);g(this).data("overlay",b)});return a.api?b:this}})(jQuery);(function(e){e.tools=e.tools||{};e.tools.expose={version:"1.0.5",conf:{maskId:null,loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:0.8,color:"#456",api:false}};function d(){if(e.browser.msie){var b=e(document).height(),a=e(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,b-a<20?a:b]}return[e(window).width(),e(document).height()]}function f(c,n){var l=this,b=e(this),k=null,m=false,a=0;e.each(n,function(g,h){if(e.isFunction(h)){b.bind(g,h)}});e(window).resize(function(){l.fit()});e.extend(this,{getMask:function(){return k},getExposed:function(){return c},getConf:function(){return n},isLoaded:function(){return m},load:function(h){if(m){return l}a=c.eq(0).css("zIndex");if(n.maskId){k=e("#"+n.maskId)}if(!k||!k.length){var j=d();k=e("<div/>").css({position:"absolute",top:0,left:0,width:j[0],height:j[1],display:"none",opacity:0,zIndex:n.zIndex});if(n.maskId){k.attr("id",n.maskId)}e("body").append(k);var i=k.css("backgroundColor");if(!i||i=="transparent"||i=="rgba(0, 0, 0, 0)"){k.css("backgroundColor",n.color)}if(n.closeOnEsc){e(document).bind("keydown.unexpose",function(p){if(p.keyCode==27){l.close()}})}if(n.closeOnClick){k.bind("click.unexpose",function(p){l.close(p)})}}h=h||e.Event();h.type="onBeforeLoad";b.trigger(h);if(h.isDefaultPrevented()){return l}e.each(c,function(){var p=e(this);if(!/relative|absolute|fixed/i.test(p.css("position"))){p.css("position","relative")}});c.css({zIndex:Math.max(n.zIndex+1,a=="auto"?0:a)});var g=k.height();if(!this.isLoaded()){k.css({opacity:0,display:"block"}).fadeTo(n.loadSpeed,n.opacity,function(){if(k.height()!=g){k.css("height",g)}h.type="onLoad";b.trigger(h)})}m=true;return l},close:function(g){if(!m){return l}g=g||e.Event();g.type="onBeforeClose";b.trigger(g);if(g.isDefaultPrevented()){return l}k.fadeOut(n.closeSpeed,function(){g.type="onClose";b.trigger(g);c.css({zIndex:e.browser.msie?a:null})});m=false;return l},fit:function(){if(k){var g=d();k.css({width:g[0],height:g[1]})}},bind:function(g,h){b.bind(g,h);return l},unbind:function(g){b.unbind(g);return l}});e.each("onBeforeLoad,onLoad,onBeforeClose,onClose".split(","),function(g,h){l[h]=function(i){return l.bind(h,i)}})}e.fn.expose=function(a){var b=this.eq(typeof a=="number"?a:0).data("expose");if(b){return b}if(typeof a=="string"){a={color:a}}var c=e.extend({},e.tools.expose.conf);a=e.extend(c,a);this.each(function(){b=new f(e(this),a);e(this).data("expose",b)});return a.api?b:this}})(jQuery);(function(){var q=typeof jQuery=="function";var k={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(q){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:k}}function l(){if(o.done){return false}var b=document;if(b&&b.getElementsByTagName&&b.getElementById&&b.body){clearInterval(o.timer);o.timer=null;for(var a=0;a<o.ready.length;a++){o.ready[a].call()}o.ready=null;o.done=true}}var o=q?jQuery:function(a){if(o.done){return a()}if(o.timer){o.ready.push(a)}else{o.ready=[a];o.timer=setInterval(l,13)}};function r(b,a){if(a){for(key in a){if(a.hasOwnProperty(key)){b[key]=a[key]}}}return b}function s(b){switch(t(b)){case"string":b=b.replace(new RegExp('(["\\\\])',"g"),"\\$1");b=b.replace(/^\s?(\d+)%/,"$1pct");return'"'+b+'"';case"array":return"["+n(b,function(d){return s(d)}).join(",")+"]";case"function":return'"function()"';case"object":var c=[];for(var a in b){if(b.hasOwnProperty(a)){c.push('"'+a+'":'+s(b[a]))}}return"{"+c.join(",")+"}"}return String(b).replace(/\s/g," ").replace(/\'/g,'"')}function t(b){if(b===null||b===undefined){return false}var a=typeof b;return(a=="object"&&b.push)?"array":a}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function n(c,b){var a=[];for(var d in c){if(c.hasOwnProperty(d)){a[d]=b(c[d])}}return a}function m(f,h){var e=r({},f);var g=document.all;var c='<object width="'+e.width+'" height="'+e.height+'"';if(g&&!e.id){e.id="_"+(""+Math.random()).substring(9)}if(e.id){c+=' id="'+e.id+'"'}if(e.cachebusting){e.src+=((e.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(e.w3c||!g){c+=' data="'+e.src+'" type="application/x-shockwave-flash"'}else{c+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}c+=">";if(e.w3c||g){c+='<param name="movie" value="'+e.src+'" />'}e.width=e.height=e.id=e.w3c=e.src=null;for(var a in e){if(e[a]!==null){c+='<param name="'+a+'" value="'+e[a]+'" />'}}var d="";if(h){for(var b in h){if(h[b]!==null){d+=b+"="+(typeof h[b]=="object"?s(h[b]):h[b])+"&"}}d=d.substring(0,d.length-1);c+='<param name="flashvars" value=\''+d+"' />"}c+="</object>";return c}function p(c,f,b){var a=flashembed.getVersion();r(this,{getContainer:function(){return c},getConf:function(){return f},getVersion:function(){return a},getFlashvars:function(){return b},getApi:function(){return c.firstChild},getHTML:function(){return m(f,b)}});var g=f.version;var h=f.expressInstall;var e=!g||flashembed.isSupported(g);if(e){f.onFail=f.version=f.expressInstall=null;c.innerHTML=m(f,b)}else{if(g&&h&&flashembed.isSupported([6,65])){r(f,{src:h});b={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};c.innerHTML=m(f,b)}else{if(c.innerHTML.replace(/\s/g,"")!==""){}else{c.innerHTML="<h2>Flash version "+g+" or greater is required</h2><h3>"+(a[0]>0?"Your version is "+a:"You have no flash plugin installed")+"</h3>"+(c.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(c.tagName=="A"){c.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!e&&f.onFail){var d=f.onFail.call(this);if(typeof d=="string"){c.innerHTML=d}}if(document.all){window[f.id]=document.getElementById(f.id)}}window.flashembed=function(e,a,d){if(typeof e=="string"){var b=document.getElementById(e);if(b){e=b}else{o(function(){flashembed(e,a,d)});return}}if(!e){return}if(typeof a=="string"){a={src:a}}var c=r({},k);r(c,a);return new p(e,c,d)};r(window.flashembed,{getVersion:function(){var c=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var b=navigator.plugins["Shockwave Flash"].description;if(typeof b!="undefined"){b=b.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var d=parseInt(b.replace(/^(.*)\..*$/,"$1"),10);var h=/r/.test(b)?parseInt(b.replace(/^.*r(.*)$/,"$1"),10):0;c=[d,h]}}else{if(window.ActiveXObject){try{var f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(g){try{f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");c=[6,0];f.AllowScriptAccess="always"}catch(a){if(c[0]==6){return c}}try{f=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}if(typeof f=="object"){b=f.GetVariable("$version");if(typeof b!="undefined"){b=b.replace(/^\S+\s+(.*)$/,"$1").split(",");c=[parseInt(b[0],10),parseInt(b[2],10)]}}}}return c},isSupported:function(b){var a=flashembed.getVersion();var c=(a[0]>b[0])||(a[0]==b[0]&&a[1]>=b[1]);return c},domReady:o,asString:s,getHTML:m});if(q){jQuery.fn.flashembed=function(c,b){var a=null;this.each(function(){a=flashembed(this,c,b)});return c.api===false?this:a}}})();
