if (typeof Nicovideo == 'undefined') {
	Nicovideo = new Object();
}
if (typeof Nicovideo.Global == 'undefined') {
	Nicovideo.Global = {
		playerCount: 0,
		embedMode: "noflash"
	};
	(function () {
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] === "object" && navigator.mimeTypes && navigator.mimeTypes.length) {
			Nicovideo.Global.embedMode = "embed";
		} else if (typeof ActiveXObject !== "undefined") {
			try {
				var ax = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				if (ax) {
					Nicovideo.Global.embedMode = "object";
				}
			} catch (e) {}
		}
	})();
	}

Nicovideo.version = '1.6.1';
Nicovideo.url = 'https://www.nicovideo.jp/';
Nicovideo.playerUrl = 'http://ext.nicovideo.jp/swf/player/thumbwatch.swf?ts=1556178770';

Nicovideo.Video = function (video) {
	if (video) {
		for (var key in video) {
			this[key] = video[key];
		}
	}
};
Nicovideo.Video.prototype = {
	getPlayURL: function () {
		return Nicovideo.url + 'watch/' + encodeURIComponent(this.v);
	},
	getShortTitle: function () {
		return this.title.substring(0, 60) +
			(this.title.length > 60 ? "..." : "");
	},
	getShortDescription: function () {
		return this.description.substring(0, 60) +
			(this.description.length > 60 ? "..." : "");
	}
};

Nicovideo.MiniPlayer = function (video, vars, width, height) {
	this.id          = Nicovideo.MiniPlayer.allocateId(this);
	this.video       = video;
	this.attributes  = {};
	this.parameters  = {};
	this.variables   = vars || {};
	this.width = width ? width : '485';
	this.height = height ? height : '385';
	if (window.innerWidth && this.width > window.innerWidth) {
		var scale = (window.innerWidth - 20) / this.width;		if (scale > 0) {
			this.width = this.width * scale;
			this.height = this.height * scale;
		}
	}
};
Nicovideo.MiniPlayer.prototype = {
	defaultAttributes: {},
	defaultParameters: {
		allowScriptAccess: 'always',
		allowFullScreen: 'true',
		bgcolor: '#000000',
		quality: 'high'
	},


	_merge: function () {
		var o = {};
		for (var i = 0, len = arguments.length; i < len; i++) {
			var arg = arguments[i];
			if (typeof arg != "object") continue;
			for (var key in arg) {
				o[key] = arg[key];
			}
		}
		return o;
	},
	_escape: function (s) {
		return String(s).replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
	},
	getHTML: function () {
		var id = this.id,
			video = this.video,
			attrs = this._merge(this.defaultAttributes, this.attributes),
			params = this._merge(this.defaultParameters, this.parameters),
			vars = this.variables;

		var flashvars = [];
		for (var key in vars) {
			flashvars.push(key + '=' + encodeURIComponent(vars[key]));
		}
		params.flashvars = flashvars.join("&");

		var html;
		switch (Nicovideo.Global.embedMode) {
		case "embed":
			html =
				'<embed type="application/x-shockwave-flash"'
				+ ' id="' + id + '"'
				+ ' name="' + id + '"'
				+ ' src="' + Nicovideo.playerUrl + '"'
				+ ' width="' + this.width  + '"'
				+ ' height="' + this.height + '"'
				;
			for (var key in params) {
				html += ' ' + key + '="' + params[key] + '"';
			}
			for (var key in attrs) {
				html += ' ' + key + '="' + attrs[key] + '"';
			}
			html += ' />';
			break;
		case "object":
			html =
				'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
				+ ' id="' + id + '"'
				+ ' name="' + id + '"'
				+ ' width="' + this.width + '"'
				+ ' height="' + this.height + '"'
				;
			for (var key in attrs) {
				html += ' ' + key + '="' + attrs[key] + '"';
			}
	 		html += '>';
			html += '<param name="movie" value="' + Nicovideo.playerUrl + '" />';
			for (var key in params) {
				html += '<param name="' + key + '" value="' + params[key] + '" />';
			}
			html += '</object>';
			break;
		default:
			html =
				'<div style="'
						+ 'width:' + (this.width === "100%" ? this.width : this.width + "px")
						+ '; height:' + (this.height === "100%" ? this.height : this.height + "px")
						+ '; display:inline-block; background:#000; color:#FFF; margin:0; padding:0; overflow:hidden;">'
				+ '<a href="' + video.getPlayURL() + '" target="_blank" title="' + this._escape(video.title) + '"'
						+ ' style="position:relative; display:inline-block; width:100%; height:100%;">'
					+ '<img src="' + video.thumbnail + '" alt="" style="width:100%; height:100%; border:none;" />';
			if (!video.isDeleted && (this.width === "100%" || this.width >= 240) && (this.height === "100%" || this.height >= 120)) {
				html += '<span style="display:inline-block; position:absolute; left:0; top:0; width:100%; height:100%;'
							+ ' background-image: url(https://nicovideo.cdn.nimg.jp/web/img/thumb/nico/play.png); background-repeat: no-repeat; background-position: center center;"></span>';
			}
			html += '</a>'
				+ '</div>';
			break;
		}

		return html;
	},
	write: function (id) {
		if (id === undefined) {
			document.write(this.getHTML());
		} else if (typeof id == "string") {
			var el = document.all ? document.all[id] : document.getElementById(id);
			if (el) el.innerHTML = this.getHTML();
		} else if (id) {
			id.innerHTML = this.getHTML();
		}
	}
};

Nicovideo.MiniPlayer.allocateId = function (player) {
	var id = 'external_nico_' + (Nicovideo.Global.playerCount++);
	return id;
};

if (document.all && !window.opera) {
	window.attachEvent("onbeforeunload", function () {
		window.attachEvent("onunload", function () {
			for (var i = 0, l = Nicovideo.Global.playerCount; i < l; i++) {
				var id = 'external_nico_' + i, el = document.all ? document.all[id] : document.getElementById(id);
				if (el && el.parentNode) {
					for (var key in el) {
						if (typeof el[key] == 'function')
							el[key] = null;
					}
					el.parentNode.removeChild(el);
				}
			}
		});
	});
}


(function () {
	var b = true;
	try {
		var w = window.parent, self = window.self;
		while (w && w != self) {
			if (w.location.host != self.location.host) {
				b = false;
				break;
			}
			if (w === w.parent) break;
			w = w.parent;
		}
	} catch (e) {
		b = false;
	}

	if (!b) {
		Nicovideo = undefined;
		document.write(
			'<p><a href="https://www.nicovideo.jp/watch/sm5894913" target="_blank">020 \u9ad8\u753b\u8cea\u3001\u9ad8\u97f3\u8cea\u3067\u898b\u308b\u6d0b\u697d\u540d\u66f2\u9078\u3000Scatman John - Scatman\u3001\u4ed6</a></p>'
		);
		return;
	}

	var video = new Nicovideo.Video({
		v: 'sm5894913'
	,	id: 'sm5894913'
	,	title: '020 \u9ad8\u753b\u8cea\u3001\u9ad8\u97f3\u8cea\u3067\u898b\u308b\u6d0b\u697d\u540d\u66f2\u9078\u3000Scatman John - Scatman\u3001\u4ed6'
	,	description: '\u301070\u5e74\u4ee3\uff5e90\u5e74\u4ee3\u4e2d\u5fc3\u306e\u540d\u66f2\u306ePV\u3092\u826f\u8cea\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3011Artist : \u30b9\u30ad\u30e3\u30c3\u30c8\u30de\u30f3\u30fb\u30b8\u30e7\u30f3 (1942\u5e743\u670813\u65e5\uff5e1999\u5e7412\u67083\u65e5)Title\u3000: Scatman(1994\u5e74)\u3001Scatman\'s World(1995\u5e74)\u3001Everybody Jam!(1996\u5e74)\u3001SU\u30fbSU\u30fbSU SUPER \u30ad\u30fb\u30ec\u30fb\u30a4(1996\u5e74)\u30b7\u30ea\u30fc\u30ba20\u500b\u76ee\u533a\u5207\u308a\u306e\u3046\uff50\u3067\u3061\u3087\u3063\u3068\u8c6a\u83ef\u306b\u300252\u6b73\u3067\u6b4c\u624b\u3068\u3057\u3066\u30e1\u30b8\u30e3\u30fcCD\u30c7\u30d3\u30e5\u30fc\u3002\u80ba\u764c\u306e\u305f\u308157\u6b73\u3067\u4ed6\u754c\u3057\u305f\u3001\u5927\u597d\u304d\u306a\u304a\u3058\u3055\u3093\u306e4\u66f2\u3092\u30024\u66f2\u76ee\u306e\u9014\u4e2d\u5909\u306a\u306e\u304c\u5165\u3063\u3066\u307e\u3059\u3001\u5143\u304b\u3089\u306e\u7269\u3067\u3059\uff08\u30ce\u2200\uff40\uff09\u6d0b\u697d\u540d\u66f2\u9078\u2192mylist\/145296041Mbps\u6d0b\u697d\u5973\u6027Vocal\u2192mylist\/235659301Mbps\u6d0b\u697d\u7537\u6027Vocal\u2192mylist\/23565909\u305d\u306e\u4ed6\u306e\u52d5\u753b\u2192mylist\/14529773\u3053\u306e\u52d5\u753b\u306f\u793e\u56e3\u6cd5\u4eba\u65e5\u672c\u30ec\u30b3\u30fc\u30c9\u5354\u4f1a\u306e\u7533\u7acb\u306b\u3088\u308a\u3001\u30ec\u30b3\u30fc\u30c9\u88fd\u4f5c\u8005\u306e\u6a29\u5229\u4fb5\u5bb3\u3068\u3057\u3066\u524a\u9664\u3055\u308c\u307e\u3057\u305f\u3002\u5bfe\u8c61\u7269: Scatman(\u682a\u5f0f\u4f1a\u793e\u30bd\u30cb\u30fc\u30fb\u30df\u30e5\u30fc\u30b8\u30c3\u30af\u30a8\u30f3\u30bf\u30c6\u30a4\u30f3\u30e1\u30f3\u30c8 )'
	,	thumbnail: 'https:\/\/nicovideo.cdn.nimg.jp\/web\/img\/common\/video_deleted.jpg?_t=20181018'
	,	postedAt: new Date('2009\/01\/20 13:55:05 +0900')
	,	length: 772
	,	viewCount: 432216
	,	mylistCount: 7454
	,	commentCount: 7842
	,	movieType: 'mp4'
	,	isDeleted: true	,	isMymemory: false	});
	var player = new Nicovideo.MiniPlayer(video, {
	'thumbWatch': '1'
	,'thumbPlayKey': '1619078427.0.1.KyjVdpmkM5wDAw1bOvkvvdHkUzo.aHR0cDovL25ha2Fzb2t1LmJsb2cxOC5mYzIuY29tL2Jsb2ctZW50cnktMTQ0NS5odG1s...0'
	,'playerTimestamp': '1597813798'
	,'player_version_xml': '1597813798'
	,'player_info_xml': '1556089684'
	,'translation_version_json': ''
	,'v': 'sm5894913'
	,'videoId': 'sm5894913'
	,'thumbTitle': '020 \u9ad8\u753b\u8cea\u3001\u9ad8\u97f3\u8cea\u3067\u898b\u308b\u6d0b\u697d\u540d\u66f2\u9078\u3000Scatman John - Scatman\u3001\u4ed6'
	,'thumbDescription': '\u301070\u5e74\u4ee3\uff5e90\u5e74\u4ee3\u4e2d\u5fc3\u306e\u540d\u66f2\u306ePV\u3092\u826f\u8cea\u306b\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3011Artist : \u30b9\u30ad\u30e3\u30c3\u30c8\u30de\u30f3\u30fb\u30b8\u30e7\u30f3 (...'
	,'thumbTags': '\u6d0b\u697d\u540d\u66f2\u96c6 PV \u6d0b\u697d \u65e5\u672c\u30ec\u30b3\u30fc\u30c9\u5354\u4f1a\u4e00\u6589\u524a\u9664\u4e8b\u4ef6'
	,'thumbImage': 'https:\/\/nicovideo.cdn.nimg.jp\/web\/img\/common\/video_deleted.jpg?_t=20181018'
	,'movie_type': 'mp4'
	,'wv_id': 'sm5894913'
	,'language': 'ja-jp'
	,'has_owner_thread': '1'
	,'iee': '1'
	,'noAdSense': '1'
	,'leaf_switch': '2'
	,'accessFromHash': '1618992027:051854b90d741df50651a4e23daadaabbd77ec430c0186b46e6fe92024db2acd'
	}, '320', '252');
	player.write();
})();

