ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

function initialize() {
	chkF  = new checkBox('myForm1','chkFImg','YES - my interest','');
	chkL = new checkBox('myForm1','chkLImg','YES - my interest','');
	chkN = new checkBox('myForm1','chkNImg','YES - my interest','');
	chkG = new checkBox('myForm1','chkGImg','YES - my interest','');
}

function loadImage(imgObj,imgSrc) {
	eval(imgObj+' = new Image()');
	eval(imgObj+'.src = "'+imgSrc+'"');
}

loadImage('checkbox0','img/off.gif');
loadImage('checkbox1','img/on.gif');
loadImage('submit0','img/btn_submit1_off.gif');
loadImage('submit1','img/btn_submit1_on.gif');

function changeImage(layer,imgName,imgObj) {
	if (ns4 && layer!=null) eval('document.'+layer+'.document.images["'+imgName+'"].src = '+imgObj+'.src');
	else document.images[imgName].src = eval(imgObj+".src");
}

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);
}
