
var scrollerdelay='4000' //delay between msg scrolls. 3000=3 seconds.
var scrollerwidth=screen.width-230
var scrollerheight='20px'
var scrollerbgcolor='#BAD2FE'
//set below to '' if you don't wish to use a background image
var scrollerbackground='scrollerback.gif'

//configure the below variable to change the contents of the scroller
var messages=new Array()
fillMessages();

//---------------------------------------- NEWS COMES HERE --------------------------------------------//
function fillMessages(){

messages[00]="<span class='TickerColor'>DAWN Media Group</span>"
messages[01]="<a class='TickerColor' href=./welcome.htm#55>Militants lay siege to police station in Shabqadar</a>"
messages[02]="<a class='TickerColor' href=./welcome.htm#54>Bush, world leaders try to contain market fallout</a>"
messages[03]="<a class='TickerColor' href=./welcome.htm#52>Bush offers Pakistan 'help' protecting itself</a>"
messages[04]="<a class='TickerColor' href=./welcome.htm#51>Five killed in Swat protest over civilian deaths: police</a>"
messages[05]="<a class='TickerColor' href=./welcome.htm#50>Ban Ki-moon kicks off UN summit</a>"
messages[06]="<a class='TickerColor' href=./welcome.htm#49>Chemical equator divides hemispheres: scientists</a>"
messages[07]="<a class='TickerColor' href=./welcome.htm#48>History in the making at Singapore</a>"
messages[08]="<a class='TickerColor' href=./welcome.htm#47>Time to buy Morgan Stanley, Goldman?</a>"
messages[09]="<a class='TickerColor' href=./welcome.htm#46>Bombing in Palestinian camp in Lebanon, one killed</a>"
messages[10]="<a class='TickerColor' href=./welcome.htm#45>Saudi Arabia unveils supercomputer plans</a>"
messages[11]="<a class='TickerColor' href=./welcome.htm#44>Referee blunders strain ‘respect’ truce</a>"
messages[12]="<a class='TickerColor' href=./welcome.htm#43>Suspects in Pearl case yet to be tried</a>"
messages[13]="<a class='TickerColor' href=./welcome.htm#43>Suspects in Pearl case yet to be tried</a>"
messages[14]="<a class='TickerColor' href=./welcome.htm#42>Asia vindicated by Wall Street bust</a>"
messages[15]="<a class='TickerColor' href=./welcome.htm#41>PML-Q urges govt to mull terror strategy in parliament</a>"
messages[16]="<a class='TickerColor' href=./welcome.htm#40>UN refugee agency seeks 17 mln dollars for Pakistan</a>"
messages[17]="<a class='TickerColor' href=./welcome.htm#39>Zakumi kicks-off 2010 hype</a>"
messages[18]="<a class='TickerColor' href=./welcome.htm#38>Probe Committee set up, inquiry into CDA inefficiency</a>"
messages[19]="<a class='TickerColor' href=./welcome.htm#37>Activists to defy Israel and sail to Gaza again</a>"
messages[20]="<a class='TickerColor' href=./welcome.htm#36>Student kills several in Finnish school</a>"
messages[21]="<a class='TickerColor' href=./welcome.htm#35>Pakistan to feature in World Mind Sports</a>"
messages[22]="<a class='TickerColor' href=./welcome.htm#34>Aisam loses to Soderling in Thai Open</a>"
messages[23]="<a class='TickerColor' href=./welcome.htm#33>Sacked Indian workers kill boss: police</a>"
messages[24]="<a class='TickerColor' href=./welcome.htm#32>Past sins breed terrorism</a>"
messages[25]="<a class='TickerColor' href=./welcome.htm#31>Shoaib Akhtar can play domestic Twenty20</a>"
messages[26]="<a class='TickerColor' href=./welcome.htm#30>50 militants, soldier killed in Dara Adamkhel</a>"
messages[27]="<a class='TickerColor' href=./welcome.htm#29>Asians fire up Cricket Italia</a>"
messages[28]="<a class='TickerColor' href=./welcome.htm#28>US-held prisoners in Afghan jail to meet families: ICRC</a>"
messages[29]="<a class='TickerColor' href=./welcome.htm#27>Stamping out corruption can save lives, watchdog says</a>"
messages[30]="<a class='TickerColor' href=./welcome.htm#26>All systems go for China's first space walk</a>"
messages[31]="<a class='TickerColor' href=./welcome.htm#25>Floods kill 14, hit farmland in Thailand</a>"
messages[32]="<a class='TickerColor' href=./welcome.htm#24>India to tour Pakistan next year despite bombings</a>"
messages[33]="<a class='TickerColor' href=./welcome.htm#23>Militants now preaching in urban mosques</a>"
messages[34]="<a class='TickerColor' href=./welcome.htm#22>Suicide blast near German troops in Afghanistan</a>"
messages[35]="<a class='TickerColor' href=./welcome.htm#21>Palestinian in car injures 13 Israelis</a>"
messages[36]="<a class='TickerColor' href=./welcome.htm#20>Zardari’s US visit</a>"
messages[37]="<a class='TickerColor' href=./welcome.htm#19>Moody’s changes Pakistan’s ratings to negative</a>"
messages[38]="<a class='TickerColor' href=./welcome.htm#18>Hotels may suffer huge losses</a>"
messages[39]="<a class='TickerColor' href=./welcome.htm#17>Petroleum import bill increases 88 per cent</a>"
messages[40]="<a class='TickerColor' href=./welcome.htm#16>Bomb kills Afghan district and police chief</a>"
messages[41]="<a class='TickerColor' href=./welcome.htm#15>Farahi moved to Mohmand, still in militants’ hold</a>"
messages[42]="<a class='TickerColor' href=./welcome.htm#14>Guru Nanak’s death anniversary rites conclude</a>"
messages[43]="<a class='TickerColor' href=./welcome.htm#13>PML-N, PPP agree to temporary truce in Punjab</a>"
messages[44]="<a class='TickerColor' href=./welcome.htm#12>Critical irrigation water shortage feared</a>"
messages[45]="<a class='TickerColor' href=./welcome.htm#11>Afghan Consul-General kidnapped in Peshawar</a>"
messages[46]="<a class='TickerColor' href=./welcome.htm#10>Punjab's Southern belt a breeding ground: Ghani</a>"
messages[47]="<a class='TickerColor' href=./welcome.htm#e9>Pakistan, Afghanistan discuss joint border force</a>"
messages[48]="<a class='TickerColor' href=./welcome.htm#e8>HRW cries foul over Amina Janjua's visa revocation</a>"
messages[49]="<a class='TickerColor' href=./welcome.htm#e7>UN Security Council slams Marriott bombing</a>"
messages[50]="<a class='TickerColor' href=./welcome.htm#e6>France to beef up Afghanistan mission</a>"
messages[51]="<a class='TickerColor' href=./welcome.htm#e5>US military frees Afghan journalist</a>"
messages[52]="<a class='TickerColor' href=./welcome.htm#e4>Zardari arrives in New York for UN meeting</a>"
messages[53]="<a class='TickerColor' href=./welcome.htm#e3>US airforce major among blast victims</a>"
messages[54]="<a class='TickerColor' href=./welcome.htm#e2>Oil price makes record one-day jump</a>"
messages[55]="<a class='TickerColor' href=./welcome.htm#e1>Security forces kill 30 militants in NWFP clash</a>"
messages[56]="<a class='TickerColor' href=./welcome.htm#kse1>At close of trading, the KSE-100 index was at 9199.51, down 0.71 points</a>"
messages[57]="<a class='TickerColor' href=./welcome.htm#kse2>The Pakistani Rupee was traded at Rs 78.3 to the US Dollar</a>"                             



//---------------------------------------- NEWS COMES HERE --------------------------------------------//
}

///////Do not edit pass this line///////////////////////

var ie=document.all
var dom=document.getElementById


function move(whichdiv){
	tdiv=eval(whichdiv)
	if (parseInt(tdiv.style.top)>0&&parseInt(tdiv.style.top)<=5){
		tdiv.style.top=0+"px"
		setTimeout("move(tdiv)",scrollerdelay)
		setTimeout("move2(second2_obj)",scrollerdelay)
		return
	}
	if (parseInt(tdiv.style.top)>=tdiv.offsetHeight*-1){
		tdiv.style.top=parseInt(tdiv.style.top)-5+"px"
		setTimeout("move(tdiv)",50)
	}
	else
	{
		tdiv.style.top=parseInt(scrollerheight)+"px"
		tdiv.innerHTML=messages[i]
		if (i==messages.length-1)
			i=0
		else
			i++
	}
}

function move2(whichdiv){
	tdiv2=eval(whichdiv)
	if (parseInt(tdiv2.style.top)>0&&parseInt(tdiv2.style.top)<=5){
		tdiv2.style.top=0+"px"
		setTimeout("move2(tdiv2)",scrollerdelay)
		setTimeout("move(first2_obj)",scrollerdelay)
		return
	}
	if (parseInt(tdiv2.style.top)>=tdiv2.offsetHeight*-1){
		tdiv2.style.top=parseInt(tdiv2.style.top)-5+"px"
		setTimeout("move2(second2_obj)",50)
	}
	else{
		tdiv2.style.top=parseInt(scrollerheight)+"px"
		tdiv2.innerHTML=messages[i]
	if (i==messages.length-1)
		i=0
	else
		i++
	}
}

function startscroll(){
	first2_obj=ie? first2 : document.getElementById("first2")
	second2_obj=ie? second2 : document.getElementById("second2")
	move(first2_obj)
	second2_obj.style.top=scrollerheight
	second2_obj.style.visibility='visible'
}

function CreateTicker(){
	if (messages.length>2)
		i=2
	else
		i=0
		
	if (ie||dom){
		document.writeln('<div id="main2" style="position:relative;width:'+scrollerwidth+';height:'+scrollerheight+';overflow:hidden;background-color:'+scrollerbgcolor+' ;background-image:url('+scrollerbackground+')">')
		document.writeln('<div style="position:absolute;width:'+scrollerwidth+';height:'+scrollerheight+';clip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">')
		document.writeln('<div id="first2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:1px;">')
		document.write(messages[0])
		document.writeln('</div>')
		document.writeln('<div id="second2" style="position:absolute;width:'+scrollerwidth+';left:0px;top:0px;visibility:hidden">')
		document.write(messages[dyndetermine=(messages.length==1)? 0 : 1])
		document.writeln('</div>')
		document.writeln('</div>')
		document.writeln('</div>')
	}


	if (window.addEventListener)
		window.addEventListener("load", startscroll, false)
	else if (window.attachEvent)
		window.attachEvent("onload", startscroll)
	else if (ie||dom)
		window.onload=startscroll
	}

