
  var oldValue;

//Parameters passed in: current textfield and the current value of that textfield
//When the user clicks on the textfield the current value is deleted and the font 
//color of the textfield is changed to black
function before(textfield, value){

  var nezz = textfield;
  oldValue = value;
  
  nezz.value= "";
  nezz.style.color = "black";
}

//Parameters passed in: name of current textfield
//When the user clicks off the textfield the current value is checked
//if the value is nothing then the previous value is added to the textfield
//and color of the textfield is changed to gray
function after(textfield){

  var nezz = textfield;
  if(nezz.value == "")
  {
    nezz.style.color = "#939393";
    nezz.value = oldValue;
  }
}

function show(x){
  var layer = document.getElementById(x);
  layer.style.display='block';
}

function hide(x){
  var layer = document.getElementById(x);
  layer.style.display='none';
}

function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 

    //determine the direction for the blending, if start and end are the same nothing happens 
    if(opacStart > opacEnd) { 
        for(i = opacStart; i >= opacEnd; i--) { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } else if(opacStart < opacEnd) { 
        for(i = opacStart; i <= opacEnd; i++) 
            { 
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
            timer++; 
        } 
    } 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100); 
    object.MozOpacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
}

function shiftOpacity(id, millisec) {
    
    //if an element is invisible, make it visible, else make it visible 
    if(document.getElementById(id).style.display == 'none') {     
        opacity(id, 0, 100, millisec);
        //this will time the display to be set to true right after the function opacity is called to make the tranistion run smoothly
        setTimeout('document.getElementById("fadeinbox").style.display = "";', 10)
        setTimeout('document.getElementById("flashMovie").Play();', 500)
    } else { 
        opacity(id, 100, 0, millisec);
        setTimeout('document.getElementById("fadeinbox").style.display = "none";', 600)
        setTimeout('document.getElementById("flashMovie").Rewind();document.getElementById("flashMovie").StopPlay();', 500)
    } 
}