My question involves a child custody case from the State of: VA

Hello, all. I'm an Active Duty military servicemember currently stationed overseas. I am also a father to a thirteen year old girl who lives in Va with her mother. Without going into too much detail, here are some facts about my situation:

-The mother and I were never married.
-Though she has sole physical custody, I was awarded joint legal custody and visitation rights.
-I have paid Child Support since my child's birth.
-When my child was three years old, I married. My wife and I currently have two children.
-According to our previous and current custody agreement (as of NOV09), I am allowed to have my child with me for the entire duration of my stay whenever I am in town to visit. Due to the nature of my job in the military, deployments, and sometimes, financial constraints, I am usually only able to see my child 2-3 weeks out of a year.

After notifying the mother of the dates I will be in town two months in advance, she informs me that she has made plans to take my daughter to NC, and that she will NOT change these plans, even though I will be flying in from out of the country and I gave her ample notice. Due to her refusal to cooperate, and my realization that she has consistently failed to adhere to any of the agreements set forth by the courts, I decide to schedule a court date in their county during my leave. While looking up information on my child, the person assisting me informs me that the most recent custody hearing occurred last year, where my daughter's great-grandmother (the mother's grandmother) was awarded Joint Legal Custody. I had no knowledge of this, as I have been stationed overseas for the past year and a half.

My questions are these:

-On what grounds can a third party be awarded Joint Legal Custody?
-As a father who shares Joint Legal Custody with the mother, did the courts act appropriately in going ahead with the hearing without my knowledge or consent?
-Can I appeal this ruling?
-How does this ruling affect me and my rights?
-I intend to seek Joint Physical Custody upon my permanent return to the US; will finding out that the mother has kept this kind of information from me have any impact on my case?
-I have always suspected that my child lives with her great-grandmother and not her mother. If I am able to prove that, will it help me get joint/full physical custody in the near future? And will the great-grandmother be able to prevent that from happening, since she now has Joint Legal Custody herself?

I hope I have given enough background information on my situation. Thanks for the help! Also, thanks for supporting your troops!