function popup(popupcompanyfile, winheight, winwidth, Type, Scrollable)
{
		if (winheight==0)
				winheight = screen.availHeight - 100;
		if (winwidth==0)
				winwidth = screen.availWidth - 50;
		var myTop
		var myWidth
		myTop = ((screen.availHeight - winheight)/2) - 25;
		myLeft = (screen.availWidth - winwidth)/2;
		if (Scrollable == 0)
			window.open(popupcompanyfile, Type, "resizable=no,status=no,height=" + winheight + ",width=" + winwidth + ",scrollbars=no, location=no, menubar=no, left=" + myLeft + ", top=" + myTop);
		else
			window.open(popupcompanyfile, Type, "resizable=no,status=no,height=" + winheight + ",width=" + winwidth + ",scrollbars=yes, location=no, menubar=no, left=" + myLeft + ", top=" + myTop);
}

function urlencode(str) {
	str = escape(str);
	str = str.replace('+', '%2B');
	str = str.replace('%20', '+');
	str = str.replace('*', '%2A');
	str = str.replace('/', '%2F');
	str = str.replace('@', '%40');
	str = str.replace('.', '%2e');
	return str;
}

function GetXmlHttpObject(){
	var instance=null;
	try{		// Firefox, Opera 8.0+, Safari
	instance=new XMLHttpRequest();
	}
	catch (e){	// Internet Explorer
	try{
		instance=new ActiveXObject("Msxml2.XMLHTTP");
		}
	catch (e){
		instance=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return instance;
} 

function newsDirection(Direction)
{
	var MrqObj = document.getElementById("mrqNews");
	if(Direction == "Down")
	{
		MrqObj.direction = "Down";
		MrqObj.scrollAmount = 1;
	}
	else
	{
		if(Direction == "Up")
		{
			MrqObj.direction = "Up";
			MrqObj.scrollAmount = 1;
		}
		else
		{
			if(MrqObj.scrollAmount == 1)
			{
				MrqObj.scrollAmount = 0;
			}
		}
	}
}

function TickerDirection(Direction)
{
	var MrqObj = document.getElementById("MQ");
	if(Direction == "Right")
	{
		MrqObj.direction = "Right";
		MrqObj.scrollAmount = 1;
	}
	else
	{
		if(Direction == "Left")
		{
			MrqObj.direction = "Left";
			MrqObj.scrollAmount = 1;
		}
		else
		{
			if(MrqObj.scrollAmount == 1)
			{
				MrqObj.scrollAmount = 0;
			}
		}
	}
}