Animation scripting problems

This is part of my animation script for my gun, I have altered it a bit to what I thought would make sense but it does not work. Before I changed the script When W or S is pressed it plays my walk animation but when A or D is pressed it still plays the idle animation, so I thought if I put horizontal instead of vertical it would work but instead I get a ton of errors. Can anyone help me out?

if(Mathf.Abs(Input.GetAxis("Vertical")) > 0.1) // I added the i of if [Berenger]
  animation.CrossFade("walk");
else
  animation.CrossFade("idle");  

if(Mathf.Abs(Input.GetAxis("Horizontal")) > 0.1)
  animation.CrossFade("walk");
else
  animation.CrossFade("idle");

Horizontal < 0.1 is going to crossfade Idle, overriding the vertical input. Try that :

var v : float = Mathf.Abs(Input.GetAxis("Horizontal"));
var h : float = Mathf.Abs(Input.GetAxis("Vertical"));

if( h > 0.1 || v > 0.1 )
  animation.CrossFade("walk");
else
  animation.CrossFade("idle");

// OR
animation.CrossFade(( h > 0.1 || v > 0.1 ) ? "walk" : "idle" );