function WebsiteRedirect(url)
{
	window.open (url);
	return false;
}

function addToFavorites(urlAddress, pageName) 
{ 
	if (window.external) 
	{ 
		window.external.AddFavorite(urlAddress,pageName) 
	} 
	else 
	{ 
		alert("Sorry! Your browser doesn't support this function, Please check your browser documentation to determine how to add this page to your favourites."); 
	} 
} 

function getScrollingPosition()
{
	//array for X and Y scroll position
	var position = [0, 0];

	//if the window.pageYOffset property is supported
	if(typeof window.pageYOffset != 'undefined')
	{
		//store position values
		position = [
			window.pageXOffset,
			window.pageYOffset
			];
	}

	//if the documentElement.scrollTop property is supported
	//and the value is greater than zero
	else if(typeof document.documentElement.scrollTop != 'undefined'
		&& document.documentElement.scrollTop > 0)
	{
		//store position values
		position = [
			document.documentElement.scrollLeft,
			document.documentElement.scrollTop
			];
	}

	//if the body.scrollTop property is supported
	else if(typeof document.body.scrollTop != 'undefined')
	{
		//store position values
		position = [
			document.body.scrollLeft,
			document.body.scrollTop
			];
	}

	//return the array
	return position;
};




function getViewportSize()
{
	var size = [0,0];
  
	if (typeof window.innerWidth != 'undefined')
	{
		size = [
			window.innerWidth,
			window.innerHeight
		];
	}
	else if (typeof document.documentElement != 'undefined'
		&& typeof document.documentElement.clientWidth != 'undefined' 
		&& document.documentElement.clientWidth != 0)
	{
		size = [
			document.documentElement.clientWidth, 
			document.documentElement.clientHeight
		];
	}
	else
	{
		size = [
			document.getElementsByTagName('body')[0].clientWidth,
			document.getElementsByTagName('body')[0].clientHeight
		];
	}
  
	return size;
};




function getPosition(theElement)
{
	var positionX = 0;
	var positionY = 0;

	while (theElement != null)
	{
		positionX += theElement.offsetLeft;
		positionY += theElement.offsetTop;
		theElement = theElement.offsetParent;
	}
    
	return [positionX, positionY];
};

function schedule(objectID, functionCall, iteration)
{
	if (iteration == null)
	{
		iteration = 0;
	}
	
	if (objectID == "window")
	{
		var oldonload = window.onload;
		
		if (typeof window.onload != "function")
		{
			window.onload = functionCall;
		}
		else
		{
			window.onload = function()
			{
				oldonload();
				functionCall();
			}
		}
	}
	else if (document.getElementById(objectID))
	{
		functionCall();
	}
	else if (iteration < 300)
	{
		setTimeout(function(){schedule(objectID, functionCall, iteration + 1)}, 10);
	}
	
	return true;
}