// JavaScript Document
function getHeight() {
	//alert('getHeight');
	var header;
	var theHeight = getBrowserHeight();
	var content = document.getElementById('content').offsetHeight;
	var divs = document.getElementsByTagName('div');
	for(var i=0; i<divs.length; i++){ 
          if(/\bheader\b/.test(divs[i].className)){
			  if (divs[i].id == 'intro') {
				header = divs[i];
				header.style.height = 0.45*theHeight + "px";
/*				if (header.style.height < 200 + "px") {header.style.height = "200px";}*/
			  }
			  header = divs[i];
		  }
		}
	if(document.getElementById('flashhead')) {
		var flashhead = document.getElementById('flashhead')
		flashhead.style.top = 0.45*theHeight-194 + "px";
	}
	//alert(header.scrollHeight);
//	var intro = document.getElementById('intro');
//	intro.style.height = theHeight/2 + "px";
	/*alert(header.offsetHeight);*/
	content+=header.offsetHeight;
	content+=50;
	/*alert(content);
	alert(theHeight);*/
	if (theHeight < content) {
		for(var i=0;i<divs.length;i++){ 
          if(/\bfooter\b/.test(divs[i].className)){
			  var footer = divs[i];
			  footer.style.position = 'relative';
		  }
		}
	}
	else {
		for(var i=0;i<divs.length;i++){ 
          if(/\bfooter\b/.test(divs[i].className)){
			  var footer = divs[i];
			  footer.style.position = 'absolute';
		  }
		}
	}
}
function getBrowserHeight()
{
	if (window.innerHeight)
	{
		return window.innerHeight;
	}
	else if (document.documentElement && document.documentElement.clientHeight != 0)
	{
		return document.documentElement.clientHeight;
	}
	else if (document.body)
	{
		return document.body.clientHeight;
	}
	
	return 0;
}
function coopLinks () {
	var container, containerUl, thediv, link1, linkImg, link3;
	var x = document.getElementsByTagName('p');
	for(var i=0;i<x.length;i++){ 
          if(/\billustration\b/.test(x[i].className)){
			  container = x[i];
		  	}
		  }
	if(container == null)
	{
		return;
	}
	/*var links = container.getElementsByTagName('a');
	link1 = links[0];
	linkImg = links[1];
	for(var i=0;i<links.length;i++){
			
		}
	var m = document.getElementsByTagName('div');
	for(var i=0;i<m.length;i++){ 
          if(/\bsecondary\b/.test(m[i].className)){
			  thediv = m[i];
		  }
		}
	var h2 = thediv.getElementsByTagName('h2');
	link3 = h2.firstChild;
	if(document.getElementById('latest')) {
		link3 = document.getElementById('latest');
	}
	hoverLatest (link1, linkImg, link3);
	var y = document.getElementsByTagName('ul');
	for(var i=0;i<y.length;i++){ 
          if(/\bmedia\b/.test(y[i].className)){
			containerUl = y[i].getElementsByTagName('li');
			for(var j=0;j<containerUl.length;j++){
				//hoverLinks (containerUl[j]);
			}
		}
	}*/
}
/*function hoverLinks (cont) {
	var links = cont.getElementsByTagName('a');
	//alert(links.length);
	for(var i=0;i<links.length;i++){ 
        links[i].onmouseover = function () {
			links[1].style.color = '#fff'; 
			links[1].style.textDecoration = 'underline';
			links[0].firstChild.style.border = '1px solid #fff';
			}
		links[i].onmouseout = function () {
			links[1].style.color = '#f00'; 
			links[1].style.textDecoration = 'none';
			links[0].firstChild.style.border = '1px solid #f00';
			}
		}
}*/
/*function hoverLatest (l1, lI, l3) {
	var links = [l1,lI,l3]
	for(var i=0;i<links.length;i++){ 
        links[i].onmouseover = function () {	
			//if (links[2]) links[2].style.color = '#fff'; 
			//if (links[2]) links[2].style.textDecoration = 'underline';
			if (links[0]) links[0].firstChild.style.border = '1px solid #fff';
			if (links[1]) links[1].style.color = '#fff'; 
			if (links[1]) links[1].style.textDecoration = 'underline';
			}
		links[i].onmouseout = function () {
			//if (links[2]) links[2].style.color = '#f00'; 
			//if (links[2]) links[2].style.textDecoration = 'none';
			if (links[0]) links[0].firstChild.style.border = '1px solid #f00';
			if (links[1]) links[1].style.color = '#f00'; 
			if (links[1]) links[1].style.textDecoration = 'none';
			}
		}
}*/