function FormElements(className) {
	this.className = className;

	document.write('<style type="text/css">.checkbox-'+this.className+', .radio-'+this.className+' { width: 10px; height: 10px; margin: 0; background: #e4e4e4 url("img/pierdoly.png") no-repeat; display: inline-block; position: relative; top: 0px; margin-right: 7px; cursor: pointer; }</style>');
	document.write('<style type="text/css">input.'+this.className+' { display: none; }</style>');

	this.ReplaceRadio = function(classRadio) {
		if (!document.createElement) return false;
		
		var inputs = document.getElementsByTagName('input'); var span = new Array();
		for (i = 0; i < inputs.length; i++) {
			if ((inputs[i].type == 'radio') && (inputs[i].className == classRadio)) {
				inputs[i].className = this.className;
				span[i] = document.createElement('span');
				span[i].className = 'radio-'+this.className;
	
				if (inputs[i].checked) {
					span[i].style.backgroundPosition = '0px 0px';
					span[i].style.backgroundColor = '#c4c4c4';
				} else {
					span[i].style.backgroundPosition = '0px 0px';					
					span[i].style.backgroundColor = '#e4e4e4';
				}
				
				inputs[i].parentNode.insertBefore(span[i], inputs[i]);

				span[i].onclick = function() {
					var input = this.nextSibling;
					this.style.backgroundPosition = '0px 0px';
					this.style.backgroundColor = '#c4c4c4';
					input.click();
					
					var radio = document.getElementsByTagName('input');
					for (j = 0; j < radio.length; j++) {
						if ((radio[j].type == 'radio') && (radio[j].name == input.name) && (radio[j] != input)) {
							if (radio[j].previousSibling.className == this.className) {
								radio[j].previousSibling.style.backgroundPosition = '0px 0px';
								radio[j].previousSibling.style.backgroundColor = '#e4e4e4';
							}
						}
					}
				}
			}
		}
		return true;
	}
		
	this.ReplaceCheckbox = function(classCheckbox) {
		if (!document.createElement) return false;
		
		var inputs = document.getElementsByTagName('input'); var span = new Array();
		for (i = 0; i < inputs.length; i++) {
			if ((inputs[i].type == 'checkbox') && (inputs[i].className == classCheckbox)) {
				inputs[i].className = this.className;
				span[i] = document.createElement('span');
				span[i].className = 'checkbox-'+this.className;
					
				if (inputs[i].checked) {
					span[i].style.backgroundPosition = '-44px -10px';
					span[i].style.backgroundColor = '#c4c4c4';
				} else {
					span[i].style.backgroundPosition = '-32px -10px';					
					span[i].style.backgroundColor = '#e4e4e4';
				}
					
				inputs[i].parentNode.insertBefore(span[i], inputs[i]);
					
				span[i].onclick = function() {
					var input = this.nextSibling;
					if (input.disabled) {
						return;
					}
					if (input.checked) {
						this.style.backgroundPosition = '-32px -10px';
						this.style.backgroundColor = '#e4e4e4';
						input.click();
					} else {
						this.style.backgroundPosition = '-44px -10px';
						this.style.backgroundColor = '#c4c4c4';
						input.click();
					}
				}
			}
		}
		return true;
	}
		
	return true;
}
