var StateHide = 1;
var StateUp = 2;
var StateDown = 4;
var StateOver = 8;
var StateDisabled = 16;

var typeButton = 0;
var typePlaceholder = 1;
var typeSlider = 2;
var typeInfoDisplay = 3;

function OnInitialize()
{
	if(Metamorphis.LoadSkinState() == false)
	{
		var x = Player.Left;
		var y = Player.Top;		
		
	   	EQCrescent.SetWindowPos(x + 160, y + 186);
	   	EQCrescent.ShowWindow(true);
	   	
	   	PlayListCrescent.SetWindowPos(x - 25, y + 11);
	   	PlayListCrescent.ShowWindow(true);
	   	
	   	VisBg.SetWindowPos(x - 165, y + 261);
	   	VisBg.ShowWindow(false);	
	}
}


function OnExit()
{
	Metamorphis.SaveSkinState();
}


function OnToggleEq()
{
	var x = Player.Left;
	var y = Player.Top;
	
	if(EQCrescent.Top > y + 186) {
		EQ.ShowWindow(false);
		EQCrescent.MoveWindowAnimated(0, -193, 2);	
	} else {
		EQCrescent.MoveWindowAnimated(0, 193, 2);
		EQ.SetWindowPos(x + 160, y + 235);
		EQ.ShowWindow(true);
	}
}


function OnToggleVisualization()
{		
	var x = Player.Left;
	var y = Player.Top;
	
	if(VisBg.Top > y + 186) {
		VisBg.ShowWindow(true);
		VisBg.MoveWindowAnimated(0, -75, 1);
		Visualization.SetWindowPos(x - 140, y + 208);
	   	Visualization.ShowWindow(true);		
		
	} else {
		Visualization.ShowWindow(false);
		VisBg.MoveWindowAnimated(0, 75, 1);
		VisBg.ShowWindow(false);
	}

}

function OnTogglePlaylist()
{		
	var x = Player.Left;
	var y = Player.Top;
	
	if(PlayListCrescent.Left < x - 30) {
		PlayList.ShowWindow(false);
		PlayListCrescent.MoveWindowAnimated(435, 0, 3);
	} else {
		PlayListCrescent.MoveWindowAnimated(-435, 0, 3);
		PlayList.SetWindowPos(x - 435, y + 11);
	   	PlayList.ShowWindow(true);
	}

}
