var paTime = null;

function loadPopAd() {
	var popAd = document.getElementById( 'NyokipopAdAlert' );
	var pos = parseInt( popAd.style.top );
	if( pos > 0 ) {
		popAd.style.top = ( pos - 5 ) + 'px';
		setTimeout( 'loadPopAd()', 30 );
	}
}

function positionPopAd() {
	divBG = document.getElementById( 'NyokipopAdAlertBackground' );
	divBG.style.top = ( getScrollTop() + getWindowHeight() - 202 ) + 'px';
	divBG.style.left = ( getScrollLeft() + getWindowWidth() - 190 ) + 'px';
	paTime = setTimeout( 'positionPopAd()', 100 );
}

var is_Netscape = navigator.appName.indexOf('Netscape')!= -1;
var is_Body = document.body;
function getWindowHeight() {
	if( typeof window.innerHeight == 'number' ) {
		var winH = window.innerHeight;
		if( window.scrollMaxX > 0 ) {
			winH -= 17;
		}
		return winH;
	}
	else if ( document.documentElement.clientHeight) {
		return document.documentElement.clientHeight;
	}
	else if( typeof document.body.clientHeight == 'number' ) {
		return document.body.clientHeight;
	}
}

function getWindowWidth() {
	if( typeof window.innerWidth == 'number' ) {
		var winW = window.innerWidth;
		if( window.scrollMaxY > 0 ) {
			winW -= 17;
		}
		return winW;
	}
	else if ( document.documentElement.clientWidth ) {
		return document.documentElement.clientWidth;
	}
	else if( document.body && document.body.clientWidth ) {
		return document.body.clientWidth;
	}
}

function getScrollLeft() {
	var posLeft = false;

	if( is_Netscape ) {
		posLeft = window.pageXOffset;
	}
	else if( document.documentElement && document.documentElement.scrollTop ) {
		posLeft = document.documentElement.scrollLeft;
	}
	else if( is_Body ) {
		posLeft = document.body.scrollLeft;
	}

	return typeof posLeft == 'number' ? posLeft : 0;
}

function getScrollTop() {
	var posTop = false;

	if (window.innerHeight) {
		posTop = window.pageYOffset;
	}
	else if( document.documentElement && document.documentElement.scrollTop ) {
		posTop = document.documentElement.scrollTop;
	}
	else if( is_Body ) {
		posTop = document.body.scrollTop;
	}

	return typeof posTop == 'number' ? posTop : 0;
}

function addOnLoadEvent( func ) {
	if( typeof window.onload != 'function' ) {
		window.onload = func;
	}
	else {
		var oldOnload = window.onload;
		window.onload = function() {
			oldOnload();
			func();
		}
	}
}

function clearMovie(){
	if(document.getElementById){
		document.getElementById("NyokipopAdAlertBackground").style.visibility = 'hidden';
	}
	else if(document.all){
		document.all("NyokipopAdAlertBackground").style.visibility = 'hidden';
	}
	else if(document.layers){
		document.layers["NyokipopAdAlertBackground"].visibility = 'hidden';
	}
}


document.write( '<style type="text/css">#NyokipopAdAlertBackground, #NyokipopAdAlert{margin:0;padding:0;}#NyokipopAdAlertBackground, #NyokipopAdAlert{width:190px;height:202px;}#NyokipopAdAlertBackground{position:absolute;right:0px;bottom:0px;overflow:hidden;z-index:5;}#NyokipopAdAlert{position:relative;}</style><div id="NyokipopAdAlertBackground"><div id="NyokipopAdAlert" style="top:202px"><embed src="http://nyoki2.com/livede55/swf/index.swf?http=http://ck.jp.ap.valuecommerce.com/servlet/referral&sid=2182953&pid=878090260&" quality="high" wmode="transparent" width="190" height="202" allowScriptAccess="always"></embed><br><img Src="http://ad.jp.ap.valuecommerce.com/servlet/gifbanner?sid=2182953&pid=878090260" height="1" width="1" Border="0"></div></div>' );

function loadPopAdNow(){
	positionPopAd();
	loadPopAd();
}

addOnLoadEvent(
	function() {
		setTimeout( 'loadPopAdNow()', 5 * 1000 );
	}
);
