You're driving down the road minding your own business when a vehicle passes you flashing their headlights. Now, you are totally confused. Was it just someone who knows you, with their way of saying "Hi" rather than blowing their horn or waving to you out the window?

Or is someone just giving you a heads up about something you are about to encounter? Maybe it's a speed trap ahead, or possibly a vehicle crash or some sort of obstacle that will require you to slow down or come to a complete stop. Either way, it's a nice gesture from that friendly motorist.

Last week, I passed a motorist flashing their headlights at us, and I'm glad they did, because just as I rounded a curve in the road, there was a utility truck partially in my lane with workers around and up a telephone pole performing work. No indication beforehand that they were there. That was a good heads up as far as I was concerned.

Get our free mobile app

But the question here, is it legal to flash your lights at an oncoming vehicle for whatever reason in the states of New York and Pennsylvania? I didn't have the answer, so I took to the good old world wide web to find out.

According to the Pennsylvania General Assembly, it states than there is no law that prohibits you from flashing your headlights to oncoming vehicles for whatever reason including encountering hazards or emergencies ahead. As an FYI, as I was reading up on the law, I found it interesting to note that you are required in Pennsylvania to switch to your low beams within 500 feet of an oncoming vehicle and 300 feet if your are behind a vehicle.

For New York State drivers, you must switch to low beams within 500 feet of an oncoming vehicle and 200 feet behind a vehicle. As for flashing your headlights to oncoming vehicles to alert them of an emergency, hazard or speed trap, I had a hard time trying to wade through all the confusing New York State DMV sites to an answer.

But according to the Traffic Tickets/Rosenblum Law website, it claims that it is not illegal to flash your headlights in New York State. The article does state that flickering lights are not permitted, but that flickering lights are not the same as flashing lights.

I have to agree that you should be cautious either way. Sure, warning an oncoming vehicle about an emergency or hazard up ahead is the courteous thing to do, keep in mind it can also distract a driver as well.

via Pennsylvania General Assembly, Traffic Tickets.Com/Rosenblum Law

LOOK: What major laws were passed the year you were born?

Data for this list was acquired from trusted online sources and news outlets. Read on to discover what major law was passed the year you were born and learn its name, the vote count (where relevant), and its impact and significance.

LOOK: Stunning vintage photos capture the beauty of America's national parks

Today these parks are located throughout the country in 25 states and the U.S. Virgin Islands. The land encompassing them was either purchased or donated, though much of it had been inhabited by native people for thousands of years before the founding of the United States. These areas are protected and revered as educational resources about the natural world, and as spaces for exploration.

Keep scrolling for 50 vintage photos that show the beauty of America's national parks.