Animation Played when key pressed Help

I want to make a horse play it’s idle animation when no key is pressed, it’s walking animation when W, A, S, or D is pressed, and its running animation when the left shift is pressed. I just want to know how my script should be changed in order for this to happen.

#pragma strict

public var Run : AnimationClip;
public var Walk : AnimationClip;
public var Idle : AnimationClip;



function Update () {

GetComponent.<>(Idle).Play();

 if( Input.GetKeyDown("W")){
 	
GetComponent.<Animation>().Play();
 
 }
  if( Input.GetKeyDown("A")){
 GetComponent.<Animation>().Play();
 	
 }
  if( Input.GetKeyDown("S")){
 	GetComponent.<Animation>().Play();
 	
 }
  if( Input.GetKeyDown("D")){
 	 GetComponent.<Animation>().Play();
 	
 }
  if( Input.GetKeyDown("LeftShift")){
 	 GetComponent.<Animation>().Play();
 	
	}
 
}

First off, I suggest caching the reference to the Animation component in Start. But to play the idle animation simply call animation.Play(“idle”). So long as the Animation contains a clip with the name “idle” the animation with play.