Algo más optimizado:
Código Javascript
:
Ver originaldocument.getElementById("contenido").onclick = function(){
this.style.right = (getComputedStyle(this).getPropertyValue("right").match(/^0/) ? -150 : 0) + "px";
}
Demo:
http://jsfiddle.net/wZVanG/jep3msb7/
Por qué
getComputedStyle?: this.style.right te mostrará
undefined si el elemento HTML no tiene ningún estilo asignado por el atributo
style=""
Con jQuery puedes reducir aún más.