/* myModerator class
 * Copyrighted 2011 Bambit Technolgoies, Inc.
 * This code is provided as is and licensed to EVERSYS IT-Services GmbH.
 * Unauthorized reproduction is illegal.
 * This copyright notice must remain intact.
 */
 var myModerator_Global;

function myModerator() {
	this.FlashUrl="";
	this.Width="";
	this.Height="";	
	this.Location=new this.Point();
	this.Location.X=0;
	this.Location.Y=0;
	this.DoNotShowDays=0;
	this.PauseIfShown=false;
	this.PauseOnLoad=false;
	this.PositionMode='absolute';
	this.PositionVertical='fromBottom';
	this.PositionHorizontal='fromLeft';
	this.ReferenceID=null;
	this.RequiredVersionMajor=9;
	this.RequiredVersionMinor=0;
	this.GetAdobeFlashMsg="";
	this.GetAdobeFlash=true;
	this.ParseBrowser();
	this.BackgroundImage='images/transparent.gif';
	this.NeedsFix=false;
	this.WriteWrapper=true;
	this.FlashVars='';
	this.UrlArray=null;
	this.InitialX=0;
	this.Cookie=null;
	this.ShownCookie=null;
	this.HideAfterMaxPlays=false;
	this.PlayCountDays=null;
	this.PlayCountCookie=null;
	this.MaxPlayCount=0;
	this.MovieUrl=null;
	this.OncePerSession=false;
	this.HideWhenFinished=false;
	this.SkinUrl=null;
	this.OnFinishUrl="";
	this.OnClickUrl="";
	
	if(document.body.attachEvent) { this.isIE=true;} else { this.isIE=false;}
}
myModerator.MouseX=function( e ) {


	return e.pageX || ( e.clientX + ( document.documentElement.scrollLeft || document.body.scrollLeft ) );
}
myModerator.MouseY=function ( e ) {
	return e.pageY|| ( e.clientY + ( document.documentElement.scrollTop|| document.body.scrollTop ) );
}



myModerator.prototype.LockMouse=function() {
	
	this.MouseStartX=null;
	this.MouseStartY=null;
	if(this.isIE) {		
		
		document.attachEvent('onmousemove', myModerator.TrackMouse);
		document.attachEvent('onmouseup', myModerator.ReleaseMouse);
	} else {
		document.addEventListener('mousemove', myModerator.TrackMouse,false);
		document.addEventListener('mouseup', myModerator.ReleaseMouse,false);
	}
}
myModerator.prototype.GetMovie=function() {
	var ie = navigator.appName.indexOf("Microsoft") != -1;
	return (ie) ? window['myModerator_Container_o'] : document['myModerator_Container_o'];
}
myModerator.prototype.PausePlayback=function()  {
	var movie=this.GetMovie();
	movie.pausePlayback();
}



myModerator.prototype.trace=function(t) {
	//if(console!=undefined && console!=null)		console.log(t);
	
}
myModerator.ReleaseMouse=function(e) {
	
	if(document.body.attachEvent)	{

		
		document.detachEvent('onmousemove', myModerator.TrackMouse);
		document.detachEvent('onmouseup', myModerator.ReleaseMouse);
	} else {
	document.removeEventListener('mousemove', myModerator.TrackMouse,false);
	document.removeEventListener('mouseup', myModerator.ReleaseMouse,false);
	}
}
myModerator.TrackMouse=function(e) {
	if(myModerator.MouseStartX!=null)  {
		var curX=myModerator.MouseX(e);
		var curY=myModerator.MouseY(e);
		var diffX=curX-myModerator.MouseStartX;
		var diffY=curY-myModerator.MouseStartY;
		var obj=myModerator_Global.el('myModerator_Container');
		var src=myModerator_Global.el(myModerator_Global.ReferenceID);
		var srcX=myModerator_Global.GetObjectAbsoluteX(obj);
		
		var srcY=myModerator_Global.GetObjectAbsoluteY(obj);	
		srcX+=diffX;
		srcY+=diffY;
		obj.style.left=srcX + 'px';
		obj.style.top=srcY + 'px';
	}	
	myModerator.MouseStartX=myModerator.MouseX(e);
	myModerator.MouseStartY=myModerator.MouseY(e);
}

myModerator.prototype.Query=function(x) {
	if(this.UrlArray==null) {
		var res=new Array();
		var href=new String(window.location.href);
		var qi=href.indexOf('?');
		if(qi!=-1) {
			var tail=new String(href.substr(qi+1));
			var params=tail.split('&');
			for(var i=0;i<params.length;i++) {
				if(params[i].indexOf('=')!=-1) {
					var split=params[i].split('=');
					res[split[0].toLowerCase()]=split[1];
				} else {
						res[params[i].toLowerCase()]='';
					}
				}
			}
		this.UrlArray=res;
	}
	return this.UrlArray[x];
}

myModerator.prototype.AddUrlVarToFlashVars=function(a) {
	this.AddVarToFlashVars(a,this.Query(a));
} 

myModerator.prototype.AddVarToFlashVars=function(n,v) {
	this.FlashVars=this.FlashVars+n+'='+v+'&';
}

myModerator.prototype.AddUrlVarToFlashVarsRenamed=function(a,name) {
	this.FlashVars=this.FlashVars+name+'='+this.Query(a)+'&';
}
myModerator.prototype.Point=function(x,y){
	this.X=x;
	this.Y=y;
}

myModerator.prototype.GetTimeCookie=function() {
	this.Cookie= this.gc("isvTime");
}

myModerator.prototype.GetShownCookie=function() {
	this.ShownCookie= this.gc("isShown");
}
myModerator.prototype.GetPlayCookie=function() {
	this.PlayCountCookie= parseInt(this.gc("playCount"));
	if(isNaN(this.PlayCountCookie)) { this.PlayCountCookie=0;}
}


myModerator.prototype.cc=function(n,v,d) {
	if (d) {
		var dt = new Date();
		dt.setTime(dt.getTime()+(d*24*3600000));
		var expires = "; expires="+dt.toGMTString();
	}
	else var expires = "";
	document.cookie = n+"="+v+expires+"; path=/";
	
}



myModerator.prototype.gc=function(n) {
	var ne = n + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(ne) == 0) return c.substring(ne.length,c.length);
	}
	return null;
}

myModerator.prototype.ec=function(name) {
	createCookie(name,"",-1);
}


myModerator.prototype.SetPlayCookie=function() {
	
	this.trace("Setting play cookie");
	var count=this.GetPlayCookie();
	
	if(isNaN(this.PlayCountCookie)) { count=1;}
	else {count=this.PlayCountCookie+1;}
	
	this.cc("playCount",count,this.PlayCountDays);
}

myModerator.prototype.SetShownCookie=function() {
	this.trace("setting pause");
	if(this.PauseIfShown) {
		this.cc("isShown",true);
		
	} else {
		this.cc("isShown",null);
	}
}


myModerator.prototype.SetTimeCookie=function() {
	if(this.OncePerSession) {
		this.trace('scc: Session');
		this.cc("isvTime",null);
		
	} else {
		this.trace('scc:'+this.DoNotShowDays);
		this.cc("isvTime",this.DoNotShowDays);
	}
}

myModerator.prototype.ParseBrowser=function() {
	this.isNetscape=false;
	this.isFirefox=false;
	this.isIE=false;
	this.isOpera=false;
	this.isSafari=false;
	this.appName=navigator.appName;
	this.appVersion=navigator.appVersion;
	if(this.appName=="Netscape"&&parseFloat(this.appVersion)>4.7) {
		var uai=navigator.userAgent.indexOf("Firefox");
		if(uai!=-1) {
			this.isFirefox=true
			this.browserVersionMaj=parseInt(navigator.userAgent.charAt(uai+8));
		} else {
			this.isNetscape=true;
			this.browserVersionMaj=parseFloat(this.appVersion);
		}
	} else {
		var uai=navigator.appVersion.indexOf("MSIE");
		if(uai!=-1) {
			this.isIE=true;
			var temp=navigator.appVersion.split("MSIE")
			this.appVersion=parseFloat(temp[1]);
			this.browserVersionMaj=parseInt(this.appVersion);
		} else {
			var uai=navigator.userAgent.indexOf("Opera");
			if(uai!=-1){
				this.isOpera=true;
				this.browserVersionMaj=parseInt(navigator.userAgent.charAt(uai+6));
			}
		}
	}
	if(document.compatMode=='CSS1Compat') {
		this.isCompatible=true;
	} else {
		this.isCompatible=false;
	}
}
myModerator.prototype.el=function(e) { return document.getElementById(e);}
myModerator.prototype.AnchorToObjectX=function(){
	if(this.isIE) {		
		window.attachEvent('onresize',AnchorResizedX);
		window.attachEvent('onload',AnchorResizedX);
	} else {
		window.addEventListener('load',AnchorResizedX,false);
		window.addEventListener('resize',AnchorResizedX,false);
	}
}

myModerator.prototype.IsToBePaused=function() {
	if(this.PauseOnLoad){
		return true;
	}
	
	if(this.DoNotShowDays>0){
		
		if(this.Cookie!=null) {
			return true;
		} 
	}
	
	
	if(this.PauseIfShown){
		this.GetShownCookie();
		this.trace('ShownCookie: '+this.ShownCookie);
		if(this.ShownCookie!=null){
			this.SetShownCookie();
			return true;
		}
		this.SetShownCookie();
	}
	return false;
}

myModerator.prototype.Intialize=function(timeout) {
	/* Pass parameters to movie */
	if(this.MovieUrl != null )	{		this.AddVarToFlashVars('movieUrl',this.MovieUrl);	}
	if(this.HideWhenFinished!=null) {		this.AddVarToFlashVars('hideWhenFinished',this.HideWhenFinished);	}
	if(this.SkinUrl!=null) {		this.AddVarToFlashVars('skinUrl',this.SkinUrl);	}
	this.AddVarToFlashVars('isPaused',this.IsToBePaused());
	
	this.AddVarToFlashVars('Width',this.Width);
	this.AddVarToFlashVars('Height',this.Height);
	
	/* Initialize global variable */
	myModerator_Global=this;
	//	Before we go further, check our cookie values
	if(this.DoNotShowDays>0 || this.OncePerSession){	
		this.GetTimeCookie();
			if(this.Cookie!=null && this.PauseIfShown==false) {
				return true;
		} 
		this.SetTimeCookie();
	}
	
	if(this.MaxPlayCount>0 && this.HideAfterMaxPlays==true) {
		this.trace("Checking hide playcount");
		this.GetPlayCookie();
		if(this.PlayCountCookie != null && this.PlayCountCookie>=this.MaxPlayCount) {
		this.trace('returning true');
			return true;
		}
		this.SetPlayCookie();
	}
	
	//	Initialize.  X is our currwent set X to begin
	this.InitialX=this.Location.X;
	
	//	If we are referencing an object that exists
	if(this.ReferenceID!=null && this.el(this.ReferenceID)!=null) {
		this.AnchorToObjectX();
		this.LockInitialX();
		this.LockInitialY();
	}
	//	If we're fixed, we need to fix for IE 6 or FF <2
	// NOTE: This shoudl be removed, we no longer sypport IE <>
	if(this.PositionMode=='fixed')
	{
		if(this.isIE) {
			this.trace('isIE');
			if(this.appVersion<7 || !this.isCompatible)	{
				this.trace('<7');
				this.PositionMode='absolute';
				this.NeedsFix=true;
			}
		}
		if(this.isFirefox && this.browserVersionMaj<2) {
		this.trace('FF');
			this.PositionMode='absolute';
			window.addEventListener('scroll',RestorePosition,false);
			window.addEventListener('size',RestorePosition,false);
	
		}
	} 
	this.WriteDiv();
	if(this.ReferenceID!=null && this.el(this.ReferenceID)!=null) {
		this.AnchorToObjectX();
	}
}

myModerator.prototype.PlaceElement=function (o,s,l,t) {
	var obj=this.el(o); var src=this.el(s);
	var srcLoc=GetObjectPosition(src);
	var nl=l+srcLoc[0];
	var nt=t+srcLoc[1];
	obj.style.left=nl + 'px';
	obj.style.top= nt + 'px';
}
myModerator.prototype.CheckFlashVersion = function() {
	var maj=0;
	var min=0;
	if(navigator.plugins != null && navigator.plugins.length > 0) {
		if(navigator.plugins["Shockwave Flash"]) {
			var d=navigator.plugins["Shockwave Flash"].description;
			var a=d.split(" ");
			var version=a[2];
			var a1=version.split(".");
			maj=a1[0];
			min=a1[1];
			
		} 
	}
	else {
		try {
			// version will be set for 7.X or greater players
			var o = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		 	var d = o.GetVariable("$version");
			var a=d.split(" ");
			var version=a[1];
			var a1=version.split(",");
			maj=a1[0];
			min=a1[1];
		} catch (e) {
		}
	}
	if(maj>this.RequiredVersionMajor || (maj==this.RequiredVersionMajor && min>=this.RequiredVersionMinor)) { return true;}
	else {	return false;}
	
}
	

myModerator.prototype.GetObjectPosition=function(o) {
	var l,t;
	l=t=0;
	if(o.offsetParent) {
		l=o.offsetLeft;
		t=o.offsetTop;
		while((o=o.offsetParent)) {
			l+=o.offsetLeft;
			t+=o.offsetTop;
		}
	}
	return [l,t];
}

myModerator.prototype.CloseVideo=function() {
	this.el('myModerator_Container').style.display='none';
}

myModerator.prototype.RedirectFinishUrl=function(){
	if(this.OnFinishUrl)
		window.location = this.OnFinishUrl;
}

myModerator.prototype.RedirectClickUrl=function(){
	if(this.OnClickUrl)
		window.location = this.OnClickUrl;
}
myModerator.prototype.GetObjectAbsoluteLocation=function(o) {
	var p=new this.Point(0,0);
	while(o!=null) {
		p.X+=o.offsetLeft;
		p.Y+=o.offsetTop;
		o=o.offsetParent
	}
	return p;
}

myModerator.prototype.GetObjectAbsoluteX=function(o) {
	var x;
	x=0;
	while(o!=null) {
		x+=o.offsetLeft;
		o=o.offsetParent
	}
	return x;
}

myModerator.prototype.GetObjectAbsoluteY=function(o) {
	var y;
	y=0;
	while(o!=null) {
		y+=o.offsetTop;
		o=o.offsetParent
	}
	return y;
}
myModerator.prototype.CreateStandardContainer=function() {
	var div=document.createElement('div');
	div.setAttribute('id','myModerator_Container');
	var style='z-index:10001;border: 0px; width:'+this.Width+'px;height:'+this.Height+';'+this.GetPositionStyleInfo();
	this.SetStyle(div,style);
	div.setAttribute('style',style);
	return div;
}

myModerator.prototype.SetStyle=function(element, declaration) {
	if(!this.isIE) {
		element.setAttribute('style',declaration);
		return;
	}
   if (declaration.charAt(declaration.length-1)==';')
     declaration = declaration.slice(0, -1);
   var k, v;
   var splitted = declaration.split(';');
   for (var i=0, len=splitted.length; i<len; i++) {
      k = this.rzCC(splitted[i].split(':')[0]);
      v = splitted[i].split(':')[1];
	  //eval('alert(k+"="+v);');
      eval("element.style."+k+"='"+v+"'");

   }
}
 
 myModerator.prototype.rzCC=function(s){
   // thanks http://www.ruzee.com/blog/2006/07/\
   // retrieving-css-styles-via-javascript/
   for(var exp=/-([a-z])/; 
       exp.test(s); 
       s=s.replace(exp,RegExp.$1.toUpperCase()));
   return s;
 }
 
myModerator.prototype.WriteStandardContainer= function(){
	document.write('<div id="myModerator_Container" style="z-index:10001;');
	this.WritePositionStyleInfo();
	document.write('z-index:10000;border:0px;width:'+this.Width+'px;height:'+this.Height+';">');
}
myModerator.prototype.GetPositionStyleInfo=function() {
	var styleInfo='position:'+this.PositionMode+'; ';
	
	if(this.PositionVertical=='fromBottom')
	{
		if(this.ReferenceID==null)
		{
			styleInfo+='bottom:' + this.Location.Y+'px;';
		}
		else
		{
			styleInfo += 'top:' + this.Location.Y + 'px;'; 
		}
	}
	else
		styleInfo+='top:' + this.Location.Y+'px;';	
	
	
	if(this.PositionHorizontal=='fromLeft')
	{
		styleInfo+='left:' + this.InitialX+'px;';
	}
	else
	{
		if(this.ReferenceID == null)
		{
			styleInfo+='right:' + this.InitialX+'px;';
		}
		else
		{
			styleInfo+='left:' + eval(this.InitialX - this.Width) +'px;';
		}
	}
	return styleInfo;
}
myModerator.prototype.WritePositionStyleInfo=function() {
	document.write(this.GetPositionStyleInfo());
	return;
}
myModerator.prototype.GetNeedFlashContainer= function(){
	var div=document.createElement('div');
	div.setAttribute('id','myModerator_Container');
	var style='z-index:10001;border: 0px; margin: 4px;'+this.GetPositionStyleInfo();
	this.SetStyle(div,style);
	div.setAttribute('style',style);
	return div;
}


myModerator.prototype.CreateDiv=function() {
	var div;
	if(this.CheckFlashVersion()) {
		var elem=this.CreateMovieObject();
		if(this.WriteWrapper) {
			div=this.CreateStandardContainer();
			var a=this.CreateGetFlashLink();
			if(this.isIE) {
				div.appendChild(this.CreateEmbedObject());
			} else {
				var s=this.CreateSubMovieObject();
				s.appendChild(a);
				elem.appendChild(s);
				div.appendChild(elem);
			}
			
			
		} else  { div=elem;}
		
	}
	else {
		if(this.GetAdobeFlash == true)
		{
			var div = this.GetNeedFlashContainer();
			div.innerHTML = this.GetNeedFlash();
		}
	}
	return div;
}

myModerator.prototype.WriteDiv=function() {
	var d=this.CreateDiv();
		document.getElementsByTagName('body')[0].appendChild(d);
	return;
}

myModerator.prototype.GetNeedFlash=function() {
		if(this.GetAdobeFlashMsg == "")
			this.GetAdobeFlashMsg = "Flash Version "+this.RequiredVersionMajor+"."+this.RequiredVersionMinor+" is needed.<br/><a href='http://www.adobe.com/go/getflash/' target='_blank'>Get it here</a>";
		return this.GetAdobeFlashMsg;
}

myModerator.prototype.LockInitialX=function() {
	var src=this.el(myModerator_Global.ReferenceID);
	var srcLoc=this.GetObjectAbsoluteX(src);
	if(this.PositionHorizontal == "fromLeft")
	{
		this.InitialX=srcLoc+this.Location.X;
	}
	else
	{
		if(src==null)
		{
			this.InitialX=srcLoc+this.Location.X;
		}
		else
		{
			this.InitialX=srcLoc-this.Location.X;
		}
	}
	
}

myModerator.prototype.LockInitialY=function() {
	var src=this.el(myModerator_Global.ReferenceID);
	var srcLoc=this.GetObjectAbsoluteY(src);

	if(video.PositionVertical=='fromBottom') {
		this.Location.Y = srcLoc - this.Location.Y - this.Height;
	}
	else
	{
		this.Location.Y += srcLoc;
	}
}
	
function AnchorResizedX() {
	var obj=myModerator_Global.el('myModerator_Container');
	var src=myModerator_Global.el(myModerator_Global.ReferenceID);
	var srcLoc=myModerator_Global.GetObjectAbsoluteX(src);
		
	var nl = myModerator_Global.InitialX;
	myModerator_Global.trace('nl ' + nl);
	if(src==null){
		obj.style.left=nl;
	}
	else{
		if('fromLeft' == myModerator_Global.PositionHorizontal){
			obj.style.left=eval(eval(srcLoc + src.style.width.replace("px", "")) + myModerator_Global.Location.X) + 'px';
		}
		else{
			obj.style.left=eval(srcLoc - obj.style.width.replace("px", "") - myModerator_Global.Location.X) + 'px';
		}
	}
	
}

var shown=0;
var lastNum=0;
function getIEFixHeight() {
	var loc;
	var scrollTop;
	var clientHeight;
  if( typeof( window.innerWidth ) == 'number' ) { //Non-IE
    clientHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { //IE 6+ in 'standards compliant mode'
    clientHeight  = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible
    clientHeight  = document.body.clientHeight;
  }
	if( typeof( window.pageYOffset ) == 'number' ) {	//Netscape compliant
    scrollTop = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) { //DOM compliant
    scrollTop = document.body.scrollTop;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrollTop = document.documentElement.scrollTop;
  } else {scrollTop=0;}
	if(myModerator_Global.PositionVertical=='fromBottom'){
		loc=scrollTop+clientHeight-myModerator_Global.Location.Y-myModerator_Global.el('myModerator_Container').clientHeight ;	
	} else {
		loc=scrollTop+myModerator_Global.Location.Y;
	}
	//if(shown<2 && lastNum!=loc) 
	//	{ alert(loc);shown++;lastNum=loc;}	
	return loc;
}

myModerator.prototype.WriteMovieObject=function()
{
this.trace('writing movie');
	document.write('<object ');
	if(!this.WriteWrapper) { 
		document.write(' id="myModerator_Container"  style="');
		this.WritePositionStyleInfo();
		document.write('z-index: 1000;"');
	} else {
		document.write(' id="myModerator_Container_o"  ');
	}
	document.write(' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,19,0" width="');
	document.write(this.Width+'px" height="'+this.Height+'">\n');
	document.write('\t<param name="movie" value="'+this.FlashUrl+'" />\n');
	document.write('\t<param name="quality" value="high" />\n');
	if(this.FlashVars!='') 
	{
		document.write('\t<param name="FlashVars" value="'+this.FlashVars+'"');
	}
	document.write('\t<param name="menu" value="false" />\n');
	document.write('\t<param name="wmode" value="transparent" />\n');
	document.write('\t<embed id="myModeratorVideo" src="'+this.FlashUrl+'" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="');
	document.write(this.Width+'px" height="'+this.Height+'" menu="false"');
	if(this.FlashVars!='') 
	{
		document.write('FlashVars="'+this.FlashVars+'"');
	}
	document.write('></embed>\n');
	document.write('</object>\n');
}


myModerator.prototype.CreateParameter=function(n,v) {
	var p1=document.createElement("param");
	p1.setAttribute('name',n);
	p1.setAttribute('value',v);
	return p1;
}
myModerator.prototype.CreateMovieObject=function()
{
	this.trace('Creating movie');
	var movie = document.createElement("object");
	if(!this.WriteWrapper) { 
		movie.setAttribute('id','myModerator_Container');
		movie.setAttribute('style',this.GetPositionStyleInfo()+'z-index: 1000;');
	} else {
		movie.setAttribute('id','myModerator_Container_o');
	}
	movie.setAttribute("classid","clsid:D27CDB6E-AE6D-11cf-96B8-444553540000");
//		movie.setAttribute("codebase","http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,19,0");
	movie.setAttribute("width",this.Width+'px');
	movie.setAttribute("height",this.Height+'px');
	movie.appendChild(this.CreateParameter("movie",this.FlashUrl));
	movie.appendChild(this.CreateParameter("quality","high"));
	if(this.FlashVars!='') 
	{
		movie.appendChild(this.CreateParameter("FlashVars",this.FlashVars));
	}
	movie.appendChild(this.CreateParameter("menu","false"));
	movie.appendChild(this.CreateParameter("wmode","transparent"));
	return movie;
}
myModerator.prototype.CreateGetFlashLink=function()
{
	var anchor=document.createElement("a");
	anchor.setAttribute('href','http://www.adobe.com/go/getflash');
	var img=document.createElement('img');
	img.setAttribute('src','http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif');
	img.setAttribute('alt','Get Adobe Flash player');
	anchor.appendChild(img);
	return anchor;
}
myModerator.prototype.CreateSubMovieObject=function()
{
	this.trace('Creating sub movie');
	var movie = document.createElement("object");
	if(!this.WriteWrapper) { 
		movie.setAttribute('id','myModerator_Container');
		movie.setAttribute('style',this.GetPositionStyleInfo()+'z-index: 1000;');
	} else {
		movie.setAttribute('id','myModerator_Container_o');
	}
	movie.setAttribute("type","application/x-shockwave-flash");
	movie.setAttribute("data",this.FlashUrl);
	movie.setAttribute("width",this.Width+'px');
	movie.setAttribute("height",this.Height+'px');
	movie.appendChild(this.CreateParameter("movie",this.FlashUrl));
	movie.appendChild(this.CreateParameter("quality","high"));
	if(this.FlashVars!='') 
	{
		movie.appendChild(this.CreateParameter("FlashVars",this.FlashVars));
	}
	movie.appendChild(this.CreateParameter("menu","false"));
	movie.appendChild(this.CreateParameter("wmode","transparent"));
	
	return movie;
}

myModerator.prototype.CreateEmbedObject=function() {
	var embed=document.createElement('embed');
	embed.setAttribute('id',"myModeratorVideo");
	embed.setAttribute('src',this.FlashUrl);
	embed.setAttribute('quality',"high");
	embed.setAttribute('wmode',"transparent");
	embed.setAttribute('pluginspage',"http://www.macromedia.com/go/getflashplayer");
	embed.setAttribute('type',"application/x-shockwave-flash");
	embed.setAttribute('width',this.Width+'px');
	embed.setAttribute('height',this.Height+'px');
	embed.setAttribute('menu','false');
	if(this.FlashVars!='') 
	{
		embed.setAttribute('FlashVars',this.FlashVars);
	}
	
	return embed;
	
	
}

myModerator.prototype.FixIEFixed=function(){
	if(document.body.currentStyle['backgroundImage']=='none')
	{
		document.body.style.backgroundImage='url('+this.BackgroundImage+')';
		document.body.style.backgroundRepeat='no-repeat';
		document.body.style.backgroundAttachment='fixed';
	}
	this.el('myModerator_Container').style.setExpression('top','getIEFixHeight()');
}

myModerator.prototype.FixFF15Position=function(){
return;
	var scrollTop=	window.pageYOffset;
	var clientHeight=window.innerHeight;

	if(this.InitialHeight== undefined) { this.InitialHeight=this.el('myModerator_Container').clientHeight;}
	if(this.PositionVertical=='fromBottom'){
		loc = scrollTop + clientHeight - 
				this.Location.Y-this.InitialHeight ;	
	} else {
		loc=scrollTop+myModerator_Global.Location.Y;
	}
	this.el('myModerator_Container').style.top=loc+'px';
}

function RestorePosition() {
	myModerator_Global.FixFF15Position();
}

