function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function DI_openform2(url)
{
   window.open(url,'Wform','toolbar=NO,location=NO,directories=NO,status=NO,menubar=NO,scrollbars=YES,resizable=yes,width=500,height=480');
}


	// data[] :テキストフィールドに流したい文字とURLを配列にする
	var data=new Array(
	
		 ">>　＊＊＊ Selwe+ HOT NEWS ＊＊＊ |user.app?cmd=entrymail&asp=${asp}&uid=<%=uid%>&own_id=<%=own_id%>|"
		,">>　2006年度おかげさまで、登録数46万人を突破致しました。|user.app?cmd=entrymail&asp=${asp}&uid=<%=uid%>&own_id=<%=own_id%>|"
		,">>　今後ともselweをどうぞよろしくお願い致します。|user.app?cmd=entrymail&asp=${asp}&uid=<%=uid%>&own_id=<%=own_id%>|"
	);
	
	
	// runable :ブラウザ判定
	var runable=(!document.getElementById)? (!document.all)? (!document.layers)? -1:1:2:3;
		
	// now :現在表示しているdata[]配列のインデックス
	var now=0;
	
	// count :moveMessage() , leaveMessage()用のループカウンタ
	var count=0;
	
	// width :表示する横幅
	width=800;
	
	// left :文字列の初期表示位置 px
	var left=250;
	
	// timerID :タイマー変数
	var timerID=0;
	
	// stay :文字列がとどまる時間(ミリ秒)
	var stay=4000;
	
	// stop :trueの時は動作を中止する
	var stop=false;
	
	function getElm(name,style)
	{//オブジェクト取得

		var obj;
		if (runable==1) obj=document.layers[name];
		else if (runable==2) obj=document.all(name);
		else obj=document.getElementById(name);

		if (style && runable>1) obj=obj.style;
		return obj;
	}
	function set()
	{
		if (runable==1) getElm("slide").clip.width=width;
		else getElm("slide").clip="rect(0 "+width+" 21 0)";
		start(1);
	}
	function start(flg)
	{// 初期化と文字流しの開始

		if (!runable || stop) return;

		space=left;
		count=0;
		if (!flg) now%=data.length;
		
		var a=data[now].split("|");
		if (runable>1)
		{
			getElm("slideLink").innerHTML=a[0];
			getElm("slideLink").href=a[1];
			getElm("slideLink").target=a[2];
			getElm("slideLink").blur();
		}
		put(data[now].split("|")[0],300);
		timerID=setTimeout("moveMessage()",0);
	}
	function moveMessage()
	{// 文字列を流す
	
		clearTimeout(timerID);
		if (stop) return;
		
		// 文字列を流す
		space=Math.floor(space*0.66);
		put(data[now].split("|")[0],space);
		
		if (space!=0)
		{
			count+=1
			timerID=setTimeout("moveMessage()",20);
		}
		else
		{
			count=0;
			timerID=setTimeout("leaveMessage()",stay);
		}
	}
	function leaveMessage()
	{//文字列を消す
	
		clearTimeout(timerID);
		if (stop) return;
		
		// L :文字列を何回に分けて消すか
		var L=4;
		var mess=data[now].split("|")[0];
		var a=Math.floor(mess.length/L);
		
		// 1回分の文字を消す
		var str=mess.substr(count*a,mess.length);
		if (count==L && a*L!=mess.length) str=mess.substr(a*L,mess.length);
		put(str,false,1);
		
		if (str=="" || !str)
		{
			now++;
			start();
		}
		else
		{
			count+=1;
			timerID=setTimeout("leaveMessage()",20);
		}
	}
	function put(text,spc,leave)
	{//文字列をオブジェクトに書く
	
		var url=data[now].split("|")[1];
		var target=data[now].split("|")[2];
		var slideHTML=(""
			+(
				(spc && runable==1)? 
					"<table width='"+spc+"' border='0' cellspacing='0' cellpadding='0' align='left'>"
					+"<tr><td width='"+spc+"'150'> </td></tr></table>"
					:""
			)
			+"<a href='"+url+"' id='slideLink' target='"+target+"'>"
			+text+"</a>"
		);
		if (runable==1)
		{
			getElm("slide").document.open();
			getElm("slide").document.write(slideHTML);
			getElm("slide").document.close();
			return;
		}
		else if (leave) getElm("slideLink").innerHTML=text;
		if (spc) getElm("spacerTd").width=spc;
	}



