//펼침목록 스크립트
function showhide(obj) {
	var el = document.getElementById(obj);
	if ( el.style.display != 'none' ) {
		el.style.display = 'none';
	} else {
		el.style.display = '';
	}
}

/********************************************************************************************

		LineBanner.js
		Copyright by BlogCocktail, All rights reserved.

********************************************************************************************/



/********************************************************************************************

		기본 객체 찾기를 위한 함수 관련

********************************************************************************************/

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;
}


// 올블로그 전광판 스크립트
// 수정 : 곰님 (heygom.com, 20041206)

 var Utimeout = false;
 
//Main function
function Ultimate(Utype,Umsgs,Ucursor,Uwidth,Uheight,Ubgcolor,Ubackground,Uspeed,Udelay,Ufirst) {

	document.writeln('<div id="Ubox" style="position:relative; width:'+Uwidth+'px; height:'+Uheight+'px; overflow:hidden; background-image:url('+Ubackground+')" onmouseover="Ustop(\'Utxt\');" onmouseout="Uresume();">')
	document.writeln('<div style="position: absolute; width: '+Uwidth+'px; height: '+Uheight+'px; clip:rect(0px '+Uwidth+'px '+Uheight+'px 0px); left:0px; top:0px;">')

	if (Utype==0) {
		document.writeln('<div id="Utxt" style="color:#FFFFFF; position:absolute; width:'+Uwidth+'px; left:0px; top:'+Uheight+'px;">')
		document.write(Umsgs[Ufirst]);
		Uscroll("Utxt",Umsgs,Uheight,Uspeed,Udelay,Ufirst);
	}
	
	document.writeln('</div>')
	document.writeln('</div>')
	document.writeln('</div>')
}

//Moves
function Uscroll(IDdiv,Umsgs,Uheight,Uspeed,Udelay,Ufirst) {
	ttxt=MM_findObj(IDdiv);
	Ustep=eval(Ufirst);
	
	ttxtTop = ttxt.style.top;
	ttxtTop = ttxtTop.substring(0,ttxtTop.length - 2);
	  
	if (ttxtTop>0 && ttxtTop<=5) {
		ttxt.style.top = 0 + "px";
		Utimeout = setTimeout("Uscroll('Utxt',Umsgs,Uheight,Uspeed,Udelay,Ustep)",Udelay);
		return;
	} else {
		if (ttxtTop >= Uheight*-1) {
			ttxt.style.top = ttxtTop - 5 + "px";
			Utimeout = setTimeout("Uscroll('Utxt',Umsgs,Uheight,Uspeed,Udelay,Ustep)",Uspeed);
			return;
		} else {
			ttxt.style.top = Uheight + "px";
			if (Ustep>=Umsgs.length-1)
				Ustep=0;
				else		
				Ustep++;
			ttxt.innerHTML=Umsgs[Ustep];
			Uscroll("Utxt",Umsgs,Uheight,Uspeed,Udelay,Ustep);
		}
	}
}

//멈춤
 function Ustop(IDdiv) {
	  if (Utimeout) {
		   clearTimeout(Utimeout);
	  }
	  
	  ttxt = MM_findObj(IDdiv);
	  ttxt.style.top = 0 + "px";
 }
 
//다시 시작
function Uresume() {
	Utimeout = setTimeout("Uscroll('Utxt',Umsgs,Uheight,Uspeed,Udelay,Ustep)",Udelay);
}