function CheckBox(layer,imgName,trueValue,falseValue,defaultToTrue) {
	this.layer = layer
	this.imgName = imgName
	this.trueValue = trueValue
	this.falseValue = falseValue
	this.state = (defaultToTrue) ? 1 : 0
	this.value = (this.state) ? this.trueValue : this.falseValue
	this.change = CheckBoxChange
}
function CheckBoxChange() {
	this.state = (this.state) ? 0 : 1
	this.value = (this.state) ? this.trueValue : this.falseValue
	changeImage(this.layer,this.imgName,'checkbox'+this.state)
}

function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}
function changeImage(layer,imgName,imgObj) {

	if (document.images) {document.images[imgName].src = eval(imgObj+".src")}
}
function ve(e){
ind=e.indexOf('\@');return (ind>0 && ind<s.length-1?true:false);
}
function tr(obj){
s=obj.value;
re=/^\s+/;s=s.replace(re, '');
re=/\s+$/;s=s.replace(re, '');
obj.value=s;return s;
}

