it sounds like some sort of brain dammage. has she been hit, or dropped as a puppy? ring your local vet and ask what they think.
If your dog's "walking around funny" is always a prelude to doing a poop or pee, then like seanna says, some dogs are like that. Mine is. It's a strange ritual, going to the loo! When she's out on a walk during the day, this strange behaviour doesn't happen, but it certainly does first thing in the morning, and last thing at night. She mooches about in a state of great concentration, sniffing out the "perfect spot" to do whatever it is she needs to do. When I used to always take her to the end of the garden for a last pee at night, she would mooch around, up and down a 10 foot area, turning in circles, and doing all kinds of weird stuff....(it almost worried me sometimes, I thought she might be going a little peculiar) -but no. This was a doggy ritual thing.
Now we go for a short walk last thing at night instead, but still the "perfect place to pee" seems to be the biggest thing on her mind!
However, if you mean your dog has episodes of "zoning out" generally, and it ends with her losing control of bladder or bowels, then that sounds neurological, yes. And could be a form of epilepsy perhaps, or seizure of some kind.
I would definitely speak to your vet about this
It does sound a bit worrying I think it has to be neurological problem and I think you will have to take her to the vet to have her checked out.Might be a good idea to ask one of the Vets on med help as well! I got in touch with one the other day and they got back to me very quickly.
Or maybe she is concentrating where she is going to do her business as some dogs make a big too do about it,and take ages on where to do it, one of my dogs Maybelle takes about ten mins to decide where she is going to deposit her precious load and then she turns around and around about 4or 5 times to get comfy first.
You would know if its anything like this.Please let us know how you go with her.