'##############
'Tablet Script
'##############

'Revision History:
'- Ondrej Slucik	30.10.2013	Pocatky Tabletu	

'--------------------------------------------------------------




{trigger:TabBack}
	0 (S.L.TabWeb01Visible) 
	0 (S.L.TabWeb02Visible) 
	0 (S.L.TabWeb03Visible) 
	0 (S.L.TabCamVisible)
 	0 (S.L.BodyVisible) 
{end}

{trigger:TabBrowser}
	1 (S.L.TabWeb01Visible)
	1 (S.L.BodyVisible)
{end}

{trigger:TabCamera}
	1 (S.L.TabCamVisible) 
{end}

{trigger:TabWeather}
	1 (S.L.TabWeatherVisible) 
{end}

{trigger:TabVisible}
	(L.L.TabVisible) ! (S.L.TabVisible)
{end}

{trigger:TW_to1}
	1 (S.L.TabWeb01Visible)
	0 (S.L.TabWeb02Visible)
{end}

{trigger:TW_to2}
	0 (S.L.TabWeb01Visible)
	1 (S.L.TabWeb02Visible)
{end}

{trigger:TW_to2p}
	0 (S.L.TabWeb03Visible)
	1 (S.L.TabWeb02Visible)
{end}

{trigger:TW_to3}
	0 (S.L.TabWeb02Visible)
	1 (S.L.TabWeb03Visible)
{end}

{trigger:Tod_W01_Buy}
	(L.L.BodyCount) 49 >
	{if}
		1 (S.L.Tod_W01_Buy)
		(L.L.BodyCount) 50 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_W02_Buy}
	(L.L.BodyCount) 49 >
	{if}
		1 (S.L.Tod_W02_Buy)
		(L.L.BodyCount) 50 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_W03_Buy}
	(L.L.BodyCount) 49 >
	{if}
		1 (S.L.Tod_W03_Buy)
		(L.L.BodyCount) 50 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_W04_Buy}
	(L.L.BodyCount) 49 >
	{if}
		1 (S.L.Tod_W04_Buy)
		(L.L.BodyCount) 50 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_W05_Buy}
	(L.L.BodyCount) 49 >
	{if}
		1 (S.L.Tod_W05_Buy)
		(L.L.BodyCount) 50 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Ext1_Buy}
	(L.L.BodyCount) 119 >
	{if}
		1 (S.L.Tod_Ext1_Buy)
		(L.L.BodyCount) 120 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Ext2_Buy}
	(L.L.BodyCount) 174 >
	{if}
		1 (S.L.Tod_Ext2_Buy)
		(L.L.BodyCount) 175 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Ext3_Buy}
	(L.L.BodyCount) 349 >
	{if}
		1 (S.L.Tod_Ext3_Buy)
		(L.L.BodyCount) 350 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Ext4_Buy}
	(L.L.BodyCount) 89 >
	{if}
		1 (S.L.Tod_Ext4_Buy)
		(L.L.BodyCount) 90 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Int1_Buy}
	(L.L.BodyCount) 149 >
	{if}
		1 (S.L.Tod_Int1_Buy)
		(L.L.BodyCount) 150 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Int2_Buy}
	(L.L.BodyCount) 199 >
	{if}
		1 (S.L.Tod_Int2_Buy)
		(L.L.BodyCount) 200 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Int3_Buy}
	(L.L.BodyCount) 349 >
	{if}
		1 (S.L.Tod_Int3_Buy)
		(L.L.BodyCount) 350 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Int4_Buy}
	(L.L.BodyCount) 0 >
	{if}
		1 (S.L.Tod_Int4_Buy)
		(L.L.BodyCount) 50 - (S.L.BodyCount)
	{endif}
{end}


{trigger:Tod_Spec1_Buy}
	(L.L.BodyCount) 989 >
	{if}
		1 (S.L.Tod_Spec1_Buy)
		(L.L.BodyCount) 990 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Spec2_Buy}
	(L.L.BodyCount) 539 >=
	{if}
		1 (S.L.Tod_Spec2_Buy)
		(L.L.BodyCount) 540 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Spec3_Buy}
	(L.L.BodyCount) 539 >=
	{if}
		1 (S.L.Tod_Spec3_Buy)
		(L.L.BodyCount) 540 - (S.L.BodyCount)
	{endif}
{end}

{trigger:Tod_Spec4_Buy}
	(L.L.BodyCount) 249 >
	{if}
		1 (S.L.Tod_Spec4_Buy)
		(L.L.BodyCount) 250 - (S.L.BodyCount)
	{endif}
{end}


{trigger:KoloP2_Button}
	1 (S.L.KoloP2_Button) (S.L.KoloP_2)
	0 (S.L.KoloP1_Button) (S.L.KoloP3_Button)
	0 (S.L.KoloP_1) (S.L.KoloP_3)
{end}

{trigger:KoloP1_Button}
	1 (S.L.KoloP1_Button) (S.L.KoloP_1)
	0 (S.L.KoloP2_Button) (S.L.KoloP3_Button)
	0 (S.L.KoloP_2) (S.L.KoloP_3)
{end}

{trigger:KoloP3_Button}
	1 (S.L.KoloP3_Button) (S.L.KoloP_3)
	0 (S.L.KoloP2_Button) (S.L.KoloP1_Button)
	0 (S.L.KoloP_2) (S.L.KoloP_1)
{end}

{trigger:KoloZ2_Button}
	1 (S.L.KoloZ2_Button) (S.L.KoloZ_2)
	0 (S.L.KoloZ1_Button)
	0 (S.L.KoloZ_1)
{end}

{trigger:KoloZ1_Button}
	1 (S.L.KoloZ1_Button) (S.L.KoloZ_1)
	0 (S.L.KoloZ2_Button)
	0 (S.L.KoloZ_2)
{end}

{trigger:KoloPX_Button}
	0 (S.L.KoloP1_Button) (S.L.KoloP2_Button) (S.L.KoloP3_Button)
	0 (S.L.KoloP_1) (S.L.KoloP_2) (S.L.KoloP_3)
{end}

{trigger:KoloZX_Button}
	0 (S.L.KoloZ1_Button) (S.L.KoloZ2_Button)
	0 (S.L.KoloZ_1) (S.L.KoloZ_2)
{end}

{trigger:Ext1_Button}
	(L.L.Ext1) ! (S.L.Ext1) s0
{end}

{trigger:Ext2_Button}
	(L.L.Ext2) ! (S.L.Ext2) s0
{end}

{trigger:Ext3_Button}
	(L.L.Ext3) ! (S.L.Ext3) s0
{end}

{trigger:Ext4_Button}
	(L.L.Ext4) ! (S.L.Ext4) s0
{end}

{trigger:Int1_Button}
	(L.L.Int1) ! (S.L.Int1) s0
{end}

{trigger:Int2_Button}
	(L.L.Int2) ! (S.L.Int2) s0
{end}

{trigger:Int3_Button}
	(L.L.Int3) ! (S.L.Int3) s0
{end}

{trigger:Int4_Button}
	(L.L.Int4) ! (S.L.Int4) s0
{end}

{trigger:Spec1_Button}
	(L.L.Spec1) ! (S.L.Spec1) s0
{end}

{trigger:Spec2_Button}
	(L.L.Spec2) ! (S.L.Spec2) s0
{end}

{trigger:Spec3_Button}
	(L.L.Spec3) ! (S.L.Spec3) s0
{end}

{trigger:Spec4_Button}
	(L.L.Spec4) ! (S.L.Spec4) s0
{end}


{macro:Tablet}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W01_Buy) ! &&
	{if}
		1 (S.L.Tod_W01_Buy_Visible)
	{else}
		0 (S.L.Tod_W01_Buy_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W02_Buy) ! &&
	{if}
		1 (S.L.Tod_W02_Buy_Visible)
	{else}
		0 (S.L.Tod_W02_Buy_Visible)
	{endif}


	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W03_Buy) ! &&
	{if}
		1 (S.L.Tod_W03_Buy_Visible)
	{else}
		0 (S.L.Tod_W03_Buy_Visible)
	{endif}


	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W04_Buy) ! &&
	{if}
		1 (S.L.Tod_W04_Buy_Visible)
	{else}
		0 (S.L.Tod_W04_Buy_Visible)
	{endif}


	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W05_Buy) ! &&
	{if}
		1 (S.L.Tod_W05_Buy_Visible)
	{else}
		0 (S.L.Tod_W05_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext1_Buy) ! &&
	{if}
		1 (S.L.Tod_Ext1_Buy_Visible)
	{else}
		0 (S.L.Tod_Ext1_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext2_Buy) ! &&
	{if}
		1 (S.L.Tod_Ext2_Buy_Visible)
	{else}
		0 (S.L.Tod_Ext2_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext3_Buy) ! &&
	{if}
		1 (S.L.Tod_Ext3_Buy_Visible)
	{else}
		0 (S.L.Tod_Ext3_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext4_Buy) ! &&
	{if}
		1 (S.L.Tod_Ext4_Buy_Visible)
	{else}
		0 (S.L.Tod_Ext4_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int1_Buy) ! &&
	{if}
		1 (S.L.Tod_Int1_Buy_Visible)
	{else}
		0 (S.L.Tod_Int1_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int2_Buy) ! &&
	{if}
		1 (S.L.Tod_Int2_Buy_Visible)
	{else}
		0 (S.L.Tod_Int2_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int3_Buy) ! &&
	{if}
		1 (S.L.Tod_Int3_Buy_Visible)
	{else}
		0 (S.L.Tod_Int3_Buy_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int4_Buy) ! &&
	{if}
		1 (S.L.Tod_Int4_Buy_Visible)
	{else}
		0 (S.L.Tod_Int4_Buy_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec1_Buy) ! &&
	{if}
		1 (S.L.Tod_Spec1_Buy_Visible)
	{else}
		0 (S.L.Tod_Spec1_Buy_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec2_Buy) ! &&
	{if}
		1 (S.L.Tod_Spec2_Buy_Visible)
	{else}
		0 (S.L.Tod_Spec2_Buy_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec3_Buy) ! &&
	{if}
		1 (S.L.Tod_Spec3_Buy_Visible)
	{else}
		0 (S.L.Tod_Spec3_Buy_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec4_Buy) ! &&
	{if}
		1 (S.L.Tod_Spec4_Buy_Visible)
	{else}
		0 (S.L.Tod_Spec4_Buy_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W01_Buy) &&
	{if}
		1 (S.L.Tod_W01_Visible)
	{else}
		0 (S.L.Tod_W01_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W02_Buy) &&
	{if}
		1 (S.L.Tod_W02_Visible)
	{else}
		0 (S.L.Tod_W02_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W03_Buy) &&
	{if}
		1 (S.L.Tod_W03_Visible)
	{else}
		0 (S.L.Tod_W03_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W04_Buy) &&
	{if}
		1 (S.L.Tod_W04_Visible)
	{else}
		0 (S.L.Tod_W04_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	(L.L.Tod_W05_Buy) &&
	{if}
		1 (S.L.Tod_W05_Visible)
	{else}
		0 (S.L.Tod_W05_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext1_Buy) &&
	{if}
		1 (S.L.Tod_Ext1_Visible)
	{else}
		0 (S.L.Tod_Ext1_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext2_Buy) &&
	{if}
		1 (S.L.Tod_Ext2_Visible)
	{else}
		0 (S.L.Tod_Ext2_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext3_Buy) &&
	{if}
		1 (S.L.Tod_Ext3_Visible)
	{else}
		0 (S.L.Tod_Ext3_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Ext4_Buy) &&
	{if}
		1 (S.L.Tod_Ext4_Visible)
	{else}
		0 (S.L.Tod_Ext4_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int1_Buy) &&
	{if}
		1 (S.L.Tod_Int1_Visible)
	{else}
		0 (S.L.Tod_Int1_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int2_Buy) &&
	{if}
		1 (S.L.Tod_Int2_Visible)
	{else}
		0 (S.L.Tod_Int2_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int3_Buy) &&
	{if}
		1 (S.L.Tod_Int3_Visible)
	{else}
		0 (S.L.Tod_Int3_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	(L.L.Tod_Int4_Buy) &&
	{if}
		1 (S.L.Tod_Int4_Visible)
	{else}
		0 (S.L.Tod_Int4_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec1_Buy) &&
	{if}
		1 (S.L.Tod_Spec1_Visible)
	{else}
		0 (S.L.Tod_Spec1_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec2_Buy) &&
	{if}
		1 (S.L.Tod_Spec2_Visible)
	{else}
		0 (S.L.Tod_Spec2_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec3_Buy) &&
	{if}
		1 (S.L.Tod_Spec3_Visible)
	{else}
		0 (S.L.Tod_Spec3_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	(L.L.Tod_Spec4_Buy) &&
	{if}
		1 (S.L.Tod_Spec4_Visible)
	{else}
		0 (S.L.Tod_Spec4_Visible)
	{endif}

	(L.L.TabWeb01Visible) (L.L.TabVisible) &&
	{if}
		1 (S.L.Tod_WX1_Visible) (S.L.Tod_WX2_Visible) (S.L.TW_to2_Visible)
	{else}
		0 (S.L.Tod_WX1_Visible) (S.L.Tod_WX2_Visible) (S.L.TW_to2_Visible)
	{endif}

	(L.L.TabWeb02Visible) (L.L.TabVisible) &&
	{if}
		1 (S.L.TW_to1_Visible) (S.L.TW_to3_Visible)
	{else}
		0 (S.L.TW_to1_Visible) (S.L.TW_to3_Visible)
	{endif}

	(L.L.TabWeb03Visible) (L.L.TabVisible) &&
	{if}
		1 (S.L.TW_to2p_Visible)
	{else}
		0 (S.L.TW_to2p_Visible)
	{endif}

	(L.L.TabVisible) !
	{if}
		0 (S.L.TabWeb01Visible) (S.L.TabWeb02Visible) (S.L.TabWeb03Visible) (S.L.BodyVisible) 
	{endif}
{end}

