var UKISA=UKISA||{};UKISA.util=UKISA.util||{};UKISA.Flash={config:{styleUrl:"/web/styles/",scriptUrl:"/web/scripts/",yuiUrl:"/web/yui/build/",url:"/web/flash/",movieUrl:"/web/movies/",supports:"8.0.0",width:512,height:288,params:{quality:"high",scale:"noscale",pluginspage:"http://www.macromedia.com/go/getflashplayer",wmode:"transparent"},vars:{MM_ComponentVersion:"1",skinName:"web/flash/Halo_Skin_3",autoPlay:"false",autoRewind:true}},context:{},skins:{Halo_Skin_3:{top:11,right:11,bottom:40,left:11}},checkSWFObject:function(d){var b,c,a;b=this;c=function(){alert("Sorry, there has been a problem trying to play the video.")};if(typeof swfobject==="undefined"){if(typeof YAHOO!=="undefined"&&typeof YAHOO.util.Get!=="undefined"){this.log("swfobject cannot be found.");a=YAHOO.util.Get.script(this.context.scriptUrl+"swfobject.js",{onSuccess:function(){d.call(b)},onFailure:function(){c.call(b)}})}else{this.log("YAHOO or YAHOO.util.Get and swfobject cannot be found.");c.call(b)}}else{this.log("SWFObject found.");d.call(b)}},embedVideo:function(b,e,d,a,f,g,c){this.context.vars.streamName=this.context.movieUrl+b.substring(0,b.indexOf("."));this.checkSWFObject(function(){this.log("Flash successful");swfobject.embedSWF(this.context.url+"flv_player.swf",e,d,a,this.context.supports,null,this.context.vars,this.context.params)});this.log("Embedding a FLV movie");this.log("FLV path: "+this.context.vars.streamName);this.log("Movie path: "+this.context.url+b)},embedFlash:function(b,e,d,a,f,g,c){this.log("Movie path: "+this.context.url+b);this.log("Movie width: "+this.context.width);this.log("Movie height: "+this.context.height);this.checkSWFObject(function(){this.log("Flash successful");swfobject.embedSWF(this.context.url+b,e,d,a,this.context.supports,null,this.context.vars,this.context.params)})},embed:function(c,b,a,g,f,d,j){var e;this.reset(f,d);var h=this.size(c,a,g,j);a=h.width;g=h.height;if(c.toLowerCase().indexOf(".flv")!==-1){return this.embedVideo.call(this,c,b,a,g,f,d,j)}else{return this.embedFlash.call(this,c,b,a,g,f,d,j)}},modal:function(e,j,b,l,i,f,m){var d,a,k,h,k,g,c;if(this.context&&this.context.modal){this.context.modal.destroy()}this.reset(i,f);h=function(){a=document.createElement("div");hd=a.cloneNode(false);bd=a.cloneNode(false);ft=a.cloneNode(false);a.id="ukisa-flash-modal";a.className="yui-panel-container yui-dialog shadow";hd.className="hd";bd.className="bd";ft.className="ft";a.appendChild(hd);a.appendChild(bd);a.appendChild(ft);document.body.appendChild(a);k=this;this.context.modal=new YAHOO.widget.Panel("ukisa-flash-modal",{fixedcenter:true,modal:true,visible:false,close:true,underlay:"shadow",constraintoviewport:true,zIndex:1100,autofillheight:"body"});if(j&&j.length){this.context.modal.setHeader(j)}j=j||"this";this.context.modal.renderEvent.subscribe(function(){var q,t,o,n,s,r;k.log("renderEvent");k.log("context.width: "+k.context.width);k.log("context.height: "+k.context.height);var p=k.size(e,b,l,m);o=p.width;n=p.height;q=document.getElementById("ukisa-flash-modal-flash");q.style.width=o+"px";q.style.height=n+"px";t=YAHOO.util.Dom.getRegion("ukisa-flash-modal");s=t.right-t.left;r=t.bottom-t.top;k.embed(e,"ukisa-flash-modal-flash",b,l,i,f,m);k.log("regionWidth: "+s);k.log("regionHeight: "+r);s-=2;r-=2;this.cfg.setProperty("width",s+"px");this.cfg.setProperty("height",r+"px")});this.context.modal.setBody('<div id="ukisa-flash-modal-flash">Flash plugin is required to view "'+j+'".</div>');this.context.modal.hideEvent.subscribe(function(){UKISA.Flash.remove("ukisa-flash-modal-flash")});this.context.modal.render();this.context.modal.show()};k=this;if(typeof YAHOO!=="undefined"&&typeof YAHOO.widget.Panel!="undefined"){h.call(k)}else{g=YAHOO.util.Get.css(this.context.styleUrl+"container.css");c=YAHOO.util.Get.script(this.context.yuiUrl+"container/container-min.js",{onSuccess:function(){h.call(k)},onFailure:function(){alert("Sorry, there has been a problem trying to play the video.")}})}return false},size:function(c,f,b,d){var g,a,e;a=f||this.context.width;e=b||this.context.height;if(c.toLowerCase().indexOf(".flv")!==-1){g=this.context.vars.skinName;if(d&&d.vars&&d.vars.skinName){g=d.vars.skinName}g=g.split("/").pop();if(typeof this.skins[g]!=="undefined"){this.log("Skin: "+g);g=this.skins[g];a+=g.left+g.right;e+=g.top+g.bottom}}this.log("Movie width: "+a);this.log("Movie height: "+e);return{width:a,height:e}},remove:function(a){if(typeof swfobject!=="undefined"){swfobject.removeSWF(a)}},reset:function(c,d){var e,b;b=(this.context&&this.context.modal)?this.context.modal:null;this.context=null;e=function(h){if(typeof(h)!="object"){return h}if(h==null){return h}var g=new Object();for(var f in h){g[f]=e(h[f])}return g};this.context=new e(this.config);if(b){this.context.modal=b}for(var a in c){if(typeof this.context.vars[a]!=="undefined"){this.context.vars[a]=c[a]}}for(var a in d){if(typeof this.context.params[a]!=="undefined"){this.context.params[a]=d[a]}}},log:function(a){if(window.console){console.log(a)}}};
