
  document.write('<style>.t{font-size:10px; font-family:Verdana; font-weight:bold;} .x,.i{text-align:center;font-weight:bold;font-size:10px;font-family:verdana;color:#fbfbfb} #r{color:#FF0000;} #g{color:#00AA33;} #gr{color:#777777;}</style>');
document.write('<map name="Map"><area shape="rect" coords="30,0,45,14" href="javascript:goup();" alt="Speed Up"><area shape="rect" coords="15,0,30,14" href="javascript:godirection();" alt="Change Direction"><area shape="rect" coords="0,0,15,14" href="javascript:godown();" alt="Slow Down"></map>')
document.write('\
<table width=850 height=35 border=0 cellspacing=0 cellpadding=0>\
	<td width="50"><img src="../css/tools.jpg" width="39" height="12" border="0" usemap="#Map"></td>\
	<td valign=top >&nbsp;<marquee direction="left" id="tickerMarquee" truespeed scrollamount=1 scrolldelay=30  width="650px" >&nbsp;</marquee></td>\
	<td id="indexDiv" width=150 align=left></td>\
</table>\
');
	
window.onload=getData;

function getData()
	{
	var Obj= new Date;
	includeCounter =Obj.getTime();
	var e = document.createElement("script");
	e.src = "http://exchange.jo/ticker_data/data.js?"+includeCounter;
	e.type="text/javascript";
	document.getElementsByTagName("head")[0].appendChild(e); 	
	}
	

function updateTicker()
	{
//	document.all.dateDiv.innerHTML	= "<span id=r>"+tickerDate+"</span>";

	if(_s[0]=='')
		{
		document.all.tickerMarquee.innerHTML = "";
		return;
		}
		
	var temp = -1;
	if(temp == -1)
		{
		var temp = new Array();
		for(i=0;i<_a.length;i++) temp[i] = i;
		}

	var string	=	'<table class=x cellpadding=0 cellspacing=0 border=0 height=30 ><tr>';
	if(temp.length)
	for(i=0;i<temp.length;i++)
		{ 
		if(_a[temp[i]]=='+')
			{
			var sign	= '<span id=g>&#9650;</span>';
			var id='g';
			}
		else if(_a[temp[i]]=='-')
			{
			var sign	= '<span id=r>&#9660;</span>';
			var id='r';
			}
		else
			{
			var sign	= '';
			var id='gr';
			}
		var symbol	= _s[temp[i]];
		var price	= "<sub id='+id+'>"+_p[temp[i]]+'</sub>';
		var change	= '<sub>'+_c[temp[i]]+'%</sub>';
		
		string	+=	'<td nowrap>&nbsp; '+symbol+' '+price+' '+sign+' '+change+' &nbsp;</td>';
		}
	else 
		{ 
		if(_a[temp]=='+')
			{
			var sign	= '<span id=g>&#9650;</span>';
			var id='g';
			}
		else if(_a[temp]=='-')
			{
			var sign	= '<span id=Span1>&#9660;</span>';
			var id='r';
			}
		else
			{
			var sign	= '';
			var id='gr';
			}
		var symbol	= _s[temp];
		var price	= "<sub id='Sub1'>"+_p[temp]+'</sub>';
		var change	= '<sub>'+_c[temp]+'%</sub>';
		
		string	+=	'<td nowrap>&nbsp; '+symbol+' '+price+' '+sign+' '+change+' &nbsp;</td>';
			
			
		}
	string	+=	'<tr></table>';
	document.all.tickerMarquee.innerHTML = string;
	}


function searchTicker()
	{
	if(trimString(document.all.search_string.value)=='') return -1;
	var count = 0;
	var temp = new Array();
	var array = document.all.search_string.value.split(',');
	if(array.length)
		for(i=0;i<array.length;i++)
			{
			array[i] = trimString(array[i]).toUpperCase();
			for(x=0;x<_s.length;x++)
				{
				if(_s[x]==array[i]) 
					{
					temp[count]=x;
					count++;
					}
				}
		
			}
	else
		{
			array = trimString(array).toUpperCase();
			for(x=0;x<_s.length;x++)
				{
				if(_s[x]==array) 
					{
					temp[count]=x;
					count++;
					}
				}			
		}
	if(count==0) 
		return -1;

	return temp;
	}

function trimString (str) {
  str = this != window? this : str;
  return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}

function godirection()
	{
	if(document.all.tickerMarquee.direction=='right')
		document.all.tickerMarquee.direction='left';
	else 	document.all.tickerMarquee.direction='right';
	}	

function goup()
	{
	if(document.all.tickerMarquee.scrollDelay==5) return;
	document.all.tickerMarquee.scrollDelay-=5;
	}

function godown()
	{
	if(document.all.tickerMarquee.scrollDelay==30) return;
	document.all.tickerMarquee.scrollDelay+=5;
	}

  
