function checkVersion() {
  if (navigator.appVersion.charAt(0)>=3) return true;
  else return false;
}

//Preload image


redlightOn=new Image();
redlightOn.src="images/tl/redOn.jpg";

yellowlightOn=new Image();
yellowlightOn.src="images/tl/yellowOn.jpg";

greenlightOn=new Image();
greenlightOn.src="images/tl/greenOn.jpg";

redlightOff=new Image();
redlightOff.src="images/tl/redOff.jpg";

yellowlightOff=new Image();
yellowlightOff.src="images/tl/yellowOff.jpg";

greenlightOff=new Image();
greenlightOff.src="images/tl/greenOff.jpg";

function changeyg(){
	
if (checkVersion()) {
	document['yellow'].src = "images/tl/yellowOff.jpg";
	document['green'].src= "images/tl/greenOff.jpg";
	document['red'].src = "images/tl/redOn.jpg"
}
}

function changerg(){
	if (checkVersion()) {
	document['red'].src= "images/tl/redOff.jpg";
	document['green'].src = "images/tl/greenOff.jpg";
	document['yellow'].src = "images/tl/yellowOn.jpg";
}
}

function changery(){
	if (checkVersion()) {
	document['red'].src= "images/tl/redOff.jpg";
	document['yellow'].src = "images/tl/yellowOff.jpg";
	document['green'].src= "images/tl/greenOn.jpg"
}
}

function offstater(){if (checkVersion()) {
document['red'].src = "images/tl/redOff.jpg";}}
function offstatey(){if (checkVersion()) {
document['yellow'].src="images/tl/yellowOff.jpg";}}
function offstateg(){if (checkVersion()) {
document['green'].src="images/tl/greenOff.jpg";}}
