Event.observe(window, 'load',
	function() {
		Element.observe('demosoftware', 'click', switchSerialNumber);
		Element.observe('nicelabeledition_other', 'click', addRemoveOtherTextField);
		
		// Add display to none nicelabeledition_other
		document.getElementById('requestSupportForm_w6').style.display = 'none';
	}
);

function switchSerialNumber() {	
	// Add demo value to serial if there is an empty one to pass validation
	if (document.getElementById('demosoftware').checked === true) {
		Element.addClassName('requestSupportForm_w10', 'hidden');
		if (document.getElementById('demosoftware').value != '') {
			document.getElementById('keynumber').value = 'DEMO';
		}
	} else {
		Element.removeClassName('requestSupportForm_w10', 'hidden');
	}
}

function addRemoveOtherTextField() {	
	// Add text input field if smb checked other checkbox in nice label edition list
	var chkElement = document.getElementById('nicelabeledition_other');
	var inpElement = document.getElementById('requestSupportForm_w6');
	
	if (chkElement.checked === true) {
		inpElement.style.display = '';
	} else {
		inpElement.style.display = 'none';
	}
}