/********************************************************************************************************************************
							PLEASE DO NOT EDIT OR MODIFY THIS FILE IN ANY WAY
						
If you have any questions or suggestions please contact Dave Pedowitz

Copyright (c) 2002 Warner Bros. All Rights Reserved
*********************************************************************************************************************************/

var d=document,l=location,ua=navigator.userAgent.toLowerCase();
var finalMediaTypes = [[1,"windows",".asx"],[2,"real",".rpm"],[4,"quicktime",".smil"]];
if (typeof(hasExternalCopy) == "undefined") {
	var finalBitRatesCopy = ["56K Modem (slow)", "100K DSL (medium)", "300K Cable/LAN (fast)", "500K Cable/LAN (fast)", "700K Cable/LAN (fast)"];
	var chooseCopy = "Choose your media player and connection speed.";
	var mediaPlayerCopy = "Media Player";
	var connectionCopy = "Connection Speed";
	var playCopy = "Play";
}

var finalBitRates = [[1,56000,"56",finalBitRatesCopy[0]],[2,100000,"100",finalBitRatesCopy[1]],[4,300000,"300",finalBitRatesCopy[2]],[8,500000,"500",finalBitRatesCopy[3]],[16,700000,"700",finalBitRatesCopy[4]]];
var chosenTypes=0,chosenRates=0;

function MediaPresenter(params) {
	this.cssClass = params.cssClass || null;
	this.cssHeaderClass = params.cssHeaderClass || null;
	this.validPath = params.validPath || null;
	this.defaultPlayer = params.defaultPlayer || null;
	this.checkType = (params.checkType != null)?params.checkType:true;
	this.checkSpeed = (params.checkSpeed != null)?params.checkSpeed:true;
	this.autoPlay = (params.autoPlay != null)?params.autoPlay:true;
	this.showControls = (params.showControls != null)?params.showControls:true;
	this.showWindowsStatus = (params.showWindowsStatus != null)?params.showWindowsStatus:false;
	this.playPath = l.pathname;
	this.q = l.search;
	this.c = d.cookie.toLowerCase();
	this.wbmCookie = false;
	this.wbcCookie = false;
	this.hasWindows = false;
	this.hasReal = false;
	this.hasQuicktime = false;
	this.windowsAvailable = false;
	this.realAvailable = false;
	this.quicktimeAvailable = false;
	this.normalized = false;
	this.mediaType;
	this.mediaSpeed;
	this.obj = "MediaPresenterObject"; eval(this.obj + "=this");
	this.pc = ua.indexOf("win") >= 0;
	this.pcAOL = ua.indexOf("aol") >= 0 && this.pc;
	this.mac = ua.indexOf("mac") >= 0;	
	this.redirect = new Function("path", "location.replace(path)");
	this.print = new Function("txt", "document.write(txt)");
	this.submitSelection = function() {	
		this.redirect(this.playPath + "?id=" + this.getParam('id') + "&type=" + this.mediaType + "&speed=" + this.mediaSpeed);
		return false;
	};
	this.setCookie = function() {d.cookie = "WBOLMediaCookie=<!>player=" + this.getParam('type') + "<!>speed=" + this.getParam('speed') + "<!>" + "; path=/;";};
}

MediaPresenter.prototype.getParam = function(arg) {
	if (this.q.indexOf(arg) >= 0) {
		var pntr = this.q.indexOf(arg) + arg.length + 1;
		if (this.q.indexOf("&", pntr) >= 0) {
			return this.q.substring(pntr, this.q.indexOf("&", pntr));
		} else {
			return this.q.substring(pntr, this.q.length);
		}
	} else {
		return null;
	}
}

MediaPresenter.prototype.getCookie = function(arg) {
	if (this.c.indexOf(arg) >= 0) {
		var pntr = this.c.indexOf(arg);
		if (this.c.indexOf(";", pntr) >= 0) {
			return this.c.substring(pntr, this.c.indexOf(";", pntr));
		} else {
			return this.c.substring(pntr, this.c.length);
		}
	} else {
		return null;
	}
}

MediaPresenter.prototype.init = function(o) {
	var wbc = this.getCookie("wbc=");
	if (wbc != null) {
		this.wbcCookie = true;
		this.hasWindows = wbc.indexOf("w1") >= 0;
		this.hasReal = wbc.indexOf("r1") >= 0;
		this.hasQuicktime = wbc.indexOf("q1") >= 0;
	}
	if (this.validPath != null && this.normalizeData(o)) {
		this.normalized = true;
		this.checkCookie();
		this.validateQuery();
	}
}

MediaPresenter.prototype.normalizeData = function(o){
	if (this.getParam('id') == null) this.redirect(this.validPath);
	if (o.clipIds != null) {
		this.qArgs = o.clipIds;
	} else {
		return false;
	}
	if (o.basePath != null) this.basePath = o.basePath;
	if (o.mediaTypes != null) this.mediaTypes = o.mediaTypes;
	if (o.bitRates != null) this.bitRates = o.bitRates;
	if (this.getParam('id') != null && o[this.getParam('id')] == null) {
		this[this.getParam('id')] = {};
		this[this.getParam('id')].mediaTypes = this.mediaTypes;
		this[this.getParam('id')].bitRates = this.bitRates;
		for (i = 0; i < this[this.getParam('id')].mediaTypes.length; i++) {
			if (this[this.getParam('id')].mediaTypes[i] == "windows") chosenTypes |= finalMediaTypes[0][0]; this.windowsAvailable = true;
			if (this[this.getParam('id')].mediaTypes[i] == "real") chosenTypes |= finalMediaTypes[1][0]; this.realAvailable = true;
			if (this[this.getParam('id')].mediaTypes[i] == "quicktime") chosenTypes |= finalMediaTypes[2][0]; this.quicktimeAvailable = true;
		}
		for (i = 0; i < this[this.getParam('id')].bitRates.length; i++) {
			if (this[this.getParam('id')].bitRates[i] == "56000") chosenRates |= finalBitRates[0][0];
			if (this[this.getParam('id')].bitRates[i] == "100000") chosenRates |= finalBitRates[1][0];
			if (this[this.getParam('id')].bitRates[i] == "300000") chosenRates |= finalBitRates[2][0];
			if (this[this.getParam('id')].bitRates[i] == "500000") chosenRates |= finalBitRates[3][0];
			if (this[this.getParam('id')].bitRates[i] == "700000") chosenRates |= finalBitRates[4][0];
		}
		for (g = 0; g < finalMediaTypes.length; g++) for (h = 0; h < finalBitRates.length; h++) {
			if (((finalMediaTypes[g][0] & chosenTypes) != 0) && ((finalBitRates[h][0] & chosenRates) != 0)) {
				if (this[this.getParam('id')][finalMediaTypes[g][1]] == null) this[this.getParam('id')][finalMediaTypes[g][1]] = {};
				this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]] = {};
				this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].path = this.basePath + this.getParam('id') + "_";
				if (finalMediaTypes[g][1] == "quicktime") this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].path += "qt_";
				this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].path += finalBitRates[h][2] + finalMediaTypes[g][2];
				if (o["k" + finalBitRates[h][1]] != null) {
					this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].w = o["k" + finalBitRates[h][1]].w;
					this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].h = o["k" + finalBitRates[h][1]].h;
				} else if (o[finalMediaTypes[g][1]]["k" + finalBitRates[h][1]] != null) {
					this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].w = o[finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].w;
					this[this.getParam('id')][finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].h = o[finalMediaTypes[g][1]]["k" + finalBitRates[h][1]].h;
				}
			}
		}
		return true;
	} else if (o[this.getParam('id')] != null) {
		this[this.getParam('id')] = o[this.getParam('id')];
		if (o.basePath != null) {}
		return true;
	} else {
		return false;
	}
}

MediaPresenter.prototype.checkCookie = function() {
	if (this.getCookie('wbolmediacookie') != null && this.getParam('speed') == null) {
		var wmc = this.getCookie('wbolmediacookie');
		var typeParam = wmc.substring(wmc.indexOf("player=") + 7, wmc.indexOf("<!>speed"));
		var speedParam = wmc.substring(wmc.indexOf("speed=") + 6, wmc.indexOf("0<!>") + 1);
		if (this[this.getParam('id')][typeParam] != null) {
			this.mediaType = typeParam;
			if (this[this.getParam('id')][typeParam]["k" + speedParam] != null) this.mediaSpeed = speedParam;
		}
		if (this.mediaType != null && this.mediaSpeed != null) {
			this.checkType = false;
			this.checkSpeed = false;
			this.wbmCookie = true;
		}
	}
}

MediaPresenter.prototype.validateQuery = function() {
	var t = this.qArgs.length;
	if (this.q.indexOf("type=") < 0) {
		if (this.q.indexOf("?id=") < 0) this.redirect(this.validPath);
		for (i = 0; i < this.qArgs.length; i++) {
			if (this.getParam('id') != this.qArgs[i]) t--
		}
		if (t == 0) this.redirect(this.validPath);
	} else {
		if ((this.q.indexOf("id=") || this.q.indexOf("type=") || this.q.indexOf("speed=")) < 0) {
			this.redirect(this.validPath);
		} else {
			for (i = 0; i < this.qArgs.length; i++) {
				if (this.getParam('id') != this.qArgs[i]) t--
			}
			if (t == 0) this.redirect(this.validPath);
			switch(this.getParam('type')) {
				case "real":break;
				case "windows":break;
				case "quicktime":break;
				default:this.redirect(this.playPath + "?id=" + this.getParam('id') + "&settings=true");
			}
			switch(this.getParam('speed')) {
				case "56000":break;
				case "100000":break;
				case "300000":break;
				case "500000":break;
				case "700000":break;
				default:this.redirect(this.playPath + "?id=" + this.getParam('id') + "&settings=true");
			}
			if (this[this.getParam('id')][this.getParam('type')]["k" + this.getParam('speed')] == null) {
				if (this.getParam('speed') > this[this.getParam('id')].bitRates[0] && this.getParam('speed') <= this[this.getParam('id')].bitRates[this[this.getParam('id')].bitRates.length -1]) {
					this.redirect(this.playPath + "?id=" + this.getParam('id') + "&type=" + this.getParam('type') + "&speed=" + this[this.getParam('id')].bitRates[this[this.getParam('id')].bitRates.length -2]);
				} else if (this.getParam('speed') < this[this.getParam('id')].mediaTypes[0]) {
					if (this[this.getParam('id')][this.getParam('type')]["k" + this[this.getParam('id')].bitRates[0]] != null) {
						this.redirect(this.playPath + "?id=" + this.getParam('id') + "&type=" + this.getParam('type') + "&speed=" + this[this.getParam('id')].bitRates[0]);
					} else {
						this.redirect(this.playPath + "?id=" + this.getParam('id') + "&type=" + this.getParam('type') + "&speed=" + this[this.getParam('id')].bitRates[1]);
					}
				} else if (this.getParam('speed') > this[this.getParam('id')].mediaTypes[this[this.getParam('id')].mediaTypes.length -1]) {
					this.redirect(this.playPath + "?id=" + this.getParam('id') + "&type=" + this.getParam('type') + "&speed=" + this[this.getParam('id')].mediaTypes[this[this.getParam('id')].mediaTypes.length -1]);
				}
			}
		}
	}
}

MediaPresenter.prototype.display = function() {
	if (this.normalized) {
		if (this.q.indexOf("settings") >= 0) {
			this.createSelections();
		} else if (this.getParam('speed') == null) {
			this.createSelections();
			if (this.mediaSpeed == null && this.checkSpeed) this.sniffSpeed();
			if (this.defaultPlayer != null || this.wbmCookie) this.submitSelection();
		} else {
			this.setCookie();
			this.displayMedia();
		}
	}
}

MediaPresenter.prototype.createSelections = function() {
	var selectionContent = "";
	var mediaTitle;
	var spanHeader = "";
	var spanText = "";
	var endSpan = "";
	if (this.cssHeaderClass != null) spanHeader = "<span class=\"" + this.cssHeaderClass + "\">"; endSpan = "</span>";
	if (this.cssClass != null) spanText = "<span class=\"" + this.cssClass + "\">"; endSpan = "</span>";
	selectionContent += "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"316\">\n"
		+ "<form name=\"wbMediaSelection\" onSubmit=\"return " + this.obj + ".submitSelection();\">\n<tr>\n<td align=\"center\" valign=\"top\">\n"
		+ spanHeader + chooseCopy + endSpan + "\n<br><br>\n</td>\n"
		+ "</tr>\n<tr>\n<td align=\"center\" valign=\"top\">\n"
		+ spanHeader + mediaPlayerCopy + endSpan + "</td>\n"
		+ "</tr>\n<tr>\n<td align=\"center\" valign=\"top\">\n"
		+ "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"55%\">\n<tr>\n<td align=\"left\" valign=\"top\">\n";
	for (i = 0; i < this[this.getParam('id')].mediaTypes.length; i++) {
		selected = "";
		if (this[this.getParam('id')].mediaTypes[i] == "windows") {
			mediaTitle = "Windows Media Player";
		} else if (this[this.getParam('id')].mediaTypes[i] == "real") {
			mediaTitle = "Real Player";
		} else if (this[this.getParam('id')].mediaTypes[i] == "quicktime") {
			mediaTitle = "QuickTime Player";
		}
		if (this.wbmCookie && this[this.getParam('id')].mediaTypes[i] == this.mediaType) {
			selected = "checked";
		} else if (this.defaultPlayer != null) {
			this.checkType = false;
			if (this[this.getParam('id')].mediaTypes[i] == this.defaultPlayer) selected = "checked";
		} else if (this.checkType && this.wbcCookie) {
			if (this.pc && !this.pcAOL) {
				if (this.hasWindows && this[this.getParam('id')].mediaTypes[i] == "windows") {
					selected = "checked";
				} else if (!this.hasWindows && this.hasReal && this[this.getParam('id')].mediaTypes[i] == "real") {
					selected = "checked";
				} else if (!this.hasWindows && !this.hasReal && this.hasQuicktime && this[this.getParam('id')].mediaTypes[i] == "quicktime") {
					selected = "checked";
				} else if (!this.hasWindows && !this.hasReal && !this.hasQuicktime) {
					if (this[this.getParam('id')].mediaTypes[i] == "windows") selected = "checked";
				}
			} else if (this.pcAOL) {
				if (this.hasReal && this[this.getParam('id')].mediaTypes[i] == "real") {
					selected = "checked";
				} else if (!this.hasReal && this.hasWindows && this[this.getParam('id')].mediaTypes[i] == "windows") {
					selected = "checked";
				} else if (!this.hasReal && !this.hasWindows && this.hasQuicktime && this[this.getParam('id')].mediaTypes[i] == "quicktime") {
					selected = "checked";
				} else if (!this.hasWindows && !this.hasReal && !this.hasQuicktime) {
					if (this[this.getParam('id')].mediaTypes[i] == "real") selected = "checked";
				}
			} else if (this.mac) {
				if (this.hasQuicktime && this[this.getParam('id')].mediaTypes[i] == "quicktime") {
					selected = "checked";
				} else if (!this.hasQuicktime && this.hasWindows && this[this.getParam('id')].mediaTypes[i] == "windows") {
					selected = "checked";
				} else if (!this.hasQuicktime && !this.hasWindows && this.hasReal && this[this.getParam('id')].mediaTypes[i] == "real") {
					selected = "checked";
				} else if (!this.hasWindows && !this.hasReal && !this.hasQuicktime) {
					if (this[this.getParam('id')].mediaTypes[i] == "quicktime") selected = "checked";
				}
			}
		} else if ((!this.checkType || !this.wbcCookie) && this.mediaType == null) {
			if (this.pc && !this.pcAOL || (!this.pc && !this.pcAOL && !this.mac)) {
				if (this[this.getParam('id')].mediaTypes[i] == "windows" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null) {
					selected = "checked";
				} else if (this[this.getParam('id')].mediaTypes[i] == "real" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null && !this.windowsAvailable) {
					selected = "checked";
				} else if (this[this.getParam('id')].mediaTypes[i] == "quicktime" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null && !this.windowsAvailable && !this.realAvailable) {
					selected = "checked";
				}
			} else if (this.pcAOL) {
				if (this[this.getParam('id')].mediaTypes[i] == "real" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null) {
					selected = "checked";
				} else if (this[this.getParam('id')].mediaTypes[i] == "windows" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null && !this.realAvailable) {
					selected = "checked";
				} else if (this[this.getParam('id')].mediaTypes[i] == "quicktime" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null && !this.realAvailable && !this.windowsAvailable) {
					selected = "checked";
				}
			} else if (this.mac) {
				if (this[this.getParam('id')].mediaTypes[i] == "quicktime" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null) {
					selected = "checked";
				} else if (this[this.getParam('id')].mediaTypes[i] == "windows" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null && !this.quicktimeAvailable) {
					selected = "checked";
				} else if (this[this.getParam('id')].mediaTypes[i] == "real" && this[this.getParam('id')][this[this.getParam('id')].mediaTypes[i]] != null && !this.quicktimeAvailable && !this.windowsAvailable) {
					selected = "checked";
				}
			}
		}
		if (selected != "") {
			this.mediaType = this[this.getParam('id')].mediaTypes[i];
			this.checkType = false;
		}
		selectionContent += "<input type=\"radio\" name=\"mediaType\" value=\"" + this[this.getParam('id')].mediaTypes[i]
			+ "\" onClick=\"" + this.obj + ".mediaType='" + this[this.getParam('id')].mediaTypes[i] + "'\" " + selected + ">"
			+ spanText + mediaTitle + endSpan + "<br>\n";
	}
	selectionContent += "</td>\n</tr>\n</table></td>\n</tr>\n<tr>\n<td align=\"center\" valign=\"top\">\n"
		+ spanHeader + connectionCopy + endSpan + "</td>\n"
		+ "</tr>\n<tr>\n<td align=\"center\" valign=\"top\">\n"
		+ "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"55%\">\n<tr>\n<td align=\"left\" valign=\"top\">\n";
	for (g = 0; g < this[this.getParam('id')].bitRates.length; g++) {
		if ((!this.checkSpeed && !this.wbmCookie)) {
			if (this[this.getParam('id')].bitRates[g] == "56000") {
				selected = "checked";
				this.mediaSpeed = "56000";
			} else {
				selected = "";
			}
		} else {
			if (this[this.getParam('id')].bitRates[g] == this.mediaSpeed) {
				selected = "checked";
			} else {
				selected = "";
			}
		}
		if (this[this.getParam('id')].bitRates[g] == finalBitRates[g][1]) {
			selectionContent += "<input type=\"radio\" name=\"bitRate\" value=\"" + this[this.getParam('id')].bitRates[g] + "\" "
				+ "onClick=\"" + this.obj + ".mediaSpeed='" + this[this.getParam('id')].bitRates[g] + "'\" " + selected + ">"
				+ spanText +finalBitRates[g][3] + endSpan + "<br>\n";
		} else {
			for (h = 0; h < finalBitRates.length; h++) {
				if (this[this.getParam('id')].bitRates[g] == finalBitRates[h][1]) {
					selectionContent += "<input type=\"radio\" name=\"bitRate\" value=\"" + this[this.getParam('id')].bitRates[g] + "\" "
						+ "onClick=\"" + this.obj + ".mediaSpeed='" + this[this.getParam('id')].bitRates[g] + "'\" " + selected + ">"
						+ spanText + finalBitRates[h][3] + endSpan + "<br>\n";
				}
			}
		}
	}
	selectionContent += "</td>\n</tr>\n</table></td>\n</tr>\n<tr>\n<td align=\"center\" valign=\"top\">\n<input type=\"submit\" value=\"" + playCopy + "\" onClick=\"return " + this.obj + ".submitSelection();\"></td>\n</tr>\n</form>\n</table>\n";
	this.print(selectionContent);
}

MediaPresenter.prototype.sniffSpeed = function() {
	var time = new Date();
	this.stime = time.getTime();
	this.imgFlag = false;
	this.testImg = new Image();
	this.testImg.onload = new Function("", this.obj + ".imgFlag=true;");
	this.testImg.src = "http://" + l.host + "/all/media/v2/img/35k.gif?id=" + this.stime;
	this.endSpeedSniff();
}

MediaPresenter.prototype.endSpeedSniff = function() {
	if (this.imgFlag) {
		var time = new Date();
		this.etime = time.getTime();
		var diff = this.etime - this.stime;
		var rate;
		if (this.pcAOL) {
			if (diff > 4000){
				rate = finalBitRates[0][1];
			}else if (diff > 2400){
				rate = finalBitRates[1][1];
			}else if (diff > 500) {
				rate = finalBitRates[2][1];
			}else if (diff > 0){
				rate = this[this.getParam('id')].bitRates[this[this.getParam('id')].bitRates.length -1];
			}else{
				rate = finalBitRates[0][1];
			}
		} else {
			if (diff > 3000){
				rate = finalBitRates[0][1];
			}else if (diff > 1000){
				rate = finalBitRates[1][1];
			}else if (diff > 200) {
				rate = finalBitRates[2][1];
			}else if (diff > 0){
				rate = this[this.getParam('id')].bitRates[this[this.getParam('id')].bitRates.length -1];
			}else{
				rate = finalBitRates[0][1];
			}
		}
		clearTimeout(this.timer);
		this.setSelectionSpeed(rate);
	} else {
		this.timer = setTimeout(this.obj + ".endSpeedSniff()", 10);
	}
}

MediaPresenter.prototype.setSelectionSpeed = function(speed) {
	if (this.mediaSpeed == null) {
		var ele = d.wbMediaSelection.elements;
		for (i = 0; i < ele.length; i++) {
			if (ele[i].name == "bitRate") {
				if (ele[i].value == speed) ele[i].checked = true;
			}
		}
		this.mediaSpeed = speed;
	}
	if (this.autoPlay && this.getParam("settings") == null && this.mediaType != null) this.submitSelection();
}

MediaPresenter.prototype.displayMedia = function() {
	var mediaContent = "";
	var controlVal, statusVal;
	this.mediaPath = this[this.getParam('id')][this.getParam('type')]["k" + this.getParam('speed')].path;
	this.mediaWidth = this[this.getParam('id')][this.getParam('type')]["k" + this.getParam('speed')].w;
	this.mediaHeight = this[this.getParam('id')][this.getParam('type')]["k" + this.getParam('speed')].h;
	if (this.getParam('type') == "real") {
		mediaContent += "<embed name=\"wbRealPlayer\" type=\"audio/x-pn-realaudio-plugin\" src=\"" + this.mediaPath + "\" height=\"" + this.mediaHeight + "\" width=\"" + this.mediaWidth + "\" "
			+ "autostart=\"true\" controls=\"ImageWindow\" console=\"wbVideo1\" nologo=\"true\" maintainaspect=\"true\"><br>\n";
		if (this.showControls) 	{
			mediaContent += "<embed name=\"wbRealPlayer\"  type=\"audio/x-pn-realaudio-plugin\" src=\"" + this.mediaPath + "\" height=\"26\" width=\"" + this.mediaWidth + "\" "
				+ "autostart=\"true\" controls=\"ControlPanel\" console=\"wbVideo1\" nologo=\"true\" maintainaspect=\"true\">";
		}
	} else if (this.getParam('type') == "windows") {
		if (this.showControls) 	this.mediaHeight += 46;
		if (this.showWindowsStatus) this.mediaHeight += 26;
		controlVal = (this.showControls)?"1":"0";
		statusVal = (this.showWindowsStatus)?"1":"0";
		mediaContent += "<embed type=\"video/x-ms-asf-plugin\" src=\"" + this.mediaPath + "\" width=\"" + this.mediaWidth + "\" height=\"" + this.mediaHeight + "\" "
			+ "showcontrols=\"" + controlVal + "\" autostart=\"1\" animationstart=\"1\" autorewind=\"0\" autosize=\"0\" showdisplay=\"0\" showstatusbar=\"" + statusVal + "\" "
			+ "SendOpenStateChangeEvents=\"true\" transparentatstart=\"true\"></embed>";
	} else if (this.getParam('type') == "quicktime") {
		if (this.showControls) this.mediaHeight += 14;
		controlVal = (this.showControls)?"true":"false";
		mediaContent += "<embed type=\"video/quicktime\" src=\"http://pdl.warnerbros.com/all/quicktime/need_qt4.mov\" qtsrc=\"" + this.mediaPath + "\" "
			+ "width=\"" + this.mediaWidth + "\" height=\"" + this.mediaHeight + "\" controller=\"" + controlVal + "\" loop=\"false\" autoplay=\"true\" kioskmode=\"true\">";
	}
	this.print(mediaContent);
}
