
var poplink = document.getElementById?document.getElementById('poplink'):document.all['poplink'];
if( poplink ) { poplink.innerHTML = ''; }

var ad_txt = '';
if( PopupWindowType ){

	var ad_type = '';
	if( PopupWindowType == '' ) { ad_type = ''; }
	else if( PopupWindowType == 'fx'     ) { ad_type = 'invest'; }
	else if( PopupWindowType == 'mind'   ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'kokoro' ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'inv' ) { ad_type = 'invest'; }
	else if( PopupWindowType == 'pos' ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'aff' ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'mkt' ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'shp' ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'biz' ) { ad_type = 'CB'; }
	else if( PopupWindowType == 'job' ) { ad_type = 'CB'; }
	else { ad_type = 'CB'; }

	if( ad_type == 'CB' ){
		ad_txt += '<div style="text-align:center; text-decoration: none; font-weight: normal; padding:5px; background-color:#FFFFC0; ">';
		ad_txt += '<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="320" HEIGHT="140" id="_preview" ALIGN="">';
		ad_txt += '<PARAM NAME="allowScriptAccess" VALUE="sameDomain">';
		ad_txt += '<PARAM NAME="movie" VALUE="http://cashbacker.net/movie/top.swf">';
		ad_txt += '<PARAM NAME="quality" VALUE="high">';
		ad_txt += '<EMBED src="http://cashbacker.net/movie/top.swf" quality="high" WIDTH="320" HEIGHT="140" NAME="_preview" align=""  allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
		ad_txt += '</EMBED>';
		ad_txt += '</OBJECT>';
		ad_txt += '<div style="font-weight:bold; margin-top:10px; margin-bottom:10px; "><a href="http://cashbacker.net/top.cgi?sid=TEST">情報商材キャッシュバック＆レビュー買取</a></div>';
		ad_txt += '</div>';
	}else if( ad_type == 'mind' ){
		ad_txt += '<div style="text-align:center; text-decoration: none; font-weight: normal; margin:5px; ">';
		ad_txt += '<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="320" HEIGHT="180" id="_preview" ALIGN="">';
		ad_txt += '<PARAM NAME="allowScriptAccess" VALUE="sameDomain">';
		ad_txt += '<PARAM NAME="movie" VALUE="http://download.kabukimono.net/mind/promotion01.swf">';
		ad_txt += '<PARAM NAME="menu" VALUE="false">';
		ad_txt += '<PARAM NAME="quality" VALUE="high">';
		ad_txt += '<EMBED src="http://download.kabukimono.net/mind/promotion01.swf" menu="false" quality="high" WIDTH="320" HEIGHT="180" NAME="_preview" align=""  allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
		ad_txt += '</EMBED></OBJECT>';
		ad_txt += '<div style="font-size:10pt; background-color:#FFFF99; text-align:center; margin:5px; padding:5px; line-height: 120%;">';
		ad_txt += '<form style="padding:0px; margin:0px; " method="post" action="http://xn--xxtn8m9mkb9z.jp/regist.cgi">';
		ad_txt += '<div style="color:#000000; font-size:11pt; font-weight: bold; ">お申し込みはこちら</div>';
		ad_txt += '　お　名　前　：<input type="text" name="name" value=""><br>';
		ad_txt += 'メールアドレス：<input type="text" name="email" value=""><br>';
		ad_txt += '<input name="submit" type="submit" value="無料講座を受講する"><br>';
		ad_txt += '<input name="code" type="hidden" value="'+ ad_type +'"></form>';
		ad_txt += '<span style="font-size:9pt ;">※あなたの情報を第三者に公開することはありません</span>';
		ad_txt += '</div>';
		ad_txt += '<div style="font-size:10pt; text-decoration: underline; line-height: 100%; "><a href="http://xn--xxtn8m9mkb9z.jp/'+ ad_type +'/">詳しくはこちらをご覧下さい</a></div>';
		ad_txt += '</div>';
	}else if( ad_type == 'yanik1' ){
		ad_txt += '<div style="text-align:center; text-decoration: none; font-weight: normal; margin:5px; ">';
		ad_txt += '<OBJECT classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="320" HEIGHT="180" id="_preview" ALIGN="">';
		ad_txt += '<PARAM NAME="allowScriptAccess" VALUE="sameDomain">';
		ad_txt += '<PARAM NAME="movie" VALUE="http://xn--xxtn8m9mkb9z.jp/yanik1/catch.swf">';
		ad_txt += '<PARAM NAME="menu" VALUE="false">';
		ad_txt += '<PARAM NAME="quality" VALUE="high">';
		ad_txt += '<EMBED src="http://xn--xxtn8m9mkb9z.jp/yanik1/catch.swf" menu="false" quality="high" WIDTH="320" HEIGHT="180" NAME="_preview" align=""  allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
		ad_txt += '</EMBED></OBJECT>';
		ad_txt += '<div style="font-size:10pt; background-color:#FFFF99; text-align:center; margin:5px; padding:5px; line-height: 120%;">';
		ad_txt += '<form style="padding:0px; margin:0px; " method="post" action="http://xn--xxtn8m9mkb9z.jp/regist.cgi">';
		ad_txt += '<div style="color:#000000; font-size:11pt; font-weight: bold; ">お申し込みはこちら</div>';
		ad_txt += '　お　名　前　：<input type="text" name="name" value=""><br>';
		ad_txt += 'メールアドレス：<input type="text" name="email" value=""><br>';
		ad_txt += '<input name="submit" type="submit" value="無料講座を受講する"><br>';
		ad_txt += '<input name="code" type="hidden" value="'+ ad_type +'"></form>';
		ad_txt += '<span style="font-size:9pt ;">※あなたの情報を第三者に公開することはありません</span>';
		ad_txt += '</div>';
		ad_txt += '<div style="font-size:10pt; text-decoration: underline; line-height: 100%; "><a href="http://xn--xxtn8m9mkb9z.jp/'+ ad_type +'/">詳しくはこちらをご覧下さい</a></div>';
		ad_txt += '</div>';		
	}else if( ad_type ){ 
		var date = new Date();
		ad_txt += '<div style="text-align:center; text-decoration: none; font-weight: normal; margin:5px; ">';
		ad_txt += '<object type="application/x-shockwave-flash" data="http://api.sajiro.net/player.swf" width="320" height="240">';
		ad_txt += '	<param name="movie" value="http://api.sajiro.net/player.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file=http://download.kabukimono.net/'+ PopupWindowType +'/promotion01.flv&image=http://download.kabukimono.net/'+ ad_type +'/promotion01.jpg" />';
		ad_txt += '	<p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>';
		ad_txt += '</object>';
		ad_txt += '<div style="font-size:10pt; ">動画が正常に再生されない方は<a href="http://download.kabukimono.net/'+ ad_type +'/promotion01.wmv" target=_blank>こちら</a>をご覧下さい</div>';
		ad_txt += '<div style="font-size:10pt; background-color:#FFFF99; text-align:center; margin:5px; padding:5px; line-height: 120%;">';
		ad_txt += '<form style="padding:0px; margin:0px; " method="post" action="http://xn--xxtn8m9mkb9z.jp/regist.cgi">';
		ad_txt += '<div style="color:#000000; font-size:11pt; font-weight: bold; ">お申し込みはこちら</div>';
		ad_txt += '<div style="color:red; font-size:11pt; font-weight: bold; ">無料ご優待キャンペーン残り'+ (35-date.getDate()) +'枠</div>';
		ad_txt += '　お　名　前　：<input type="text" name="name" value=""><br>';
		ad_txt += 'メールアドレス：<input type="text" name="email" value=""><br>';
		ad_txt += '<input name="submit" type="submit" value="無料講座を受講する"><br>';
		ad_txt += '<input name="code" type="hidden" value="'+ ad_type +'"></form>';
		ad_txt += '<span style="font-size:9pt ;">※あなたの情報を第三者に公開することはありません</span>';
		ad_txt += '</div>';
		ad_txt += '<div style="font-size:10pt; text-decoration: underline; line-height: 100%; "><a href="http://xn--xxtn8m9mkb9z.jp/'+ ad_type +'/">詳しくはこちらをご覧下さい</a></div>';
		ad_txt += '</div>';
	}else{
		ad_txt += '<div style="text-align:center; text-decoration: none; font-weight: normal; margin:5px; ">';
		ad_txt += '<object type="application/x-shockwave-flash" data="http://api.sajiro.net/player.swf" width="320" height="260">';
		ad_txt += '	<param name="movie" value="http://api.sajiro.net/player.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="file=http://download.kabukimono.net/xn--xxtn8m9mkb9z/promotion01.flv&image=http://download.kabukimono.net/xn--xxtn8m9mkb9z/promotion01.jpg" />';
		ad_txt += '	<p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>';
		ad_txt += '</object>';
		ad_txt += '<div style="font-size:10pt; ">動画が正常に再生されない方は<a href="http://download.kabukimono.net/xn--xxtn8m9mkb9z/promotion01.wmv" target=_blank>こちら</a>をご覧下さい</div>';
		ad_txt += '<div style="font-size:12pt; text-decoration: underline; font-weight: bold; line-height: 150%; margin:5px; "><a href="http://xn--xxtn8m9mkb9z.jp/">詳しくはこちらをご覧下さい</a></div>';
		ad_txt += '</div>';
	}

}
//ad_txt = '';

// popup window
document.write('<div id="popover" style="border-style:outset;border-width:3;visibility:hidden;position:absolute;z-index:100;background-color:white; right:10px; width:330">');
document.write('	<div id="poptitle" style="text-align:right; width:100%; background-color:#003090; "><a href="javascript:void(0);" onclick="closePopupWindow();" style="font-size:10pt; color:white; font-weight: bold; ">Ｘ閉じる</a></div>');
document.write('	<div id="poptext"style="text-align:center; width:100%; background-color:#FAFAF5; font-size:12pt; font-weight: bold; margin:0px; padding:0px; "></div>');
// document.write('	<div id="popend" style="text-align:right; width:100%; background-color:#FFFFFF; "><a href="javascript:void(0);" onclick="closePopupWindow();" style="font-size:10pt; color:#B0B0B0; font-weight: bold; ">Ｘ閉じる</a></div>');
document.write('</div>');

var popover = document.getElementById?document.getElementById('popover'):document.all['popover'];
var offsetX;
var offsetY;
var popobj = 0;

var ie = document.all;
var dom = document.getElementById;
var ns4 = document.layers;
var unit = document.layers ? "" : "px";
// var direction = "up";
var stop_top = 20;
// var bouncelimit = 16;
// var calunits = document.layers ? "" : "px";


function popinit( )
{
	if (!dom && !ie && !ns4) { return; }
	
	// for mouse move
	var poptitle = document.getElementById?document.getElementById('poptitle'):document.all['poptitle'];
//	poptitle.onmousedown = onMouseDown;
//	document.onmousemove = onMouseMove;
//	document.onmouseup = onMouseUp;

	var poptext = document.getElementById?document.getElementById('poptext'):document.all['poptext'];
	poptext.innerHTML = ad_txt;

	popstyle = (dom) ? document.getElementById("popover").style : ie ? document.all.dropin : document.dropin;
	scroll_top = (ie) ? truebody().scrollTop : window.pageYOffset
	popstyle.top = scroll_top - 500 + unit;
	popstyle.visibility = (dom || ie) ? "visible" : "show";
	dropstart = setInterval("dropin()", 50);
}

function dropin()
{
	scroll_top = (ie) ? truebody().scrollTop : window.pageYOffset;
	if (parseInt(popstyle.top) < stop_top + scroll_top + 20) {
		popstyle.top = parseInt(popstyle.top) + 20 + unit;
	} else {
		clearInterval(dropstart);
		popstyle.top = stop_top;
	}
}

//	setTimeout ( 'end( );', 10 );
function end (){
	var popstaff = document.getElementById?document.getElementById('popstaff'):document.all['popstaff'];
	popstaff.innerHTML = '<a href="http://sajiro.net/" target=_blank><div  sytle="font-size:10pt; color:ligthgray; ">SAJIRO.NET</div></a>';
}	

function onMouseDown(e) {
	popobj = 1;
	offsetX = document.all?event.offsetX + 2:e.pageX - parseInt(popover.style.left);
	offsetY = document.all?event.offsetY + 2:e.pageY - parseInt(popover.style.top);
	return false;
}

function onMouseMove(e) {
	if (popobj <= 0){ return true; }
	popover.style.left = document.all?event.clientX - offsetX + document.body.scrollLeft:e.pageX - offsetX;
	popover.style.top = document.all?event.clientY - offsetY + document.body.scrollTop:e.pageY - offsetY;
	return false;
}

function onMouseUp(e) {
	popobj = 0;
}

function truebody()
{
	return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
}

function closePopupWindow(){
	popover.style.visibility='hidden';
	var poptext = document.getElementById?document.getElementById('poptext'):document.all['poptext'];
	poptext.innerHTML = '';
}


if( ad_txt.length > 0) { setTimeout('popinit()',10); }
// window.onload = setTimeout('popinit()',30);


