var NPDoDiv = document.createElement("div");
NPDoDiv.style.width = '100%';
NPDoDiv.style.height = '60px';
NPDoDiv.style.zIndex = '999999';
NPDoDiv.style.overflow = 'hidden';
NPDoDiv.style.textAlign = 'left';

var NPDfDiv = document.createElement('div');
NPDfDiv.id = 'NPDBlogSlideTxt';
NPDfDiv.style.width = '300px';
NPDfDiv.style.position = 'absolute';
NPDfDiv.style.left = '-4000px';

var NPDhDiv = document.createElement('div');
NPDhDiv.id = 'NPDBlogSlidePhotoSWF';

(function(){
var s = '<div id="NPDBlogSlideTxtTitle" style="text-align:left;font-size:14px;font-weight:700;color:#cc0000;margin:0px 20px;width:240px;"></div>'
	+   '<div id="NPDBlogSlideTxtDescription" style="text-align:left;color:#444444;font-size:12px;margin:10px 20px 0px 20px;width:240px;"></div>'
	+   '<div id="NPDBlogSlideTxtRegistDate" style="color:#222222;font-weight:700;text-align:right;font-size:12px;margin:10px 20px 0px 20px;width:240px;"></div>';
var style = '';

if (document.all) {
	style = "backgroundColor:#ff0000;position:absolute;top:expression(NPDGetViewerTop());left: -10000px;height:100%;width:100%;";
	NPDfDiv.innerHTML = '<div style="height:16px;width:300px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://bloglue.jp/img/fukidasi_u.png,sizingMethod=crop);"></div>'
					  + '<div style="zoom:1;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://bloglue.jp/img/fukidasi_m.png,sizingMethod=crop);">'
					  + s
					  + '</div><div style="height:33px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://bloglue.jp/img/fukidasi_b.png,sizingMethod=scale);"></div>';
} else {
	style = "position:fixed;top:0px;left:-10000px;width:100%;height:100%;";
	NPDfDiv.innerHTML =  '<div style="height:16px;width:300px;background:url(http://bloglue.jp/img/fukidasi_u.png);"></div>'
					  +  '<div style="background:url(http://bloglue.jp/img/fukidasi_m.png) repeat-y;">'
					  +  s
					  +  '</div><div style="height:33px; background:url(http://bloglue.jp/img/fukidasi_b.png);"></div>';
}
NPDhDiv.style.cssText = style;
})();

function NPDGetViewerTop() {
	var _s = (document.documentElement.scrollTop || document.body.scrollTop);
	return _s + 'px';
}


function NPDGetPartsTop() {
	var _m = document.documentElement.clientHeight || document.body.clientHeight || 0;
	var _n = document.documentElement.scrollTop || document.body.scrollTop;
	var _s = -60 + _n + _m;
	var _out = _s + 'px';
	return _out;
}

function NPDGetTextField() {
	var _s = -45 + (NPDfDiv.offsetHeight * -1) + (document.documentElement.scrollTop || document.body.scrollTop) + (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0);
	return _s + 'px'
}

function NPDBlogSlideOnload() {
	var _o = document.getElementsByTagName('link');
	var _l = _o.length;
	var _rss = '';
	for (var i = 0; i < _l; i++) {
		if (_o[i].type == 'application/rss+xml') {
			_rss = _o[i].href;
		}
	}

	if (document.all) {
		NPDoDiv.style.cssText = "overflow:hidden;position:absolute;top:expression(NPDGetPartsTop());left:0px;height:60px;width:100%;text-align:left;";
		document.body.style.fliter = "expression('')";

		if (!document.body.currentStyle.backgroundImage) {
			document.body.style.backgroundAttachment = 'fixed';
		}
		NPDfDiv.style.cssText = "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=);z-index:1000000;backgroundColor:#ffffff;overflow:hidden;position:expression('absolute');top: expression(NPDGetTextField());left:-4000px;width:300px;";
		NPDoDiv.innerHTML =  '<object style="margin-left: 0px; margin-right:auto;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="1280" height="60">'
				+'<param name="allowScriptAccess" value="always" />'
				+'<param name="movie" value="http://bloglue.jp/swf/blogslide.swf?rss=' + _rss + '" />'
				+'<param name="wmode" value="transparent" />';
				+'<param name="quality" value="high" />'
				+'</object>';
	} else {
		NPDoDiv.style.position = 'fixed';
		NPDoDiv.style.bottom ='0px';
		NPDoDiv.style.left = '0px';

		NPDfDiv.style.position = 'fixed';
		NPDfDiv.style.bottom ='45px';
		NPDfDiv.style.zIndex = 1000000;

		var _e = document.createElement("embed");
		_e.src='http://bloglue.jp/swf/blogslide.swf?rss=' + _rss;
		_e.width='1280';
		_e.height='60';

		_e.setAttribute('quality', 'high');
		_e.setAttribute('wmode', 'transparent');
		_e.setAttribute('allowScriptAccess', 'always');
		_e.setAttribute('type', 'application/x-shockwave-flash');
		NPDoDiv.appendChild(_e);
	}

	document.body.appendChild(NPDhDiv);
	document.body.appendChild(NPDoDiv);
	document.body.appendChild(NPDfDiv);
	NPDhDiv.innerHTML = '<object id="NPDBlogSlidePhotoViewer" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="1024" height="768">'
						+'<param name="allowScriptAccess" value="always" />'
						+'<param name="movie" value="http://bloglue.jp/swf/viewPhoto.swf" />'
						+'<param name="wmode" value="transparent" />'
						+'<param name="quality" value="high" />'
						+'<embed src="http://bloglue.jp/swf/viewPhoto.swf" wmode="transparent" quality="high" width="1024" height="768" name="NPDBlogSlidePhotoViewer" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
						+'</object>';
}

function NPDBlogSlideSetEvent() {
	if(window.attachEvent) {
		eventObj = window.attachEvent("onload", NPDBlogSlideOnload);
	} else if(window.addEventListener) {
		eventObj = window.addEventListener("load", NPDBlogSlideOnload, true);
	}
}

function NPDBlogSlideOnmouseOver(_x, _o) {
	$BLG('NPDBlogSlideTxtTitle').innerHTML = _o.title;
	$BLG('NPDBlogSlideTxtDescription').innerHTML = _o.summary;
	$BLG('NPDBlogSlideTxtRegistDate').innerHTML = _o.date;
	$BLG('NPDBlogSlideTxt').style.left = _x + 'px';
	$BLG('NPDBlogSlidePhotoSWF').style.left = '0px';
	$$NPD('NPDBlogSlidePhotoViewer').NPDBlogSlidViewPhoto(_o.img, _o.link);
	return 1;
}

function NPDBlogSlidViewPhotoClose() {
	$BLG('NPDBlogSlidePhotoSWF').style.left = '-10000px';
}


function NPDBlogSlideOnmouseOut() {
	$BLG('NPDBlogSlideTxt').style.left = '-4000px';
}

function $BLG(id) {
	return document.getElementById(id) || document.all[id];
}

function $$NPD(id) {
	var _o;
	try{
		_o = document[id];
	} catch(e) { 
		_o = window[id];
	}
	return _o;
}

NPDBlogSlideSetEvent();