/*--------------------------------------------------
FLASH
Version:   0.0.3
Generated: 31/3/2010
--------------------------------------------------*/
UKISA.namespace("UKISA.widget.Flash");UKISA.widget.Flash={locale:null,context:null,modal:function(g,c,b,j,f,d,k){var a,h,i,e;i=YAHOO.util.Event;e=YAHOO.util.Dom;i.stopEvent(g);i.preventDefault(g);if(!UKISA.widget.Flash.locale){UKISA.widget.Flash.locale=UKISA.locale.get("widget.Flash")}h=UKISA.widget.Flash.locale;this.configure(c,"ukisa-flash-modal-loading",b,j,f,d);a=new UKISA.widget.Modal("ukisa-flash-modal");a.hideEvent.subscribe(function(){UKISA.widget.Flash.remove("ukisa-flash-modal-loading")});e.setStyle(a.body,"width",this.context.width+"px");e.setStyle(a.body,"height",this.context.height+"px");a.show();if(typeof swfobject!=="undefined"){this.embed(c)}else{a.setBody((function(){var l=document.createElement("p");l.className="error";l.innerHTML="Sorry, there was a problem, please try again.";return l})())}return a},configure:function(c,b,a,m,h,j,d,e,l){var k,f,g,n;this.context=null;g=function(r){var q,p;q=0;for(p in r){if(r.hasOwnProperty(p)){q++}}return q};k=function(r){if(typeof(r)!="object"){return r}if(r==null){return r}var q=new Object();for(var p in r){q[p]=k(r[p])}return q};this.context=new k(this.locale);if(a&&typeof a==="number"){this.context.width=a}if(m&&typeof m==="number"){this.context.height=m}if(typeof a==="object"){j=a}if(typeof m==="object"){d=m}if(g(j)){for(f in j){if(typeof this.context.vars[f]!=="undefined"){this.context.vars[f]=j[f]}}}else{if(j!==null){}}if(g(d)){for(f in d){if(typeof this.context.params[f]!=="undefined"){this.context.params[f]=d[f]}}}else{if(d!==null){}}if(g(e)){for(f in e){this.context.attributes[f]=e[f]}}else{if(e!==null){}}if(l!=="undefined"){this.context.callback=l}if(h){this.context.supports=h}if(c.toLowerCase().indexOf(".flv")!==-1){this.context.vars.streamName=this.context.movieDir+c.substring(0,c.indexOf("."));this.size(c,a,m,n)}this.context.canvas=b},swap:function(d,c,a,k,g,h,e,f,j){var b,i;b=document.getElementById(c);if(b){if(b.width&&b.height){a=b.width;k=b.height}i=this;YAHOO.util.Event.addListener(b,"click",function(){if(!UKISA.widget.Flash.locale){UKISA.widget.Flash.locale=UKISA.locale.get("widget.Flash")}locale=UKISA.widget.Flash.locale;i.configure(d,c,a,k,g,h,e);i.add(d,c,a,k,g,h,e,f,j)})}},add:function(c,b,a,i,f,g,d,e,h){if(!UKISA.widget.Flash.locale){UKISA.widget.Flash.locale=UKISA.locale.get("widget.Flash")}locale=UKISA.widget.Flash.locale;this.configure(c,b,a,i,f,g,d,e,h);this.embed(c)},embed:function(b){var a=this.context;if(b.toLowerCase().indexOf(".flv")!==-1){return this.embedVideo(b)}else{return this.embedFlash(b)}},embedVideo:function(b){var a=this.context;swfobject.embedSWF(a.flashDir+"ukisa/flash/player.swf",a.canvas,a.width,a.height,a.supports,null,a.vars,a.params,a.attributes,a.callback)},embedFlash:function(b){var a=this.context;swfobject.embedSWF(a.flashDir+b,a.canvas,a.width,a.height,a.supports,null,a.vars,a.params,a.attributes,a.callback)},remove:function(a){if(typeof swfobject!=="undefined"){swfobject.removeSWF(a)}},size:function(b,d,a,c){var e=this.context.vars.skinName.split("/").pop();if(typeof this.locale.skins[e]!=="undefined"){e=this.locale.skins[e];this.context.width+=e.left+e.right;this.context.height+=e.top+e.bottom}},log:function(a){if(window.console){console.log(a)}}};
