// »ç¿ëÇÒ ¸Þ¼¼Áö
var message=new Array()
message[0]=" "
message[1]=""

// ¸Þ½ÃÁö ¸µÅ©
var messageurl=new Array()
messageurl[0]="#"
messageurl[1]="#"
messageurl[2]="#"

// ¸µÅ© Å¸°Ù
var messagetarget=new Array()
messagetarget[0]="_blank"
messagetarget[1]="_blank"
messagetarget[2]="_blank"

// ±ÛÀÚ »ö»ó
var messagecolor= new Array()
messagecolor[0]="black"
messagecolor[1]="black"
messagecolor[2]="black"

// ¸Þ¼¼Áö Ä«¿îÅÍ »ö»ó
textcountercolor="white"

// ¸Þ¼¼Áö Ä«¿îÅÍ ±ÛÀÚ Å©±â
textcountersize=7

// ÁÂÃø¿©¹é
var scrollerleft=0

// À§ÂÊ ¿©¹é
var scrollertop=72

// ½ºÅ©·Ñ ¼Óµµ
var pause=30
var step=1

// ±ÛÀÚ Å©±â
var fntsize=8

//±ÛÀÚ ¸ð¾ç
var fntfamily="±¼¸²"

// ÆùÆ® ±½±â (1=bold, 0=º¸Åë)
var fntweight=0

// ÆíÁýÇÏÁö ¸¶¼¼¿ä
var scrollerwidth=160
var scrollerheight=20
var scrollerleft_in=scrollerleft
var scrollertop_in=scrollertop+12
var backgroundimagecontent
var clipleft,clipright,cliptop,clipbottom
var i_message=0
var timer
var textwidth
var textcontent=""
var textcountercontent=""
if (fntweight==1) {fntweight="700"}
else {fntweight="100"}

function init() {
        gettextcontent()
        
    if (document.all) {
                text.innerHTML=textcontent
                textcounter.innerHTML=textcountercontent
                textwidth=text.offsetWidth
                document.all.text.style.posTop=scrollertop_in
        document.all.text.style.posLeft=scrollerleft_in+scrollerwidth
                document.all.textcounter.style.posTop=scrollertop_in+26
        document.all.textcounter.style.posLeft=scrollerleft_in+2
                document.all.backgroundimage.style.posTop=scrollertop
        document.all.backgroundimage.style.posLeft=scrollerleft

                clipleft=0
                clipright=0
                cliptop=0
                clipbottom=scrollerheight
                document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
        scrolltext()
    }
        if (document.layers) {
                document.text.document.write(textcontent)
                document.text.document.close()
                document.textcounter.document.write(textcountercontent)
                document.textcounter.document.close()
                textwidth=document.text.document.width
                document.text.top=scrollertop_in
                document.text.left=scrollerleft_in+scrollerwidth
                document.textcounter.top=scrollertop_in+26
                document.textcounter.left=scrollerleft_in+2
                document.backgroundimage.top=scrollertop
        document.backgroundimage.left=scrollerleft
                
                document.text.clip.left=0
                document.text.clip.right=0
                document.text.clip.top=0
                document.text.clip.bottom=scrollerheight

        scrolltext()
    }
}

function scrolltext() {
    if (document.all) {
                if (document.all.text.style.posLeft>=scrollerleft_in-textwidth) {
                        document.all.text.style.posLeft-=step
                        clipright+=step
                        if (clipright>scrollerwidth) {
                                clipleft+=step
                        }
                        document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                        
                        var timer=setTimeout("scrolltext()",pause)
                }
                else {
                        changetext()
                }
        }
   if (document.layers) {
                if (document.text.left>=scrollerleft_in-textwidth) {
                        document.text.left-=step
                        document.text.clip.right+=step
                        if (document.text.clip.right>scrollerwidth) {
                                document.text.clip.left+=step
                        }
                        timer=setTimeout("scrolltext()",pause)
                }
                else {
                        changetext()
                }
        }
}

function changetext() {
    i_message++
        if (i_message>message.length-1) {i_message=0}
        gettextcontent()
        if (document.all) {
                text.innerHTML=textcontent
                textwidth=text.offsetWidth
                textcounter.innerHTML=textcountercontent
                
        document.all.text.style.posLeft=scrollerleft_in+scrollerwidth
                clipleft=0
                clipright=0
                document.all.text.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                
        scrolltext()
        }

        if (document.layers) {
                   document.text.document.write(textcontent)
                document.text.document.close()
                
                document.textcounter.document.write(textcountercontent)
                document.textcounter.document.close()
                
                textwidth=document.text.document.width

                document.text.left=scrollerleft_in+scrollerwidth
                document.text.clip.left=0
                document.text.clip.right=0
                
        scrolltext()
        }
}

function gettextcontent() {
        textcontent="<span style='position:relative;font-size:"+fntsize+"pt;font-family:"+fntfamily+";font-weight:"+fntweight+"'>"
        textcontent+="<a href="+messageurl[i_message]+" target="+messagetarget[i_message]+">"
        textcontent+="<nobr><font color="+messagecolor[i_message]+">"+message[i_message]+"</font></nobr></a></span>"
}

function changespeed(newspeed) {
    if (newspeed=="faster") {
                step=step+1
                if (step>=20) {step=20}
        }
        else if (newspeed=="slower") {
                step=step-1
                if (step<0) {step=0}
        }
}

window.onresize=init;


function send_search()
	{
		if(document.frmsearch.SearchString.value == "") 
			{
				alert("Please input the text");
				frmsearch.SearchString.focus();
				return false;
			}
		if(document.frmsearch.SearchString.value.length==0 || document.frmsearch.SearchString.value.length==1) 
			{
				alert("At least 2 characters are required for search");
				frmsearch.SearchString.focus();
				return false;
			}
		return true;
}