"animation" is not a member of System.Type?

Okay, so I have a script (that I got from a youtube video), copied it, it worked fine on the video but it doesn’t for mine. It says that “animation” is not a member of System.Type, can someone help me?

#pragma strict

private var guiShow : boolean = false;
private var isOpen : boolean = false;

var door = GameObject;

var rayLength = 10;

function Update () 
{
	var hit : RaycastHit;
	var fwd = transform.TransformDirection (Vector3.forward);
	
	if (Physics.Raycast(transform.position, fwd, hit, rayLength))
	{
		if (hit.collider.gameObject.tag == "Door")
		{
			guiShow = true;
			if(Input.GetKeyDown("e") && isOpen == false)
			{
				door.animation.Play("DoorOpen");
				isOpen = true;
				guiShow = false;
			}
			else if(Input.GetKeyDown("e") && isOpen == true)
			{
				door.animation.Play("DoorClose");
				isOpen = false;
				guiShow = false;
			}
		}
	}
	else
	{
		guiShow = false;
	}
}

function OnGUI ()
{
	if (guiShow == true && isOpen == false)
	{
		GUI.Box(Rect(Screen.width / 2, Screen.height / 2, 100, 25), "E to Open");
	}
	else if (guiShow == true && isOpen == true)
	{
		GUI.Box(Rect(Screen.width / 2, Screen.height / 2, 100, 25), "E to Close");
	}
}

Declaration of the Variables is incorrect…

Try This

var door : GameObject;
var rayLength : int = 10;