<form id="f" action="" method="get">
	<fieldset>
	<legend>Exemplo usando <a href="/classes/preloader">Preloader</a></legend>
	<div style="float: left">
	<label for="c1">Check 1</label> <input type="checkbox" title="Teste title" id="c1" name="c" value="check_1" />
	<label for="c2">Check 2</label> <input type="checkbox" checked="checked" id="c2" name="c" value="check_2" />
	<label for="c3">Check 3</label> <input type="checkbox" id="c3" name="c" value="check_3" />
	</div>
	<div style="float: left; margin-left: 80px;">
	<label for="r1">Radio 1</label> <input type="radio" id="r1" name="r" value="radio_1" />
	<label for="r2">Radio 2</label> <input type="radio" id="r2" name="r" value="radio_2" />
	<label for="r3">Radio 3</label> <input type="radio" id="r3" checked="checked" name="r" value="radio_3" />
	</div>
	<br style="clear: both;" />
	<input type="submit" value="Post" />
	<input type="reset" value="Reset" />
	<input type="button" value="JS Check Boxes" name="cAll" />
	<input type="button" value="JS Uncheck Boxes" name="uAll" />
	<span id="msg" style="background: #D00; color: #FFF; font: bold 11px verdana;">Loading images...</span>
	</fieldset>
</form>
<script type="text/javascript" src="/js/preloader.js"></script>
<script type="text/javascript">
//<![CDATA[

var box = new FormStyle("f"), rad = new FormStyle("f");

box.unchecked({
	initial: "/etc/boxU.gif",
	over: "/etc/boxUH.gif",
	click: "/etc/boxUC.gif"
});
box.checked({
	initial: "/etc/boxC.gif",
	over: "/etc/boxCH.gif",
	click: "/etc/boxCC.gif"
});
rad.unchecked({
	initial: "/etc/rdU.gif",
	over: "/etc/rdUC.gif"
});
rad.checked({
	initial: "/etc/rdC.gif",
	over: "/etc/rdCC.gif"
});


var p = new Preloader();
var i, l = (i = ["boxU", "boxUH", "boxUC", "boxC", "boxCH", "boxCC", "rdU", "rdUC", "rdC", "rdCC"]).length;
while(l--) p.add("/etc/" + i[l] + ".gif");
p.onComplete = function(){
	document.getElementById("msg").style.display = "none";
	box.apply("c"), rad.apply("r");

	addEvent(document.forms.f.cAll, "click", function(){
		for(var f, l = (f = this.form.c).length; l--;)
			box.check(f[l]);
	});
	addEvent(document.forms.f.uAll, "click", function(){
		for(var f, l = (f = this.form.c).length; l--;)
			box.uncheck(f[l]);
	});
}
p.load();

//]]>
</script>