function IdOutro()
{

	var lasttime = GetTime();
	for (wi=0;wi<=20;wi++)
	{
		//draw back stuff;
		RenderBackground();
		Rectangle(0,0,320,240, CreateColor(0,0,0,255*wi/20));
		FlipScreen();
		while (GetTime()-lasttime < 1000/30);
		lasttime = GetTime();
	}
	PauseHeart();
	PauseAllMusic();
	ClearPauseMusicStats();
	return;

	lasttime = GetTime();
	
	var images = new Array(9);
	images[0] = LoadImage("id_outro/fire1_1.png");
	images[1] = LoadImage("id_outro/fire1_2.png");
	images[2] = LoadImage("id_outro/liegh1_01.png");
	images[3] = LoadImage("id_outro/liegh1_02.png");
	images[4] = LoadImage("id_outro/stand1_01.png");
	images[5] = LoadImage("id_outro/stand1_02.png");
	images[6] = LoadImage("id_outro/stand1_03.png");
	images[7] = LoadImage("id_outro/stand1_04.png");
	images[8] = LoadImage("id_outro/stand1_05.png");
	images[9] = LoadImage("id_outro/stand1_06.png");
	images[10] = LoadImage("id_outro/stand1_07.png");


	var fratey = 1000/12;
	var quity = false;

	function DrawBars()
	{
		Rectangle(0,0,320,20, CreateColor(0,0,0,255));
		Rectangle(0,240-20,320,20, CreateColor(0,0,0,255));
	}

	function CheckExit()
	{
		return false;
		//not used for this intro
		while(AreKeysLeft())
		{
			switch(GetKey())
			{
				case KEY_ENTER:
				{
					quity = true;
				
				}
				case KEY_ESCAPE:
				{
					quity = true;
				
				}
				case KEY_SPACE:
				{
					quity = true;
				
				}
			}
		}
	}
	
	var rate = 50;
	for (wi=0;wi<14*6;wi++)
	{
		if (wi%14 == 0)
		{
			if (wi == 14*3)
				PlaySound(12);
			else 
				PlaySound(9);

		}
		if (Math.floor(wi/14) == 3)
			rate = 30;
		else
		  rate = 50;
		while(GetTime()-lasttime < 1000/rate)
		{
			if (Math.floor(wi/2)%7 == 0)
			{
				if (Math.floor(wi/2) == 4*7|| Math.floor(wi/2) == 4*7)
					images[0].blit(0,0);
				else
					images[1].blit(0,0);
			}
			else
				images[0].blit(0,0);
	
			DrawBars();
			Rectangle(0,0,320,240,CreateColor(0,0,0,255-wi*255/20));
			FlipScreen();
			CheckExit();
		}
		lasttime = GetTime();
	}

	for (wi=0;wi<14*5;wi++)
	{
		if (wi%14 == 0)
			PlaySound(9);
		while(GetTime()-lasttime < 1000/50)
		{
			if (Math.floor(wi/2)%7 == 0)
				images[3].blit(0,0);
			else
				images[2].blit(0,0);

			DrawBars();
			FlipScreen();
			CheckExit();
		}
		lasttime = GetTime();
	}

	var inum = 0;
	for (wi=0;wi<14*8;wi++)
	{
		if (wi%2==0)
			inum=(inum+1)%7;
		if (wi%14 == 1)
			PlaySound(9);

		while(GetTime()-lasttime < 1000/50)
		{
			images[inum+4].blit(0,0);
			DrawBars();
			if (wi > 14*6)
				Rectangle(0,0,GetScreenWidth(), GetScreenHeight(), CreateColor(0,0,0,255*(wi-14*6)/28));
			FlipScreen();
			CheckExit();
		}
		lasttime = GetTime();
	}


}


function IdEnd()
{
	//fade to cutscene
	//cutscene
	//fade to usual screen.
	IdOutro();
	ClearGameInfo(-1);
	GoToLevel(10);
	g_cancel_fade = true;
}