(10,47): BCE0044: expecting :, found '='.

I'm working on setting up my GUI for my project, and so far everything is going pretty well. However when I tried adding my if statements for my boolean variable TogglleMenu I recieve the error expecting :, found '='. on the 10th line. Any help figuring this problem out would be nice as I'm fairly new to Javascript.

    var bannerskin : GUISkin;
var ToggleMenu : boolean = false;
function Update()
{
    if(Input.GetKeyDown(KeyCode.Escape))
    PauseGame();
}
    static function PauseGame()
    {
        if(!ToggleMenu)
        {
            {
                Time.timeScale=0;
                AudioListener.pause = true;
                ToggleMenu=true;
            }
            else
            {
                Time.timeScale=1;
                AudioListener.pause = false;
                ToggleMenu=false;
            }
        }
    }
function OnGUI()
{
    GUI.skin = bannerskin; //switch to my bannerskin
    if(Time.time<=10)
    {
        GUI.Box(Rect (Screen.width/4,0,Screen.width/2,Screen.height/5), "");
    }
    GUI.skin = null; //switch to default skin
    if(!ToggleMenu) //if ToggleMenu = true execute follwing, Application.Exit, Prompt Level Select GUI, or unpause game.
    {
        if(GUI.Button(Rect (Screen.width/2,Screen.height/2,Screen.width/6,Screen.height/12), "Exit Program")){
            Application.Exit;
        }
        if(GUI.Button(Rect (Screen.width/2,(Screen.height/2)+(Screen.height/12),Screen.width/6,Screen.height/12), "Level Select")){
            //Next Level Select Menu code goes here
        }
        if(GUI.Button(Rect (Screen.width/2,(Screen.height/2)+(Screen.height/12)+(Screen.height/12),Screen.width/6,Screen.height/12), "Back To Game")){
                Time.timeScale=1;
                AudioListener.pause = false;
                ToggleMenu=false;
        }
    }

}

Original code:

if(!ToggleMenu)
{
    {
        Time.timeScale=0;
        AudioListener.pause = true;
        ToggleMenu=true;
    }
    else
    {
        Time.timeScale=1;
        AudioListener.pause = false;
        ToggleMenu=false;
    }
}

your brackets are mismatched. should be

if(!ToggleMenu)
{
    Time.timeScale = 0;
    AudioListener.pause = true;
    ToggleMenu = true;
}
else
{
    Time.timeScale = 1;
    AudioListener.pause = false;
    ToggleMenu = false;
}

If i fix the two errors we mentioned above below the only thing that is still wrong is that there's no Exit function in Application. It's called Application.Quit() and you have to put brakets behind it.

Here's the fully working script:

var bannerskin : GUISkin;
static var ToggleMenu : boolean = false;

function Update()
{
    if(Input.GetKeyDown(KeyCode.Escape))
        PauseGame();
}

static function PauseGame()
{
    if(!ToggleMenu)
    {
        Time.timeScale=0;
        AudioListener.pause = true;
        ToggleMenu=true;
    }
    else
    {
        Time.timeScale=1;
        AudioListener.pause = false;
        ToggleMenu=false;
    }
}

function OnGUI()
{
    GUI.skin = bannerskin; //switch to my bannerskin
    if(Time.time<=10)
    {
        GUI.Box(Rect (Screen.width/4,0,Screen.width/2,Screen.height/5), "");
    }
    GUI.skin = null; //switch to default skin
    if(!ToggleMenu) //if ToggleMenu = true execute follwing, Application.Quit, Prompt Level Select GUI, or unpause game.
    {
        if(GUI.Button(Rect (Screen.width/2,Screen.height/2,Screen.width/6,Screen.height/12), "Exit Program")){
            Application.Quit();
        }
        if(GUI.Button(Rect (Screen.width/2,(Screen.height/2)+(Screen.height/12),Screen.width/6,Screen.height/12), "Level Select")){
            //Next Level Select Menu code goes here
        }
        if(GUI.Button(Rect (Screen.width/2,(Screen.height/2)+(Screen.height/12)+(Screen.height/12),Screen.width/6,Screen.height/12), "Back To Game")){
            Time.timeScale=1;
            AudioListener.pause = false;
            ToggleMenu=false;
        }
    }
}