var text=new Array()
text[0]="BSTI has got Accreditation for its Food Microbiology, Cement and Textile Laboratories."
text[1]="ISO Regional Conformity Assessment Workshop on Management System Certification Practices ( ISO/IEC 17021 ), 26 - 28 September 2011, Dhaka, Bangladesh."
text[2]="Observance of 42nd World Standards Day, 14 October 2011"

// set the corresponding links 
// If you don't want to link a message just add a "#" instead of an URL
var textlink=new Array()
textlink[0]="chemical_LaboratoryAccreditation.html"
textlink[1]="ISORegionalWorkshop.html"
textlink[2]="WorldStandardsDay.html"

// set the corresponding targets 
// Acceptable values are "_blank", "_self", "_top" or the name of any frame
var texttarget=new Array()
texttarget[0]="_self"
texttarget[1]="_self"
//texttarget[2]="_self"


// set the font of the messages
var textfont="Arial"

// set the font-color of the messages
var textfontcolor="#FFFFFF"

// set the rollover-fontcolor of the messages
var textfontcolorrollover="#FFB062"

// set the font-size of the messages (CSS-values)
var textfontsize=10

// set the font backgroundcolor of the textbox
var textbgcolor="#069"

// set the textweight (normal or bold)
var textweight="normal"

// set the fontstyle (normal or italic)
var textitalic="normal"

// set the width of the textbox (pixels)
var textwidth=480

// set the height of the textbox (pixels)
var textheight=65

// set the pause (seconds)
var textpause=5

// set the width of the border
var textborder=0

// set the color of the border
var textbordercolor="#FFFFFF"

// set the horizontal alignment of the messages (center, left, right)
var textalign="left"

// set the vertival alignment of the messages (middle, top, bottom)
var textvalign="top"

// do not edit below this line
var textdecoration="none"
var transparency=100
var transparencystep=2

var x_pos=0
var y_pos=0
var i_text=0
var textsplit=""
var i_textsplit=0
var i_mark=0
var tickercontent
var pausefade=30
textpause*=1000

var oneloopfinished=false

var browserinfos=navigator.userAgent 
var ie=document.all&&!browserinfos.match(/Opera/)
var ns4=document.layers
var ns6=document.getElementById
var opera=browserinfos.match(/Opera/) 
var chrome=browserinfos.match(/Chrome/)  
var browserok=ie||ns4||ns6||opera||firefox

function changecontent() {
	getcontent()
	i_text++
	if (i_text>=text.length) {i_text=0}	
	document.getElementById('ticker').innerHTML=content
	fadeout()	
}

function fadein() {
	if (transparency<100){
		transparency+=transparencystep
		if (document.getElementById('tickerbg').filters) {
			document.getElementById('tickerbg').filters.alpha.opacity=transparency
		}
		else {
			document.getElementById('tickerbg').style.opacity=transparency/100
		}
		var fadetimer=setTimeout("fadein()",pausefade)
	}
	else {
		clearTimeout(fadetimer)
		setTimeout("changecontent()",1000)
	}
}

function fadeout() {
	if (transparency>0){
		transparency-=transparencystep
		if (document.getElementById('tickerbg').filters) {
			document.getElementById('tickerbg').filters.alpha.opacity=transparency
		}
		else {
			document.getElementById('tickerbg').style.opacity=transparency/100
		}	
		var fadetimer=setTimeout("fadeout()",pausefade)
	}
	else {
		clearTimeout(fadetimer)
		setTimeout("fadein()",textpause)
	}
}

getcontent()
function getcontent() {
	var tablewidth=textwidth
	var tableheight=textheight
	content="<table width="+tablewidth+" height="+tableheight+" cellpadding=0 cellspacing=0 border=0><tr valign="+textvalign+"><td align="+textalign+">"
	content+="<a href=\""+textlink[i_text]+"\" target=\""+texttarget[i_text]+"\" style=\"position:relative;font-family:\'"+textfont+"\';font-size:"+textfontsize+"pt;font-weight:"+textweight+";text-decoration:"+textdecoration+";color:"+textfontcolor+";font-style:"+textitalic+";\" onMouseOver=\"this.style.color=\'"+textfontcolorrollover+"\'\" onMouseOut=\"this.style.color=\'"+textfontcolor+"\'\">"
	content+=text[i_text]
	content+="</a></td></tr></table>"
}

document.write("<div id=\"roof\" style=\"position:relative;width:"+textwidth+"px;height:"+textheight+"px;font-family:\'"+textfont+"\';border-style:solid;border-color:"+textbordercolor+";border-width:"+textborder+"px;background-color:"+textbgcolor+";\">")
	
document.write("<div id=\"tickerbg\" style=\"position:absolute;top:"+-textborder+"px;left:"+-textborder+"px;width:"+textwidth+"px;height:"+textheight+"px;font-family:\'"+textfont+"\';font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+";border-style:solid;border-color:"+textbordercolor+";border-width:"+textborder+"px;background-color:"+textfontcolor+";overflow:hidden\;filter:alpha(opacity=100);opacity:1\">")
document.write("</div>")

document.write("<div id=\"ticker\" style=\"position:absolute;top:"+-textborder+"px;left:"+-textborder+"px;width:"+textwidth+"px;height:"+textheight+"px;font-family:\'"+textfont+"\';font-size:"+textfontsize+"pt;font-weight:"+textweight+";font-style:"+textitalic+";border-style:solid;border-color:"+textbordercolor+";border-width:"+textborder+"px;overflow:hidden\;\">")
document.write("</div></div>")

window.onload=changecontent
