init();

/*
	init() - Is run as the .js file loads in the browser.
	at this point, the full HTML document has not yet loaded therefore
	the DOM Tree is not fully built.
	
	This function attaches the 'initialise' function to the window onload event
	when the HTML document is loaded, initialise() is called.
*/

function init()
{
	
	if (window.addEventListener) 
	{
       	window.addEventListener('load', initialise, false);
       	return true;
   	}
	else if (window.attachEvent)
	{
       	var r = window.attachEvent('onload', initialise);
      	return r;
   	}
	else
	{
       	return false;
   	}
}

function initialise()
{
	
	//TODO
	//check user agent string
	//TODO
	//Disabled until I've added the useragent check
	//Ideally I'd like to try and detect whether the viewport has been scrolled yet - possible?
	//scrollViewport();
	//window.setTimeout(scrollViewport, 500);
}

function scrollViewport()
{
    window.scrollTo(0, 1);
}