
// --------------------------------------------JavaScript CheckBox class-------------------------

function CheckBox(htmlCheckBox)
{		
		
	this.inheritFrom = HTMLObject;
	this.inheritFrom(htmlCheckBox);
	
	this.SetValue=CheckBox_SetValue;
	this._obj.checked=false;
		
	this._checkBoxValue = document.createElement("input");
	this._checkBoxValue.type = "hidden";
	this._checkBoxValue.name = this._obj.name;// + '_chkValue';
	this._checkBoxValue.id = this._obj.id;// + '_chkValue';
	this._checkBoxValue.value = '0';
	
	this._obj.form.appendChild(this._checkBoxValue);
	this._obj.name=this._obj.name + '_temp';
	this._obj.id=this._obj.id + '_temp';
		
	this.AddEventListener('focus',this.Style_GotFocus);
	this.AddEventListener('blur',this.Style_LostFocus);
	this.AddEventListener('click',this.InternalClick);		
}
CheckBox.prototype._checkBoxValue;

CheckBox.prototype.InternalClick = function(oEvent)
{		
	var obj=window.event?oEvent.srcElement:this;	
	obj._obj._checkBoxValue.value=obj.checked?'1':'0';
}
function CheckBox_SetValue(value)
{
	var chkValue=value==true || value==1?true:false;
	var hValue=value==true || value==1?1:0;
	/*
	alert('CHKVALUE=' + chkValue);
	alert('VALUE=' + value);
	*/
	this._obj.checked=chkValue;
	this._checkBoxValue.value=hValue;
}

// --------------------------------------------JavaScript CheckBox class End-------------------------
