/*============================================================================*/
/*                   Copyright (c) 2007 Adobe Systems Inc.                    */
/*                            All rights reserved.                            */
/*============================================================================*/

function setDefaultValues()
{
	var currValues = new Array();

	currValues.push({ name:"State",   type:"ComboBox", value:"Normal,Normal,Press" });
	currValues.push({ name:"enabled", type:"Boolean",  value:"true"                });
	currValues.push({ name:"label",   type:"Text",     value:"Label"               });

	Widget.elem.customData["currentValues"] = currValues;
}

function applyCurrentValues()
{
	var vals    = Widget.elem.customData["currentValues"];
	var state   = vals[0].value.split(",")[0].toString();
	var enabled = (vals[1].value.toString()=="true");

	Widget.GetObjectByName("normal").visible   = ( enabled && (state=="Normal"));
	Widget.GetObjectByName("press").visible    = ( enabled && (state=="Press" ));
	Widget.GetObjectByName("disabled").visible = (!enabled);
	Widget.GetObjectByName("label").textChars  = vals[2].value;
}

switch (Widget.opCode)
{
	case 1: setDefaultValues();   break;
	case 2: applyCurrentValues(); break;
}

/*============================================================================*/
/*                   Copyright (c) 2007 Adobe Systems Inc.                    */
/*                            All rights reserved.                            */
/*============================================================================*/