window.onload = Load;

/* Starting Onload Scripts */

function Load()
{
	document.getElementById('website-title').onclick = function()
	{
		window.location = aHome;
	}
	
	/****/
	
	document.getElementById('q').onfocus = function()
	{
		if (this.value == 'Buscar...')
		{
			this.value = '';
		}
	}
	document.getElementById('q').onblur = function()
	{
		if (this.value == '')
		{
			this.value = 'Buscar...';
		}
	}
	
	/****/
	
	if (aLocation == 'home')
	{
		StartFeatured = setInterval (StartFeatured, 10);
	}
	
	if (aLocation == 'single')
	{
		document.getElementById('e').onfocus = function()
		{
			if (this.value == 'Digite aqui seu email para receber...')
			{
				this.value = '';
			}
		}
		document.getElementById('e').onblur = function()
		{
			if (this.value == '')
			{
				this.value = 'Digite aqui seu email para receber...';
			}
		}
	}
}

/* Setting Variables & Preload */

var X = 0;

var preload = new Array();
	
preload[0] = new Image();
preload[1] = new Image();
preload[2] = new Image();
	
preload[0].src = aImage[0];
preload[1].src = aImage[1];
preload[2].src = aImage[2];

/* Featured Script Functions */

function StartFeatured()
{
	document.getElementById('brief').innerHTML = 'Carregando...';
	if ((preload[0].complete) && (preload[1].complete) && (preload[2].complete))
	{
		setInterval (ChangeFeatured, 5000);
		clearInterval (StartFeatured);
	}
}

function ChangeFeatured()
{
	document.getElementById('headline').style.background = "url("+aImage[X]+")";
	document.getElementById('brief').innerHTML = aBrief[X];
	document.getElementById('more').innerHTML = '<a href="'+aLink[X]+'">[saiba mais]</a>';
	
	X++;
	
	if (X >= aImage.length) { X = 0; }
}
