function PrepareAudioPlayer(audioPath, imagePath) {
	var playerContainerId = "videoPlayerContainer";
	var fullAudioPath = audioPath;
	var fullImagePath = imagePath;
	 /*
	if (audioPath.indexOf(":") < 0) {
		fullAudioPath = "clips/audio/" + audioPath;
	}
	if (imagePath.indexOf(":") < 0) {
		fullImagePath = "clips/audio/" + imagePath;
	}
	 */
	/*
	alert(fullAudioPath + "\n"
		+ escape(fullAudioPath) + "\n"
		+ encodeURI(fullAudioPath) + "\n"
		+ encodeURIComponent(fullAudioPath)
		);
	*/
	
	var tempVideoObject = new SWFObject("scripts/video/player.swf", "ply", "272", "208", "9", "#FFFFFF");
	tempVideoObject.addParam("allowfullscreen","true");
	tempVideoObject.addParam("allowscriptaccess","always");
	tempVideoObject.addParam("flashvars",
		 "backcolor=0xa0a0a0&"+
		"frontcolor=0x000000&"+
		"lightcolor=0xeeeeee&"+
		"autostart=true&"+
		"stretching=fill&"+
		"image="+fullImagePath+"&"+
		"file="+fullAudioPath);
	tempVideoObject.write(playerContainerId);
	document.getElementById(playerContainerId).style.display = "block";
	
}
function PrepareVideoPlayer(VideoPath) {
	var playerContainerId = "videoPlayerContainer";
	var fullVideoPath = VideoPath;
	/*
	if (VideoPath.indexOf(":") < 0) {
		fullVideoPath = "../../clips/video/" + VideoPath;
	}
	*/
	var tempVideoObject = new SWFObject("scripts/video/player.swf", "ply", "272", "208", "9", "#FFFFFF");
	tempVideoObject.addParam("allowfullscreen","true");
	tempVideoObject.addParam("allowscriptaccess","always");
	tempVideoObject.addParam("flashvars",
		 "backcolor=0xa0a0a0&"+
		"frontcolor=0x000000&"+
		"lightcolor=0xeeeeee&"+
		"autostart=true&"+
		"stretching=fill&"+
		"file="+fullVideoPath);
	tempVideoObject.write(playerContainerId);
	document.getElementById(playerContainerId).style.display = "block";
	/*
	alert(fullVideoPath + "\n"
		+ escape(fullVideoPath) + "\n"
		+ encodeURI(fullVideoPath) + "\n"
		+ encodeURIComponent(fullVideoPath)
		);
	*/
}

if(typeof deconcept=="undefined") {
	var deconcept=new Object();
}
if(typeof deconcept.util=="undefined"){
	deconcept.util=new Object();
}
if(typeof deconcept.SWFObjectUtil=="undefined"){
	deconcept.SWFObjectUtil=new Object();
}
deconcept.SWFObject = function(swf, id, width, height, version, bgcolor, quality, xiRedirectUrl, redirectUrl, detectKey) {
    if (!document.getElementById) {
        return;
    }
    this.DETECT_KEY = detectKey ? detectKey : "detectflash";
    this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
    this.params = new Object();
    this.variables = new Object();
    this.attributes = new Array();
    if (swf) {
        this.setAttribute("swf", swf);
    }
    if (id) {
        this.setAttribute("id", id);
    }
    if (width) {
        this.setAttribute("width", width);
    }
    if (height) {
        this.setAttribute("height", height);
    }
    if (version) {
        this.setAttribute("version", new deconcept.PlayerVersion(version.toString().split(".")));
    }
    this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
    if (!window.opera && document.all && this.installedVer.major > 7) {
        deconcept.SWFObject.doPrepUnload = true;
    }
    if (bgcolor) {
        this.addParam("bgcolor", bgcolor);
    }
    var _quality = quality ? quality : "high";
    this.addParam("quality", _quality);
    this.setAttribute("useExpressInstall", false);
    this.setAttribute("doExpressInstall", false);
    var _xiRedirectUrl = (xiRedirectUrl) ? xiRedirectUrl : window.location;
    this.setAttribute("xiRedirectUrl", _xiRedirectUrl);
    this.setAttribute("redirectUrl", "");
    if (redirectUrl) {
        this.setAttribute("redirectUrl", redirectUrl);
    }
};
deconcept.SWFObject.prototype = {
    useExpressInstall:function(_xiSWFPath) {
        this.xiSWFPath = !_xiSWFPath ? "expressinstall.swf" : _xiSWFPath;
        this.setAttribute("useExpressInstall", true);
    },
    setAttribute:function(attr, value) {
        this.attributes[attr] = value;
    },
    getAttribute:function(attr) {
        return this.attributes[attr];
    },
    addParam:function(param, value) {
        this.params[param] = value;
    },
	getParams:function() {
		return this.params;
	},
	addVariable:function(variable, value) {
	    this.variables[variable] = value;
	},
	getVariable:function(variable) {
	    return this.variables[variable];
	},
	getVariables:function() {
	    return this.variables;
	},
	getVariablePairs:function() {
	    var varPair = new Array();
	    var key;
	    var vars = this.getVariables();
	    for (key in vars) {
	        varPair[varPair.length] = key + "=" + vars[key];
	    }
	    return varPair;
	},
	getSWFHTML:function() {
	    var code = "";
	    if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
	        if (this.getAttribute("doExpressInstall")) {
	            this.addVariable("MMplayerType", "PlugIn");
	            this.setAttribute("swf", this.xiSWFPath);
	        }
	        code = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute("swf") + "\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\"";
	        code += " id=\"" + this.getAttribute("id") + "\" name=\"" + this.getAttribute("id") + "\" ";
	        var params = this.getParams();
	        for (var key in params) {
	            code += [key] + "=\"" + params[key] + "\" ";
	        }
	        var varPair = this.getVariablePairs().join("&");
	        if (varPair.length > 0) {
	            code += "flashvars=\"" + varPair + "\"";
	        }
	        code += "/>";
	    } else {
	        if (this.getAttribute("doExpressInstall")) {
	            this.addVariable("MMplayerType", "ActiveX");
	            this.setAttribute("swf", this.xiSWFPath);
	        }
	        code = "<object id=\"" + this.getAttribute("id") + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute("width") + "\" height=\"" + this.getAttribute("height") + "\" style=\"" + this.getAttribute("style") + "\">";
	        code += "<param name=\"movie\" value=\"" + this.getAttribute("swf") + "\" />";
	        var params = this.getParams();
	        for (var key in params) {
	            code += "<param name=\"" + key + "\" value=\"" + params[key] + "\" />";
	        }
	        var varPairs = this.getVariablePairs().join("&");
	        if (varPairs.length > 0) {
	            code += "<param name=\"flashvars\" value=\"" + varPairs + "\" />";
	        }
	        code += "</object>";
	    }
	    return code;
	},
	write:function(installTarget) {
	    if (this.getAttribute("useExpressInstall")) {
	        var playerVer = new deconcept.PlayerVersion([6,0,65]);
	        if (this.installedVer.versionIsValid(playerVer) && !this.installedVer.versionIsValid(this.getAttribute("version"))) {
	            this.setAttribute("doExpressInstall", true);
	            this.addVariable("MMredirectURL", escape(this.getAttribute("xiRedirectUrl")));
	            document.title = document.title.slice(0, 47) + " - Flash Player Installation";
	            this.addVariable("MMdoctitle", document.title);
	        }
	    }
	    if (this.skipDetect || this.getAttribute("doExpressInstall") || this.installedVer.versionIsValid(this.getAttribute("version"))) {
	        var targetElement = (typeof installTarget == "string") ? document.getElementById(installTarget) : installTarget;
	        targetElement.innerHTML = this.getSWFHTML();
	        return true;
	    } else {
	        if (this.getAttribute("redirectUrl") != "") {
	            document.location.replace(this.getAttribute("redirectUrl"));
	        }
	    }
	    return false;
	}
};
deconcept.SWFObjectUtil.getPlayerVersion = function() {
    var playerVersion = new deconcept.PlayerVersion([0,0,0]);
    if (navigator.plugins && navigator.mimeTypes.length) {
        var x = navigator.plugins["Shockwave Flash"];
        if (x && x.description) {
            playerVersion = new deconcept.PlayerVersion(
				x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split(".")
			);
        }
    } else {
        if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0) {
            var axo = 1;
            var majVer = 3;
            while (axo) {
                try {
                    majVer++;
                    axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + majVer);
                    playerVersion = new deconcept.PlayerVersion([majVer,0,0]);
                } catch(e) {
                    axo = null;
                }
            }
        } else {
            try {
                var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
            } catch(e) {
                try {
                    var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
                    playerVersion = new deconcept.PlayerVersion([6,0,21]);
                    axo.AllowScriptAccess = "always";
                } catch(e) {
                    if (playerVersion.major == 6) {
                        return playerVersion;
                    }
                }
                try {
                    axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
                } catch(e) {
                }
            }
            if (axo != null) {
                playerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
            }
        }
    }
    return playerVersion;
};
deconcept.PlayerVersion = function(ver) {
    this.major = ver[0] != null ? parseInt(ver[0]) : 0;
    this.minor = ver[1] != null ? parseInt(ver[1]) : 0;
    this.rev   = ver[2] != null ? parseInt(ver[2]) : 0;
};
deconcept.PlayerVersion.prototype.versionIsValid = function(fv) {
    if (this.major < fv.major) {
        return false;
    }
    if (this.major > fv.major) {
        return true;
    }
    if (this.minor < fv.minor) {
        return false;
    }
    if (this.minor > fv.minor) {
        return true;
    }
    if (this.rev < fv.rev) {
        return false;
    }
    return true;
};
deconcept.util = {
	getRequestParameter:function(param) {
	    var q = document.location.search || document.location.hash;
	    if (param == null) {
	        return q;
	    }
	    if (q) {
	        var params = q.substring(1).split("&");
	        for (var i = 0; i < params.length; i++) {
	            if (params[i].substring(0, params[i].indexOf("=")) == param) {
	                return params[i].substring((params[i].indexOf("=") + 1));
	            }
	        }
	    }
	    return "";
	}
};
deconcept.SWFObjectUtil.cleanupSWFs = function() {
    var objectElements = document.getElementsByTagName("OBJECT");
    for (var i = objectElements.length - 1; i >= 0; i--) {
        objectElements[i].style.display = "none";
        for (var x in objectElements[i]) {
            if (typeof objectElements[i][x] == "function") {
                objectElements[i][x] = function() {
                };
            }
        }
    }
};
if (deconcept.SWFObject.doPrepUnload) {
    if (!deconcept.unloadSet) {
        deconcept.SWFObjectUtil.prepUnload = function() {
            __flash_unloadHandler = function() {
            };
            __flash_savedUnloadHandler = function() {
            };
            window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
        };
        window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
        deconcept.unloadSet = true;
    }
}
if (!document.getElementById && document.all) {
    document.getElementById = function(id) {
        return document.all[id];
    };
}
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject;
var SWFObject = deconcept.SWFObject;
