/* Add swooshes */

function init_page()
{
	add_swooshes();
	set_element_heights();
}

function add_swooshes()
{
	if (document.getElementById)
	{
		//position swoosh container block
		var _block = document.getElementById("block");
		var _swooshblock = document.getElementById("swooshblock");
		_swooshblock.style.top = _block.offsetTop + "px";
		_swooshblock.style.left = _block.offsetLeft + "px";
				
		//swoosh 1 (thin clients)
		var swoosh1 = document.getElementById("ctl00_ContentPlaceHolder1_swoosh1");//AQ
		if (swoosh1 != null)
		{
			var top1 = swoosh1.offsetTop - 45;
			var img1 = document.createElement('img');
			img1.setAttribute('alt', '');
			img1.setAttribute('src', 'images/backgrounds/swooshes/swoosh-1.png');
			img1.setAttribute('width', '807');
			img1.setAttribute('height', '76');
			img1.className = 'generatedswoosh';
			img1.style.top = top1 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img1);
		}
		
		//swoosh 2 (thin clients)
		var swoosh2 = document.getElementById("swoosh2");
		if (swoosh2 != null)
		{
			var top2 = swoosh2.offsetTop + 170;
			var img2 = document.createElement('img');
			img2.setAttribute('alt', '');
			img2.setAttribute('src', 'images/backgrounds/swooshes/swoosh-2.png');
			img2.setAttribute('width', '807');
			img2.setAttribute('height', '99');
			img2.className = 'generatedswoosh';
			img2.style.top = top2 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img2);
		}
		
		//swoosh 33 (digital services)
		var swoosh3 = document.getElementById("swoosh3");//AQ
		if (swoosh3 != null)
		{
			var top3 = swoosh3.offsetTop;
			var img3 = document.createElement('img');
			img3.setAttribute('alt', '');
			img3.setAttribute('src', 'images/backgrounds/swooshes/swoosh-3.png');
			img3.setAttribute('width', '807');
			img3.setAttribute('height', '142');
			img3.className = 'generatedswoosh';
			img3.style.top = top3 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img3);
		}
		
		//swoosh 4 (devices)
		var swoosh4 = document.getElementById("ctl00_ContentPlaceHolder1_swoosh4");//AQ
		if (swoosh4 != null)
		{
			var top4 = swoosh4.offsetTop - 10;
			var img4 = document.createElement('img');
			img4.setAttribute('alt', '');
			img4.setAttribute('src', 'images/backgrounds/swooshes/swoosh-4.png');
			img4.setAttribute('width', '807');
			img4.setAttribute('height', '97');
			img4.className = 'generatedswoosh';
			img4.style.top = top4 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img4);
		}
		
		//swoosh 5 (manageable)
		var swoosh5 = document.getElementById("swoosh5");
		if (swoosh5 != null)
		{
			var top5 = swoosh5.offsetTop + 80;
			var img5 = document.createElement('img');
			img5.setAttribute('alt', '');
			img5.setAttribute('src', 'images/backgrounds/swooshes/swoosh-5.png');
			img5.setAttribute('width', '807');
			img5.setAttribute('height', '89');
			img5.className = 'generatedswoosh';
			img5.style.top = top5 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img5);
		}
		
		//swoosh 6 (reliable & secure)
		var swoosh6 = document.getElementById("swoosh6");
		if (swoosh6 != null)
		{
			var top6 = swoosh6.offsetTop + 57;
			var img6 = document.createElement('img');
			img6.setAttribute('alt', '');
			img6.setAttribute('src', 'images/backgrounds/swooshes/swoosh-6.png');
			img6.setAttribute('width', '807');
			img6.setAttribute('height', '130');
			img6.className = 'generatedswoosh';
			img6.style.top = top6 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img6);
		}
		
		//swoosh 7 (innovative)
		var swoosh7 = document.getElementById("swoosh7");//AQ
		if (swoosh7 != null)
		{
			var top7 = swoosh7.offsetTop + 194;
			var img7 = document.createElement('img');
			img7.setAttribute('alt', '');
			img7.setAttribute('src', 'images/backgrounds/swooshes/swoosh-7.png');
			img7.setAttribute('width', '807');
			img7.setAttribute('height', '124');
			img7.className = 'generatedswoosh';
			img7.style.top = top7 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img7);
		}
		
		//swoosh 8 (innovative)
		var swoosh8 = document.getElementById("swoosh8");
		if (swoosh8 != null)
		{
			var top8 = swoosh8.offsetTop - 3;
			var img8 = document.createElement('img');
			img8.setAttribute('alt', '');
			img8.setAttribute('src', 'images/backgrounds/swooshes/swoosh-8.png');
			img8.setAttribute('width', '807');
			img8.setAttribute('height', '183');
			img8.className = 'generatedswoosh';
			img8.style.top = top8 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img8);
		}
		
		//swoosh 9 (innovative)
		var swoosh9 = document.getElementById("swoosh9");
		if (swoosh9 != null)
		{
			var top9 = swoosh9.offsetTop - 6;
			var img9 = document.createElement('img');
			img9.setAttribute('alt', '');
			img9.setAttribute('src', 'images/backgrounds/swooshes/swoosh-9.png');
			img9.setAttribute('width', '807');
			img9.setAttribute('height', '168');
			img9.className = 'generatedswoosh';
			img9.style.top = top9 + "px";
			//attach <img> to container
			_swooshblock.appendChild(img9);
		}
		
	}
}

function getElementByClassName (className)
{
	var _selected_elements = new Array();
	var _elements = document.getElementsByTagName("*");
	if (_elements != null && _elements.length > 0)
	{
		for (x = 0; x < _elements.length; x ++)
		{
			if (_elements[x].className == className)
			{
				_selected_elements[_selected_elements.length] = _elements[x];
			}
		}
	}
	return _selected_elements;
}

function set_element_heights()
{
	if (document.getElementById)
	{
		var _block = document.getElementById("block");
		var _footer = document.getElementById("footer");
		if (_block != null && _footer != null)
		{
			var _bg = document.getElementById("bg");
			if (_bg != null)
			{
				//left col
				_bg.style.height = (_block.offsetHeight - _footer.offsetHeight) + "px";
				_bg.className = "bg bgtall";
			}
			
			var _bg2 = document.getElementById("bg2");
			if (_bg2 != null)
			{
				//right col
				_bg2.style.height = (_block.offsetHeight - _footer.offsetHeight) + "px";
				_bg2.className = "bg bgtall";
			}
			
			/*var _bg3 = document.getElementById("bg3");
			var _devices = document.getElementById("bg3");
			if (_bg3 != null && _devices != null)
			{alert(_devices.offsetHeight);
				//right col
				_bg3.style.height = (_block.offsetHeight - _devices.offsetHeight) + "px";
				_bg3.className = "bg bgtall";
			}*/
		}
	}
}

function resize_page()
{
	if (document.getElementById)
	{
		var _block = document.getElementById("block");
		var _swooshblock = document.getElementById("swooshblock");
		_swooshblock.style.left = _block.offsetLeft + "px";
	}
}

if (window.addEventListener)
{
	window.addEventListener('load', init_page, false)
	window.addEventListener('resize', resize_page, false)
}
else if (window.attachEvent)
{
	window.attachEvent('onload', init_page)
	window.attachEvent('onresize', resize_page)
}

