winObject = function(file, id, w, h, mime) {
	this.mime_type = mime;
	this.file = file;
	this.id = id;
	this.width = w;
	this.height = h;
	this.redirect = "";
	this.sq = document.location.search.split("?")[1] || "";
	this.altTxt = "This content requires the Windows Media Player.";
	this.params = new Object();
}

winObject.prototype.addParam = function(name, value) {
	this.params[name] = value;
}

winObject.prototype.getParams = function() {
    return this.params;
}

winObject.prototype.getParam = function(name) {
    return this.params[name];
}

winObject.prototype.getParamTags = function() {
    var paramTags = "";
    for (var param in this.getParams()) {
        paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
    }
    if (paramTags == "") {
        paramTags = null;
    }
    return paramTags;
}

winObject.prototype.getHTML = function() {
    var qtHTML = "";
	if (navigator.plugins && navigator.plugins.length) { // not ie
        qtHTML += '<embed type="'+this.mime_type+'" src="' + this.file + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '"';
        for (var param in this.getParams()) {
            qtHTML += ' ' + param + '="' + this.getParam(param) + '"';
        }
        qtHTML += '></embed>';
    }
    else { // pc ie
        qtHTML += '<object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '">';

        this.addParam("src", this.file);
        if (this.getParamTags() != null) {
            qtHTML += this.getParamTags();
        }
        qtHTML += '</object>';
    }
    return qtHTML;
}


winObject.prototype.getVariablePairs = function() {
    var variablePairs = new Array();
    for (var name in this.getVariables()) {
        variablePairs.push(name + "=" + escape(this.getVariable(name)));
    }
    if (variablePairs.length > 0) {
        return variablePairs.join("&");
    }
    else {
        return null;
    }
}

winObject.prototype.write = function(elementId) {
	if (elementId) {
		document.getElementById(elementId).innerHTML = this.getHTML();
	} else {
		document.write(this.getHTML());
	}
}
