added conditions
added conditions to nav
fixed jshint errors