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

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

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

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

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

	Widget.GetObjectByName("pp").visible = ( enabled && (state=="pp"));
	Widget.GetObjectByName("pn").visible = ( enabled && (state=="pn"));
	Widget.GetObjectByName("np").visible = ( enabled && (state=="np"));
	Widget.GetObjectByName("nn").visible = ( enabled && (state=="nn"));

	Widget.GetObjectByName("disabled").visible  = (!enabled);
}

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

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