standardFont = "fonts/bernhardModBT.mvec";
-- "fonts/arial.mvec";

--lithosFont = "fonts/lithos.mvec";
arialFont = "fonts/arial.mvec"
lithosFont = "fonts/arial.mvec"
papyrFont = "fonts/papyr.mvec";
letter_font = "fonts/Bradley_Hand_ITC.mvec"

BlackColor = Color(0,0,0,255);
PopupTextColor = Color(247,223,62,255);
BlueColor = Color(77,115,178,255);
DarkBlueColor = Color(40,60,120,255);
WhiteColor = Color(255,255,255,255);
MMButtonFontColor = Color(255,255,255,255);
GameHintColor = Color(255,255,0,255);

StandardButtonGraphics = {
	"buttons/buttonup",
	"buttons/buttondown",
	"buttons/buttonrollover"
};

MMButtonGraphics = {
	"buttons/mmbutton_n",
	"buttons/mmbutton_d",
	"buttons/mmbutton_o"
};

HintButtonGraphics = {
	"buttons/buthint1",
	"buttons/buthint2",
	"buttons/buthint1",
	"buttons/buthint2",
};


StartButtonGraphics = {
	"buttons/mmbutplay_n",
	"buttons/mmbutplay_d",
	"buttons/mmbutplay_o"
};

CheckboxButtonGraphics = {
	"buttons/checkup",
	"buttons/checkdown",
	"buttons/checkover",
	"buttons/checkdownover"
};

StandardButtonFont = {
  standardFont,
  18,
  BlackColor
};



GameHintFont = {
  standardFont,
  22,
  GameHintColor
};

MMButtonFont = {
  lithosFont,
  28,
  MMButtonFontColor
};

DialogTitleFont = {
  standardFont,
  20,
  BlackColor
};

DialogBodyFont = {
  standardFont,
  30,
  PopupTextColor
};

DefaultStyle = {
	font=DialogBodyFont
};

DialogTitleText = {
	parent=DefaultStyle,
	font = DialogTitleFont,
	flags = kVAlignCenter + kHAlignLeft,
	x=16,y=12,w=kMax,h=30
};

DialogBodyText = {
	parent=DefaultStyle,
	font = DialogBodyFont,
	flags = kVAlignCenter + kHAlignCenter,
	x=30,y=26,w=kMax-30,h=kMax-100
};


kDefaultButtonSound="audio/sfx/button_click.ogg";

MMButtonStyle = {
	parent = DefaultStyle,
	font = MMButtonFont,
	sound = kDefaultButtonSound,
	graphics = MMButtonGraphics,
	flags = kVAlignCenter + kHAlignCenter,
};

StartButtonStyle = {
	parent = ButtonStyle,
	font = MMButtonFont,
	graphics = StartButtonGraphics,
	flags = kVAlignCenter + kHAlignCenter,
};


WelcomeButtonStyle = {
	parent = DefaultStyle,
	font = StandardButtonFont,
	sound = kDefaultButtonSound,
	--graphics = {},
	w=300, h=40
};

ButtonStyle = {
	parent = DefaultStyle,
	font = StandardButtonFont,
	sound = kDefaultButtonSound,
	type= kPush,
	graphics = StandardButtonGraphics,
};


CheckboxButtonStyle = {
	parent = DefaultStyle,
	font = StandardButtonFont,
	type = kToggle,
	sound = kDefaultButtonSound,
	graphics = CheckboxButtonGraphics,
};

SetDefaultStyle(DefaultStyle);

-- Create a TButton with a label
--
-- We're overriding the default "Button" here with
-- some custom behavior. Specifically, we're layering
-- a Text{} object on top of every button, and it's placed
-- on all layers (up, down, roll-over).

-- Create several bits of text that combine to make a blended shadow
function ColorShadowText( x,y,size, label, color )

	return Group(
		{
		-- Add these traits to the current style
			AppendStyle{ x=x, y=y, w=kMax, h=kMax, label=label },
			--AppendStyle{ font = { standardFont, size, Color(0,0,0,40)} },
			--Text{ y=y+4 },
			--AppendStyle{ font = { standardFont, size, Color(0,0,0,255)} },
			--Text{ y=y+2 },
			AppendStyle{ font = { standardFont, size, color } } ,
			Text{},
		}
	)
end

function ColorTextAdd( size, label, color )

	return Group(
		{
		-- Add these traits to the current style
			AppendStyle{ x=0, y=0, w=kMax, h=kMax, label=label },
			AppendStyle{ font = { standardFont, size, color }},
			Text{},
		}
	)
end

kMenuButtonFontSize = 16;

function MenuButtonLabel( label, color, colorHighlight )

	if not color then
		color =Color(0,0,0,255);	-- the default colors
		colorHighlight=Color(255,255,255,255)
	end

	return Group{
		SelectLayer(0),
		ColorShadowText(5,8,kMenuButtonFontSize, label, color ),
		SelectLayer(1),
		ColorShadowText(5,8,kMenuButtonFontSize, label, colorHighlight ),
		SelectLayer(2),
		ColorShadowText(5,8,kMenuButtonFontSize, label, colorHighlight )
	}
end

function MenuButtonLabelAdd( label )

	color =Color(0,0,0,255);	-- the default colors
	colorHighlight=Color(255,255,255,255)

	return Group{
		SelectLayer(0),
		ColorTextAdd(kMenuButtonFontSize, label, color ),
		SelectLayer(1),
		ColorTextAdd(kMenuButtonFontSize, label, colorHighlight ),
		SelectLayer(2),
		ColorTextAdd(kMenuButtonFontSize, label, colorHighlight )
	}

end

-- Create a more limited-use button type here; the label is defined inline
-- with MenuButtonLabel above
function MenuButton( button )
	return function()
		-- Type name of window to create; in our case, "Button".
		-- If you want to create a derived button type, you can do that here.
		button.typename='Button';
		DoWindow( button )
	end
end

gScriptAfterComis = "";
gScriptBeforeComis = "";

function  GoToComics(scriptFrom, scriptTo, nameWinFrom, comicsName)
	gScriptBeforeComis = scriptFrom;
	gScriptAfterComis = scriptTo;
	SetNameComicsToRun(comicsName);
	if(not(StartSoundFade == nil)) then StartSoundFade(); end
	CSWithSh(nameWinFrom, "scripts/comics.lua");
	DoModal("scripts/shadow.lua");
end

function  GoToComicsFin(scriptFrom, scriptTo, nameWinFrom, comicsName)
	gScriptBeforeComis = scriptFrom;
	gScriptAfterComis = scriptTo;
	SetNameComicsToRun(comicsName);
	if(not(StartSoundFade == nil)) then StartSoundFade(); end
	CSWithSh(nameWinFrom, "scripts/comicsfin.lua");
	DoModal("scripts/shadow.lua");
end

MenuButtonStyle = {
	parent = DefaultStyle,
	font = MenuButtonFont,
	sound = kDefaultButtonSound,
	graphics = {},
	flags = kHAlignCenter + kVAlignCenter,
};

function  DoStartSplash()
	DisplaySplash  ( "anim/playfirst_animated_logo.swf", "comicspicts/intro_image_2", 4 ) ;
--	CSWithSh("MainMenu", "scripts/prmap.lua");
--	DoModal("scripts/shadow.lua");
--	DoModal("scripts/prmap.lua");
end


gIsFemaleChoosen = 1;

gCurrMiniGameName = "";
gCurrMGameText = "";

--kIllegalNameChars = "!@#$%^&*()><\\\"\'[]{}|?/+=~`.,;:-";
kIllegalNameChars = "";

