// JavaScript Document


/*
Typing Scroller
Submitted by bengaliboy00@hotmail.com (hp: http://www.angelfire.com/nt/bengaliboy/)
With modifications by Dynamicdrive.com
For full source code, usage terms, and 100s more scripts, visit http://dynamicdrive.com

Customized by Tenzin Norsang Lateng for Phayul.com
*/



var ts_color="black";
var ts_bgcolor="white";
var ts_font="Arial, Helvetica, sans-serif";
var ts_font_weight="normal";
var ts_border="0px black solid";
//Specify font size for scoller
var ts_fontsize="1em";




var ts_link_style="color: navy; text-decoration: none";





//alert(line[1].length);

//--Don't edit below this line

var longestmessage=1;
for (i=2;i<line.length;i++){
if (line[i][0].length>line[longestmessage][0].length)
longestmessage=i;
}

//Auto set scroller width
var tscroller_width=line[longestmessage][0].length;

lines=line.length-1 //--Number of lines

//if IE 4+ or NS6
if (document.all||document.getElementById){
document.write('<div style="background-color: '+ts_bgcolor+'; color: '+ts_color+'; font-family: '+ts_font+'; font-size: '+ts_fontsize+'; font-weight:'+ts_font_weight+'; border: '+ts_border+'; overflow: hidden"><b>Latest News:</b> ');
document.write('<div style="display:inline; border:2px;" id="ticker_text">loading...</div>');
document.write('</div>');

var ticker_text=document.getElementById("ticker_text");

}

temp="";
nextchar=-1;
nextline=1;
cursor=""
function animate(){
if (temp==line[nextline][0] & temp.length==line[nextline][0].length & nextline!=lines){

//document.bannerform.banner.value=temp;
//ticker_text.innerHTML=temp;
if(line[nextline][1]!=""){
	ticker_text.innerHTML='<a href="'+line[nextline][1]+'"'+(ts_link_style!=''?' style="'+ts_link_style+'"':'')+'>'+temp+'</a>';
}
else
{
	ticker_text.innerHTML=temp;
}
nextline++;
nextchar=-1;
temp="";
setTimeout("nextstep()",3000)}
else if (nextline==lines & temp==line[nextline][0] & temp.length==line[nextline][0].length){

//document.bannerform.banner.value=temp;
if(line[nextline][1]!=""){
	ticker_text.innerHTML='<a href="'+line[nextline][1]+'"'+(ts_link_style!=''?' style="'+ts_link_style+'"':'')+'>'+temp+'</a>';
}
else
{
	ticker_text.innerHTML=temp;
}

nextline=1;
nextchar=-1;
temp="";
setTimeout("nextstep()",3000)}
else{
nextstep()}}

function nextstep(){

if (cursor=="\\"){
cursor="|"}
else if (cursor=="|"){
cursor="/"}
else if (cursor=="/"){
cursor="-"}
else if (cursor=="-"){
cursor="\\"}


nextchar++;
temp+=line[nextline][0].charAt(nextchar);
//document.bannerform.banner.value=temp+cursor;
//ticker_text.innerHTML=temp+cursor;
if(line[nextline][1]!=""){
	ticker_text.innerHTML='<a href="'+line[nextline][1]+'"'+(ts_link_style!=''?' style="'+ts_link_style+'"':'')+'>'+temp+cursor+'</a>';
}
else
{
	ticker_text.innerHTML=temp+cursor;
}
setTimeout("animate()",100)}





function show_ticker(){
    if(ticker_loaded!='loaded'){
        setTimeout("show_ticker()",100);
    }
    else{
        animate();
    }
}

//if IE 4+ or NS6
if (document.all||document.getElementById)
show_ticker();
//window.onload=animate;

