// JavaScript Document
// toggle visibility
function toggle( targetId ){ 
  if (document.getElementById){ 
        target = document.getElementById( targetId ); 
           if (target.style.display == "none"){ 
              target.style.display = ""; 
           } else { 
              target.style.display = "none"; 
           } 
     } 
	restartGif()
}

//Workaround to force IE to continue playing the animated GIF
function restartGif(){
         for(var i=0; i<document.images.length; i++){
                 var img = document.images[i];
                 var imgName = img.src.toUpperCase();
                 if (imgName.substring(imgName.length-3, imgName.length) == "GIF"){
                         //setTimeout('document.images["pbar"].src ="images/progress_bar.gif"', 200);
                         img.src = img.src;
                 }
         }
}



// FUNCTIONS FOR HOMES BY EMAIL TEXT
function crossref(number){
	var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
	return crossobj
}

function neon(){
	//Change all letters to base color
	if (n==0){
	for (m=0;m<message.length;m++)
		//eval("document.all.neonlight"+m).style.color=neonbasecolor
		crossref(m).style.color=neonbasecolor
	}
	//cycle through and change individual letters to neon color
	crossref(n).style.color=neontextcolor

	if (n<message.length-1)
		n++
	else{
		n=0
	clearInterval(flashing)
	setTimeout("beginneon()",1500)
	return
	}
}

function beginneon(){
	if (document.all||document.getElementById)
		flashing=setInterval("neon()",flashspeed)
	}