if (!window.shokumaru) {
    shokumaru = {}
   
}
if (!window.shokumaru.VideoPlayer) {

    /** VideoPlayer class definition. */
    shokumaru.VideoPlayer = function( videoSrc, thumSrc, msg) {
		
        
        if (videoSrc !== undefined && videoSrc != null) {
            this.videoSrc = videoSrc;
        } else {
            this.videoSrc = "";
        }
        
        if (thumSrc !== undefined && thumSrc != null) {
            this.thumSrc = thumSrc;
        } else {
            this.thumSrc = "";
        }
        
        if (msg !== undefined && msg != null) {
            this.msg = msg;
        } else {
            this.msg = "noTitle";
        }
        
        this.objectID = "id"+Math.random()*10000;
        this.styleID = "sid"+Math.random()*10000;
        
        this.display();
       
    };

    /* Class variables */
    shokumaru.VideoPlayer.swfWidth = 510;
    shokumaru.VideoPlayer.swfHeight = 380;
    shokumaru.VideoPlayer.videoSrc = "";
    shokumaru.VideoPlayer.thumSrc = "";
    shokumaru.VideoPlayer.msg = "";
    shokumaru.VideoPlayer.objectID = "";
    shokumaru.VideoPlayer.styleID = "";
    shokumaru.VideoPlayer.swfPath = "/js/videoPlayer_blog.swf";
	shokumaru.VideoPlayer.styleID = "";

    shokumaru.VideoPlayer.prototype = {
		getFlashVars : function() {
            var ret = '&srcUrl=' + this.videoSrc;
            ret += '&imgUrl=' + this.thumSrc;
            ret += '&msg=' + this.msg;
            return ret;
        },
        display : function() {
           
            var objectId = this.objectId;
            var flashVars = this.getFlashVars();
            var html = '<div id="' + this.styleID + '">';
            html += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="' + shokumaru.VideoPlayer.swfWidth + '" height="'+ shokumaru.VideoPlayer.swfHeight+'" id="' + this.objectID + '">';
            html += '<param name="movie" value="' +  shokumaru.VideoPlayer.swfPath + '" />';
            html += '<param name="quality" value="high" />';
            html += '<param name="FlashVars" value="' + flashVars + '" />';
            html += '<param name="allowScriptAccess" value="always" />';
            html += '<param name="wmode" value="Window" />';
            html += '<embed src="' +  shokumaru.VideoPlayer.swfPath + '" width="' + shokumaru.VideoPlayer.swfWidth + '" height="' + shokumaru.VideoPlayer.swfHeight + '" quality="high" bgcolor="#000000" id="' + this.objectId +'" name="' + this.objectId + '" type="application/x-shockwave-flash" allowScriptAccess="always" FlashVars="' + flashVars + '" wmode="transparent" />';
            html += '</object>';
            html += '</div>';
            document.writeln(html);
        }
	};
}
