// JavaScript Document

function fillWindow(targetID) {
	
	//1280x1024
	
	var target = document.getElementById(targetID);
	var originalHeight = 800;		// put in native image dimensions here
	var originalWidth = 1200;
	
	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
	
	var newWidth = w;
	var newHeight = Math.round(originalHeight*(w/originalWidth));
	if (newHeight < h) {
		newHeight = h;
		newWidth = Math.round(originalWidth*(h/originalHeight));
	}
	
	target.height = newHeight;
	target.style.left = Math.round((w/2) - (newWidth/2))+"px";
	target.style.top = Math.round((h/2) - (newHeight/2))+"px";
	
}



function setDivHeight(targetID, newheight) {
	
	var target = document.getElementById(targetID);
	target.style.height = newheight + 20;
	
	var target2 = document.getElementById('people');
	target.style.top = newheight + 20;
	
}


startList = function() {
	
if (document.all && document.getElementById) {
	// 

navRoot = document.getElementById("items");

for (i=0; i<navRoot.childNodes.length; i++) {
  node = navRoot.childNodes[i];
  
  //alert(node.nodeName);
  
  if (node.nodeName=="DIV") {
	  	  
  node.onmouseover=function() {
  this.className+=" over";
    }
  node.onmouseout=function() {
  this.className=this.className.replace
      (" over", "");
   }
   }
  }
 }
}


function initThumb(element, rollover, width, height) {
	
	var el = $(element);
	var ro = $(rollover);
	
	// Again we are able to create a morph instance
	var morph = new Fx.Morph(rollover, {duration:250});
	
	//alert('initialising');
		
	el.addEvent('mouseover', function(e) {
		
		e.stop();
		ro.morph({
			'height': height-10, 
			'width': width-10,
			'padding' : 5
		});	
	});
	
	el.addEvent('mouseout', function(e) {
		e.stop();
		// You need the same selector defined in the CSS-File
		ro.morph({
			'height': 0,
			'width': 0,
			'padding' : 0
		});	
	});
	
	/*
	
	// Or we just use Element.morph
	el.addEvent('mouseover', function(e) {
		e.stop();
		// Changes the element's style to .myClass defined in the CSS
		ro.morph('.item-info-on');
	});
	
	el.addEvent('mouseout', function(e) {
		e.stop();
		// You need the same selector defined in the CSS-File
		ro.morph('.item-info');
	});
	*/
};

window.onload=startList;
