function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[name];
   	this.style = document.layers[name];
  }
}

function r(id) {
	for (var v=0;v<3;v++)
	{
		hideLayer('r'+v);
	}
  new getObj(id).style.display = "block";
}
function hideLayer(id) {
  new getObj(id).style.display = "none";
}

var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function validate()
{
	var ok=1;
	
	if (document.ct.firstname.value == "") { ok=0; }
	if (document.ct.lastname.value == "") { ok=0; }
	if (document.ct.email.value == "") { ok=0; }
	if (document.ct.phone.value == "") { ok=0; }
	if (document.ct.contactmethod.value == "") { ok=0; }
	if (document.ct.address1.value == "") { ok=0; }
	if (document.ct.citytown.value == "") { ok=0; }
	if (document.ct.postcode.value == "") { ok=0; }
	if (document.ct.enquiry.value == "") { ok=0; }
	
	if (ok==0) { alert("Please ensure all of the items marked with a * are filled out."); return false; }
	
	document.ct.submit();
	return true;
}
