window.onload=function() {
	if (document.getElementById('domaintypeform')){
		var selectButton = document.getElementById('select-all');
		var resetButton = document.getElementById('reset-all');
		var theForm = document.getElementById('domaintypeform');
		var theInputs = theForm.getElementsByTagName('input');
		var whatToday = document.getElementById('what-today');
		var domainLoader = document.getElementById('domain-loader');
	
	selectButton.onclick = function() {
		if(theInputs){
			for (i=0;i<theInputs.length;i++) {
				currentInput = theInputs[i];
				if ((currentInput.getAttribute('type') == 'checkbox') && currentInput.checked != true){
					currentInput.checked = true;
				}
			}
			return false;
		}
	}
	resetButton.onclick = function() {
		if(theInputs){
			for (i=0;i<theInputs.length;i++) {
				currentInput = theInputs[i];
				if ((currentInput.getAttribute('type') == 'checkbox') && currentInput.checked != false){
					currentInput.checked = false;
				}
			}
			return false;
		}
	}
	if(whatToday){
		whatToday.onchange = function() {
			if (this.value != ''){
				location.href = this.value;	
			}
		}
	}
	if(theInputs){
		for (i=0;i<theInputs.length;i++){
			currentInput = theInputs[i];
			if (currentInput.getAttribute('type') == 'submit') {
				currentInput.onclick = function() {
					this.value = 'Please wait while processing...';
						this.style.display = 'none';
						domainLoader.style.display = 'inline';
				}
			}
		}
	}
	}
}

