Tablet navigation javascript