
function FlashObject(target,src,w,h,ver) { this.window=window; this.target=target; this.src=src; this.width=w; this.height=h; this.version=ver; this.id = target + "Movie"; this.params=new Object(); this.flashvars= this.insert=FlashObject_Insert; this.addParam=FlashObject_AddParam; }
function FlashObject_Insert() { if (!document.getElementById) return; var ver=(this.version)?this.version:7;  if (!this.target) 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 fvars=""; if (this.flashvars) { for (var i in this.flashvars) { fvars=fvars + ((fvars=='')?'':'&') + i +"="+escape(this.flashvars[i]); } } if (fvars!='') this.addParam("FlashVars",fvars);
  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 FlashObject_AddParam(p,v) { this.params[p]=v; }
function InsertFlash(target,src,w,h,ver) { var flash=new FlashObject(target,src,w,h,ver); flash.insert(); }

function fv() { var v,o,l,s,n="ShockwaveFlash",w="$version",x=navigator?navigator.plugins:undefined; if(x&&x.length>0) { for(l=0; l<x.length&&!v; l++) { s=x[l]; if(sc(s.name,"Shockwave Flash")) { v=spl(s.description,"Shockwave Flash ")[1]; } } }  else {  n=n+"."+n;  try {o=new ActiveXObject(n+".7"); v=o.GetVariable(w);}catch(e){} if (!v) { try{ o=new ActiveXObject(n+".6"); v="WIN 6,0,21,0"; o.AllowScriptAccess="always"; v=o.GetVariable(w);}catch(e){}} if (!v) { try{ o=new ActiveXObject(n+".3"); v="WIN 3,0,18,0"; v=o.GetVariable(w);}catch(e){}} if (!v) { try{ o=new ActiveXObject(n); v="WIN 2,0,0,11"; v=o.GetVariable(w);}catch(e){}} } if (!v) return 0; v=v.replace(/^\D*/g,''); v=v.replace(/\D.*$/g,''); return parseInt(v,10); }
function sc(d,a){ return (d.indexOf(a)>-1); }
function spl(d,a) { return d.split(a) }

/* Flash Inserts */

function HomeFlash(target,float,list) { 
  var v=fv(); if (v<9) return; 
  var flash=new FlashObject(target,'/i/swf/VisionSlideshow.swf',950,400,9); 
  flash.flashvars.float=float;
  flash.flashvars.list=list;
  flash.wmode='transparent';
  flash.insert();
}

