BCE0005, BCE0067 how to fix?

How to fix this? Here’s the code:

#pragma strict

function Start () {
}

function Update () {
	
	if (Input.GetKeyDown ("e"))
		{
			if (enabled==true)
			{
				if (isOpened==false)
				{
					animation.Play("box_open");
					var isOpened = true;
				}
			}
		}
		
if (Input.GetKeyDown ("e"))
		{
			if (enabled==true)
			{
				if (isOpened==true)
				{
					animation.Play("box_close");
					var isOpened = false;
				}
			}
		}
	}
	
function OnBecameVisible () 
	{
		var enabled = true;
	}

function OnBecameInvisible ()
	{
		var enabled = false;
	}

You have not declared ‘isOpened’. At the top of the file put:

var isOpened = false;

…then you need to remove the ‘var’ on line 15.

For future compiler error questions, please include the a copy of the first error in from the console.