var _MouseX;
var _MouseY;
var englishLocation;
var arabicLocation;
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = GetMousePos;

function HoverDataRow(row, isOn, rowType)
{
	if (isOn)
	{
		row.className = 'DataRowStyleHover';
	}
	else
	{
		switch (rowType)
		{
			case 0:
			{
				row.className = 'DataRowStyle0';
				break;
			}
			case 1:
			{
				row.className = 'DataRowStyle1';
				break;
			}
		}
	}
}

function ShowArticle (articleListString)
{
	articleList = articleListString.substring(0, articleListString.length - 1).split("~");
	
	if (articleList.length > 2)
	{
		for (i = 0; i < articleList.length; i+=2)
		{
			switch (parseInt(articleList[i]))
			{
				case 1: //English
				{
					englishLocation = articleList[i+1];
					break;
				}
				case 2: //Arabic
				{
					arabicLocation = articleList[i+1];
					break;
				}
			}
			
		}
		
		ShowPanel(document.getElementById('fileChoiceDiv'));
	}
	else
	{
		LaunchDocument(articleList[1]);
	}
}

function LaunchDocument (fileName)
{
	HidePanel(document.getElementById('fileChoiceDiv'));
	window.open(fileName);
}

function FormatDate (dateString)
{
	splitDate = dateString.split("-");
	return splitDate[2] + " " + getMonth(parseInt(splitDate[1], 10)) + " " + splitDate[0];
}

function GetMousePos(e)
{
	if (IE) 
	{ 
		// grab the x-y pos.s if browser is IE
		_MouseX = event.clientX + document.body.scrollLeft
		_MouseY = event.clientY + document.body.scrollTop
	} 
	else
	{  
		// grab the x-y pos.s if browser is NS
		_MouseX = e.pageX
		_MouseY = e.pageY
	}  
	
	// catch possible negative values in NS4
	if (_MouseX < 0){_MouseX = 0}
	if (_MouseY < 0){_MouseY = 0}  	
}

function HidePanel (panel)
{
	panel.style.visibility = 'hidden';
	panel.style.top = 0;
}

function ShowPanel (panel)
{
	panel.style.left = _MouseX - 10;
	panel.style.top = _MouseY - 10;
	panel.style.visibility = 'visible';
}