if (typeof Nicovideo == 'undefined') {
	Nicovideo = new Object();
}
if (typeof Nicovideo.Global == 'undefined') {
	Nicovideo.Global = {
		playerCount: 0
	};
}

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

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  || '485';
	this.height      = height || '385';
};
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;
	},
	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;
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) {
			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 += ' />';
		} else {
			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>';
		}

		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="http://www.nicovideo.jp/watch/sm2677541" target="_blank">\u30d0\u30e9\u30c7\u30e5\u30fc\u30af \uff08\u30ca\u30e0\u30b3\u30fb1985.07\uff09 2\/2</a></p>'
		);
		return;
	}

	var video = new Nicovideo.Video({
		v: 'sm2677541'
	,	id: 'sm2677541'
	,	title: '\u30d0\u30e9\u30c7\u30e5\u30fc\u30af \uff08\u30ca\u30e0\u30b3\u30fb1985.07\uff09 2\/2'
	,	description: '\u30d0\u30e9\u30c7\u30e5\u30fc\u30af\u306f\u516848\u9762\u306e\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30b2\u30fc\u30e0\u3002\u30d5\u30ed\u30a2\u5185\u306e\u30aa\u30af\u30c6\u30a3\u3092\u5168\u6ec5\u3055\u305b\u308c\u3070\u6b21\u306e\u30d5\u30ed\u30a2\u306b\u9032\u3080\u4e8b\u304c\u51fa\u6765\u308b\u3002\u672c\u4f5c\u306f\u9ad8\u6a4b\u7531\u8d77\u592b\u304c\u30b2\u30fc\u30e0\u30c7\u30b6\u30a4\u30f3\u3092\u62c5\u5f53\u3002\u30c7\u30b6\u30a4\u30f3\u306b\u306f\u4e0a\u8a18\u306e\u9ad8\u6a4b\u3001\u5317\u539f\u8061\u3001\u4e2d\u5cf6\u4fe1\u8cb4\u304c\u3042\u305f\u308a\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5cb8\u672c\u597d\u5f18\u304c\u3001SE\u306e\u307f\u3067\u5c55\u958b\u3059\u308b\u7570\u8272\u306e\u30b5\u30a6\u30f3\u30c9\u306b\u6176\u91ce\u7531\u5229\u5b50\u304c\u3001\u30d1\u30b1\u30c3\u30c8\u306e\u30dc\u30a4\u30b9\u306f\u5c0f\u6ca2\u7d14\u5b50\u304c\u62c5\u5f53\u3057\u305f\u3002\u5f8c\u5e74\u3001\u30df\u30b9\u30bf\u30fc\u30c9\u30ea\u30e9\u30fc\u30b7\u30ea\u30fc\u30ba\u306e\u4e3b\u4eba\u516c\u30db\u30ea\uff65\u30b9\u30b9\u30e0\u306e\u6bcd\u89aa\u3067\u3042\u308b\u30c8\u30d3\uff65\u30de\u30b9\u30e8\u304c\u3001\u672c\u4f5c\u306e1P\u5074:KISSY\u3067\u3042\u308b\u3068\u3044\u3046\u5f8c\u4ed8\u3051\u8a2d\u5b9a\u304c\u4f5c\u3089\u308c\u3001\u65e7\u6765\u306e\u30d5\u30a1\u30f3\u3092\u9a5a\u304b\u305b\u305f\u30021988\u5e74\u306b\u306f\u7d9a\u7de8\u3067\u3042\u308b\u7206\u7a81\u6a5f\u9283\u8247sm2220333\u304c\u767b\u5834\u3002\u3053\u3061\u3089\u306f1P\u5074\u306fTAKKY\uff08\u672c\u4f5c\u306e2P\u5074\uff09\u3067\u3042\u308b\u70ba\u3001\u30c8\u30d3\uff65\u30de\u30b9\u30e8\u3067\u306f\u306a\u3044\u3002\u3061\u306a\u307f\u306b\u7206\u7a81\u306e2P\u5074\u306e\u30d5\u30a1\u30a4\u30bf\u30fc\u306e\u540d\u306fHOMMY\u3002\u305d\u306e1\u2192sm2677115'
	,	thumbnail: 'http:\/\/tn-skr2.smilevideo.jp\/smile?i=2677541'
	,	postedAt: new Date('2008\/03\/17 03:35:14 +0900')
	,	length: 1120
	,	viewCount: 8907
	,	mylistCount: 46
	,	commentCount: 512
	,	movieType: 'flv'
	,	isDeleted: false	,	isMymemory: false	});
	var player = new Nicovideo.MiniPlayer(video, {
	'thumbWatch': '1'
	,'thumbPlayKey': '1329115748.0.I0bKodr3fb26XDr435OjwpB8VcM...'
	,'playerTimestamp': '1328754876'
	,'player_version_xml': '1328857541'
	,'player_info_xml': '1328854461'
	,'v': 'sm2677541'
	,'videoId': 'sm2677541'
	,'thumbTitle': '\u30d0\u30e9\u30c7\u30e5\u30fc\u30af \uff08\u30ca\u30e0\u30b3\u30fb1985.07\uff09 2\/2'
	,'thumbDescription': '\u30d0\u30e9\u30c7\u30e5\u30fc\u30af\u306f\u516848\u9762\u306e\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30b2\u30fc\u30e0\u3002\u30d5\u30ed\u30a2\u5185\u306e\u30aa\u30af\u30c6\u30a3\u3092\u5168\u6ec5\u3055\u305b\u308c\u3070\u6b21\u306e\u30d5\u30ed\u30a2\u306b\u9032\u3080\u4e8b\u304c\u51fa\u6765\u308b\u3002\u672c\u4f5c\u306f\u9ad8\u6a4b\u7531\u8d77...'
	,'thumbImage': 'http:\/\/tn-skr2.smilevideo.jp\/smile?i=2677541'
	,'movie_type': 'flv'
	,'wv_id': 'sm2677541'
	,'category': '\u30b2\u30fc\u30e0'
	,'categoryGroup': '\u30a2\u30cb\u30e1\u30fb\u30b2\u30fc\u30e0\u30fb\u7d75'
	,'leaf_switch': '2'
	}, '', '');
	player.write();
})();


