/*!
**********************************************************************
@file WizardCheckBox1.js

Copyright 2003-2008 Adobe Systems Incorporated.                     
All Rights Reserved.                                                
                                                                    
NOTICE: All information contained herein is the property of Adobe   
Systems Incorporated.                                                                                                                    

***********************************************************************
*/
/**
WizardCheckBox1 widget for handling image based checkbox
*/

function WizardCheckBox1(inId, inClName, addToContainer, inState, onClickFunc)
{
	this.base=WizardImage1;
	
	this.base(kImgCheckBoxOff, inId, inClName, addToContainer, onClickFunc, null, null, true);
	//this.prototype = new WizardImage1(kImgCheckBoxOff, inId, inClName, addToContainer, onClickFunc);
	
	//default state
	if(inState)//should be on
	{
		this.SetSrc(kImgCheckBoxOn);
	}
	else//should be off
	{
		this.SetSrc(kImgCheckBoxOff);
	}
}

//WizardCheckBox1.prototype = new WizardImage1;
WizardCheckBox1.prototype = WizardImage1.prototype;

WizardCheckBox1.prototype.SetChecked = function(inState)
{
    if(inState)//should be on
	{
		this.SetSrc(kImgCheckBoxOn);
	}
	else//should be off
	{
		this.SetSrc(kImgCheckBoxOff);
	}
}

WizardCheckBox1.prototype.GetChecked = function()
{
	if(this.GetSrc().indexOf(kImgCheckBoxOn) != -1)
		return true;
	else
		return false;
}

//toggle for a set of radio buttons means, whatever radiobutton was clicked will be checked, rest all will be unchecked.
//theres no toggle defined for a single radiobutton.
//IMPORANT ::
//toggle for a single checkbox is reverse the checked/unchecked state of itself.
//accordingly, theres a toggleR for WizardRadioButtonSet1 and toggleC for WizardCheckBox1
WizardCheckBox1.prototype.toggleC = function()
{
	if(this.GetSrc().indexOf(kImgCheckBoxOn) != -1)
		this.SetChecked(false);
	else
		this.SetChecked(true);
}

WizardCheckBox1.prototype.toggleC = function()
{
	if(this.GetSrc().indexOf(kImgCheckBoxOn) != -1)
		this.SetChecked(false);
	else
		this.SetChecked(true);
}

WizardCheckBox1.prototype.DisableCheckBox = function()
{
	this.SetSrc(kImgCheckBoxDisabledOn);
}

