
window.onload = function()
{
	var W3CDOM = (document.createElement && document.getElementsByTagName);
	if (!W3CDOM) return;

	fdrhandle = document.getElementById("apps");
	
	if(fdrhandle.addEventListener) 
	{
		document.getElementById("moffer").addEventListener("mouseover",mfadeoff,false);
	  	document.getElementById("banner").addEventListener("mouseover",mfadeoff,false);
	  	document.getElementById("apphldr").addEventListener("mouseover",mfadeon,false);
	  	document.getElementById("apps").addEventListener("mouseover",bigon,false);
	  	document.getElementById("apphldr").addEventListener("mouseout",mfadeoff,false);
	  	document.getElementById("apps").addEventListener("mouseout",mfadeoff,false);
	  	document.getElementById("apphldr").nextSibling.addEventListener("mouseover",mfadeoff,false);
	  	document.getElementById("apphldr").previousSibling.addEventListener("mouseover",mfadeoff,false);
	  	document.getElementById("apphldr").nextSibling.addEventListener("mouseout",mfadeoff,false);
	  	document.getElementById("apphldr").previousSibling.addEventListener("mouseout",mfadeoff,false);
	  	var arr = document.getElementById("meacol").getElementsByTagName("a");
	  	assignitmoz(arr);
	  	var arr = document.getElementById("leacol").getElementsByTagName("a");
	  	assignitmoz(arr);
	  	var arr = document.getElementById("compcol").getElementsByTagName("a");
	  	assignitmoz(arr);
	}
	else if(fdrhandle.attachEvent)
	{
	  	document.getElementById("banner").attachEvent("onmouseover",mfadeoff);
	  	document.getElementById("apphldr").attachEvent("onmouseover",mfadeon);
	  	document.getElementById("apps").attachEvent("onmouseover",bigon);
	  	document.getElementById("apphldr").attachEvent("onmouseout",mfadeoff);
	  	document.getElementById("apps").attachEvent("onmouseout",mfadeoff);
	  	document.getElementById("apphldr").nextSibling.attachEvent("onmouseover",mfadeoff);
	  	document.getElementById("apphldr").previousSibling.attachEvent("onmouseover",mfadeoff);
	  	document.getElementById("apphldr").nextSibling.attachEvent("onmouseout",mfadeoff);
	  	document.getElementById("apphldr").previousSibling.attachEvent("onmouseout",mfadeoff);
	  	document.getElementById("moffer").attachEvent("onmouseover",mfadeoff);
	  	var arr = document.getElementById("meacol").getElementsByTagName("a");
		assignitie(arr);
		var arr = document.getElementById("leacol").getElementsByTagName("a");
		assignitie(arr);
		var arr = document.getElementById("compcol").getElementsByTagName("a");
		assignitie(arr);
	}
	
	var leachaterotation = new Rotimg("leahol");

leachaterotation.addimg('rotimg/gremi0.png');
	leachaterotation.addcap("Gremista");
leachaterotation.addimg('rotimg/pils1.png');
	leachaterotation.addcap("Pilsworth");
leachaterotation.addimg('rotimg/gremi1.png');
	leachaterotation.addcap("Gremista");
leachaterotation.addimg('rotimg/pils2.png');
	leachaterotation.addcap("Pilsworth");
leachaterotation.addimg('rotimg/gremi2.png');
	leachaterotation.addcap("Gremista");
leachaterotation.addimg('rotimg/pils3.png');
	leachaterotation.addcap("Pilsworth");
leachaterotation.addimg('rotimg/gremi3.png');
	leachaterotation.addcap("Gremista");
leachaterotation.addimg('rotimg/pils4.png');
	leachaterotation.addcap("Pilsworth");
leachaterotation.addimg('rotimg/gremi4.png');
	leachaterotation.addcap("Gremista");
leachaterotation.addimg('rotimg/pils5.png');
	leachaterotation.addcap("Pilsworth");
leachaterotation.addimg('rotimg/gremi5.png');
	leachaterotation.addcap("Gremista");

leachaterotation.randomtail();

	leachaterotation.insert("Leachate Treatment");
	
	var compostrotation = new Rotimg("comphol");
		
compostrotation.addimg("rotimg/drdk0.png");
	compostrotation.addcap("Deerdykes");
compostrotation.addimg("rotimg/bedd1.png");
	compostrotation.addcap("Beddington");
compostrotation.addimg("rotimg/drdk1.png");
	compostrotation.addcap("Deerdykes");
compostrotation.addimg("rotimg/bedd2.png");
	compostrotation.addcap("Beddington");
compostrotation.addimg("rotimg/drdk2.png");
	compostrotation.addcap("Deerdykes");
compostrotation.addimg("rotimg/bedd3.png");
	compostrotation.addcap("Beddington");
compostrotation.addimg("rotimg/drdk3.png");
	compostrotation.addcap("Deerdykes");
compostrotation.addimg("rotimg/bedd4.png");
	compostrotation.addcap("Beddington");

compostrotation.randomtail();

	compostrotation.insert("Composting");
	
	var meathanerotation = new Rotimg("meahol");
		
		
	meathanerotation.addimg("rotimg/midg0.png");
meathanerotation.addcap("Midgeland");
	meathanerotation.addimg("rotimg/ambr1.png");
meathanerotation.addcap("Amberswood");
	meathanerotation.addimg("rotimg/midg1.png");
meathanerotation.addcap("Midgeland");
	meathanerotation.addimg("rotimg/midg2.png");
meathanerotation.addcap("Midgeland");
	meathanerotation.addimg("rotimg/midg3.png");
meathanerotation.addcap("Midgeland");
	
meathanerotation.randomtail();
		
meathanerotation.insert("Meathane Stripping");

	leachaterotation.startin(10,0);
	compostrotation.startin(2510,1);
	meathanerotation.startin(5010,2);
};

function openit(e)
{
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	var it = targ.getAttribute("href");
	window.open(it,'_blank','scrollbars=no,menubar=no,height=240,width=320,resizable=no,toolbar=no,location=no,status=no');
	return false;
}

function assignitie(arr)
{
	for(x in arr)
	{
		if(arr[x].className == "vidop")
		{
			arr[x].attachEvent("onclick",openit);
		}
  	}
}

function assignitmoz(arr)
{
	for(x in arr)
	{
		if(arr[x].className == "vidop")
		{
			arr[x].addEventListener("click",openit,false);
		}
	}
}
