// JavaScript Document
var mailing_defaults = {'First Name': 'First Name*','Last Name': 'Last Name*','Email': 'Email*'};

function clickclear(thisfield, defaulttext) {
	if(thisfield.value==defaulttext) thisfield.value = "";
}

function clickrecall(thisfield, defaulttext, color) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
		if (!color) {
			color = "cccccc";
		}
		thisfield.style.color = "#" + color;
	}
}

var heightmarker, content;

function setHeight()
{
	content.style.minHeight = "0px";
	var windowheight = window.innerHeight || document.body.clientHeight;
	var contentheight = windowheight - document.getElementById('header').clientHeight - document.getElementById('general_nav').clientHeight - document.getElementById('footer').clientHeight -45;
	var minheight = content.clientHeight;
	if(contentheight > minheight) content.style.height = contentheight +"px";

}

function setHeightInit()
{
	content = document.getElementById('maincontent'); 
	heightmarker = content.clientHeight;
	setHeight();
	var resize = document.all ? document.getElementById('container') : window;
	resize.onresize = setHeight;
}

function hiddenmenu(toggle){
	if (document.getElementById){
	var abra = document.getElementById(toggle).style;
		if (abra.display=="block"){
		abra.display = "none";
		}else{
		abra.display = "block";
		}
		return false;
	}else{
	return true;
	}
}

window.onload = function() 
{
	setHeightInit();
	
	
	var list = new Form('Mailinglist',{error: 'error2'});
	list.addRequired('first_name','last_name','email','00N700000025NO1');
	list.addFieldCheck('email','email');
	
	var brochure = new Form('brochure',{error: 'error3'});
	brochure.addRequired('00N700000025NQb','00N700000025NQq','first_name','last_name','email','00N700000025NO1','00N700000025NQv');
	brochure.addFieldCheck('00N700000025NQq','email');
	brochure.addFieldCheck('email2','email');
}