//funciones que permiten la creación de bullets
function Radio(layer,imgNames,length,defaultValue) {
	this.layer = layer
	this.imgNames = imgNames
	this.length = length
	this.change = RadioChange
	this.value = (defaultValue)? defaultValue : "undefined"
}
function RadioChange(index,value) {
	this.value = value
	for (var i=0; i<this.length; i++)
		changeImage(this.layer,this.imgNames+i,'radio0')
	changeImage(this.layer,this.imgNames+index,'radio1')
}

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) {
		
		
		if (document.layers && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src')
		else document.images[imgName].src = eval(imgObj+".src")
	}
}



