<!--
// DHTML Menu - code courtesy of Peter-Paul Koch, (http://www.quirksmode.org)
// Respect.
var remember = new Array();
var remember2 = new Array();
var closeIt;
var DHTML = (document.getElementById || document.all || document.layers);

function show(name,lvl,obj)
{
	if (!DHTML) return;
	if (closeIt) clearTimeout(closeIt);
	if (remember[lvl] && remember[lvl] == name) return;
	if (remember[lvl])
	{
		closeAll(lvl);
	}
	if (name)
	{
		var x = getObj(name);
		x.visibility = 'visible';
	}
	remember[lvl] = name;
	if (obj.parentNode) y = obj.parentNode;
	else if (obj.parentElement) y = obj.parentElement;
	else return;
	if (y.className) return;
	y.className = 'over';
	if (remember2[lvl]) remember2[lvl].className = '';
	remember2[lvl] = y;
}

function closeAll(lvl)
{
	for (i=remember.length - 1;i>=lvl;i--)
	{
		if (remember[i])
		{
			var x = getObj(remember[i]);
			x.visibility = 'hidden';
		}
		remember[i] = null;
		if (remember2[i])
		{
			remember2[i].className = '';
			remember2[i] = null;
		}
	}
}

function closeDelay()
{
	if (closeIt) clearTimeout(closeIt);
	closeIt = setTimeout('closeAll(1)',1000);
}

function getObj(name)
{
  if (document.getElementById)
  {
    return document.getElementById(name).style;
  }
  else if (document.all)
  {
    return document.all[name].style;
  }
  else if (document.layers)
  {
    return document.layers[name];
  }
  else return false;
}


// Image Mouseover - code courtesy of Peter-Paul Koch, (http://www.xs4all.nl/~ppk)
var nrm = new Array();
var omo = new Array();
var swaps = new Array('wasteminz','nzwwa','chamber');

if (document.images)
{
	for (i=0;i<swaps.length;i++)
	{
		nrm[i] = new Image;
		nrm[i].src = 'graphics/' + swaps[i] + ".gif"
		omo[i] = new Image;
		omo[i].src = 'graphics/' + swaps[i] + "_over.gif";
	}
}

function over(no)
{
	if (document.images)
	{
		document.images[swaps[no]].src = omo[no].src
	}
}

function out(no)
{
	if (document.images)
	{
		document.images[swaps[no]].src = nrm[no].src
	}
}


// Random Header Image
function randomHeaderImg()
{
	images = new Array(5);
	images[0] = "<a href = 'kiwiclean_plunket.html'><img src='graphics/charity_logo.gif' width='157' height='89' border='0' alt='Kiwiclean proudly sponsors Plunket'></a>";
	images[1] = "<a href = 'kiwiclean_company.html'><img src='graphics/new_zealand.gif' width='157' height='89' border='0' alt='Proudly 100% New Zealand owned and operated'></a>";
	images[2] = "<img src='graphics/testimonial_01.gif' width='180' height='100' hspace='10'>";
	images[3] = "<img src='graphics/testimonial_02.gif' width='180' height='100' hspace='10'>";
	images[4] = "<img src='graphics/testimonial_03.gif' width='180' height='100' hspace='10'>";
	images[5] = "<img src='graphics/testimonial_04.gif' width='180' height='100' hspace='10'>";
	index = Math.floor(Math.random() * images.length);
	document.write(images[index] + "\n");
}


// Select Menu
function goto_URL(object)
{
	if (object.options[object.selectedIndex].value != "null")
	{
		window.location.href = object.options[object.selectedIndex].value;
	}
}


// Image Pop-up
function popup(width,height,location)
{
	x = (640 - width)/2, y = (480 - height)/2;
    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
	newwindow=window.open('about:blank','popWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,copyhistory=no,width=' + width + ',height=' + height + ',screenX=' + x + ',screenY=' + y + ',top=' + y + ',left=' + x + ',scrollbars=no,resize=no');
	var content=""+
	"<html><head><title>Astec Projects</title></head>"+
	"<body bgcolor=\"#FFFFFF\" marginwidth=\"0\" marginheight=\"0\" leftmargin=\"0\" topmargin=\"0\" onBlur=\"self.close();\">"+
	"<img src=\"" + location + "\">"+
	"</body></html>";
	newwindow.document.open();
	newwindow.document.write(content);
	newwindow.document.close();
	if (window.focus) {newwindow.focus()}
}

// Email Address Validation (Forms)
function validate(obj){
  field = obj.value;

  with (field) {
    apos=indexOf("@");
	dotpos=lastIndexOf(".");
	lastpos=length-1;
	if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2) {
	  alert("Invalid Email Address format!");
	  obj.focus();
	  return (false);
	} else {
	  return true;
	}
  }
}
// -->

