
/**** FLASH ****/
function CMSFlashObject(target,src,w,h,ver,detect) { this.window=window; this.detect=detect; this.target=target; this.src=src; this.width=w; this.height=h; this.version=ver; this.id = target + "Movie"; this.params=new Object(); this.insert=CMSFlashObject_Insert; this.addParam=CMSFlashObject_AddParam; }
function CMSFlashObject_Insert() { if (!document.getElementById) return; var ver=(this.version)?parseFloat(this.version):7; if (this.detect) { var FV=CMSSWFVer(); if (!(FV>=ver)) return; } var div=this.window.document.getElementById(this.target); if (!div)return; if (!this.src) return; var src=this.src; if (!this.width) return; if (!this.height) return; 
  var html='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ver+',0,0,0" width="'+this.width+'" height="'+this.height+'" id="'+this.id+'" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+src+'" /><param name="quality" value="high" />'+((this.bgcolor)?'<param name="bgcolor" value="'+this.bgcolor+'" />':'')+((this.wmode)?'<param name="wmode" value="'+this.wmode+'">':'');
  for (p in this.params) { html+='<param name="'+p+'" value="'+this.params[p]+'"/>'; }
  html += '<embed src="'+src+'" quality="high" width="'+this.width+'" height="'+this.height+'" name="'+this.id+'" align="middle"' +((this.bgcolor)?' bgcolor="'+this.bgcolor+'"':'')+ ((this.wmode)?' wmode="'+this.wmode+'"':'')+' allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"';
  for (p in this.params) { html+=' '+p+'="'+this.params[p]+'"'; }
  html += '/></object>'; div.innerHTML=html;
}
function CMSFlashObject_AddParam(p,v) { this.params[p]=v; }
function CMSInsertFlash(target,src,w,h,ver,detect) { var flash=new CMSFlashObject(target,src,w,h,ver,detect); flash.insert(); }
function CMSSWFVer() { // v7+ Only
  var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?1:0; var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?1:0; var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?1:0;
  if (navigator.plugins != null && navigator.plugins.length > 0) { if (navigator.plugins["Shockwave Flash"]) { var D = navigator.plugins["Shockwave Flash"].description; var DA=D.split(" "); var VA = DA[2].split("."); return parseFloat(VA[0]+"."+VA[1]); } }
  else if (isIE && isWin && !isOpera) { var e; try { var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7"); var D = axo.GetVariable("$version"); var DA = D.split(" "); var VA = DA[1].split(","); return parseFloat(VA[0]+'.'+VA[1]); } catch (e) { } }
  return 0;
}
/***************/


/**** FLASH TEXT ****/
var FLASHTEXTS=new Object();
function CMSGetFlashText(id) { var O=FLASHTEXTS[id]; if (!O) O=new Object(); O.id=id; FLASHTEXTS[id]=O; return(O); }
function CMS_UpdateFlashText(id,cmd,w,h) { var MOVIE = document.getElementById(id + 'Movie'); if (!MOVIE) return; if (cmd=="both") { MOVIE.width=w*1; MOVIE.height=h*1; } if (cmd=="width") { MOVIE.width=w*3; } if (cmd=="height") { MOVIE.height=h*1; } }

function CMSFlashText(swf,target,width,height) { var O=new Object(); O.swf=swf; O.target=target; O.texttarget=target; O.text=''; O.flashversion=8; O.width=width; O.height=height; O.maxwidth=0; O.insert=CMS_FTOI; O.trim=CMS_FTT; O.pad=CMS_FTP; O.move=CMS_FTM; return(O); }
function CMS_FTT(T,R,B,L) { if (R==null) R=T; if (B==null) B=T; if (L==null) L=R; this.trimRect=T+'|'+R+'|'+B+'|'+L; return(this); }
function CMS_FTP(T,R,B,L) { if (R==null) R=T; if (B==null) B=T; if (L==null) L=R; this.padRect=T+'|'+R+'|'+B+'|'+L; return(this); }
function CMS_FTM(X,Y) { this.moveXY=X+'|'+Y; return(this); }
function CMS_FTOI() { if (!document.getElementById) return;
  var T=this.text; if (T=='') { var div=document.getElementById(this.texttarget); if (!div) return; T=div.innerText; if (!T) T=div.textContent; }
  if (!T) return; if (T=='') return;
  var W=this.width; if (!W) W=200; var H=this.height; if (!H) H=20;
  var MW=this.width; if (this.maxwidth) MW=this.maxwidth;
  var US="both"; if (this.width) US="height";  if (this.height) US="width"; if ((this.width)&&(this.height)) US="none"; 
  var flash=new CMSFlashObject(this.target,"/_cms/swf/"+this.swf+".swf?id="+this.target+"&t="+escape(T) + ((MW)? ("&maxwidth="+MW):"") + "&update="+ US + ((this.moveXY)?("&move="+this.moveXY):"") + ((this.padRect)?("&pad="+this.padRect):"") + ((this.trimRect)?("&trim="+this.trimRect):"") + "&rnd="+((new Date()).getTime()),W,H,this.flashversion,1); 
  flash.insert();    
}

function CMSFormButton(id,href) { var O=CMSGetFlashText('FormButton'+id); O.href=href; var FT=CMSFlashText('flashbutton','FormButton'+id,300,28); FT.texttarget='FormButtonLink'+id; FT.insert(); }
function CMSFormButtonClick(id) { var O=CMSGetFlashText(id); if (O.href) window.location=O.href; }



