var continue_dimmer = true; /* flag for continued dimming */
function set_opacity(id,amt){
  id.style.opacity = amt/100.0;
  id.style.filter = "alpha(opacity="+amt+")";
}
function move_over_thumb_nail(icon,image,id){
  // Dim thumb1 if it is not being selected
  var thumb1 = document.getElementById('Thumb1');
  thumb1 = thumb1.childNodes[0];
  while(thumb1.nodeName != "IMG") thumb1 = thumb1.nextSibling;
  if(thumb1 != icon) set_opacity(thumb1,30);

  set_opacity(icon,100.0);
  continue_dimmer = false; 
  document.getElementById(id).style.display = 'block';
  document.getElementById('Blank_LG').src = 'Images/Portfolio/'+Page+'/'+image
}
function move_out_thumb_nail(icon,id){
  set_opacity(icon,30.0)
  document.getElementById(id).style.display = 'none';
  document.getElementById('Blank_LG').src = 'Images/Portfolio/'+Page+'/Blank_White_450x250.gif'
}
  
function flash(amt,incr,cycle_count){
  var amt;
  var id = document.getElementById('Thumb1');
  id = id.childNodes[0];
  while(id.nodeName != "IMG") id = id.nextSibling;

  if(!continue_dimmer){
    return
  }
  if(amt <= 30){
    if(incr < 0) cycle_count--;
    amt = 30
    incr = incr * -1
  }
  if(amt >= 100){
    amt = 100
    incr = incr * -1
  }
  set_opacity(id,amt)

  amt += incr

  if(cycle_count == 0){
     pause = 2000
     cycle_count = 2;
  }
  else pause = 200;

  if(continue_dimmer) setTimeout("flash("+amt+","+incr+","+cycle_count+")",pause);
  
}

var alternate_selected_images = null;
var alternate_selected_text = null;

function move_over_alternate_icon(which,index){
  alternate_selected_images = alternate_images[index];
  alternate_selected_text = alternate_text[index];
  alternate_selected_images['curr_display'] = 0
  which.style.cursor = 'pointer';
}
function move_out_alternate_icon(which){
  which.style.cursor = '';
  var text_title = document.getElementById("alternate_text_title");
  var text_body = document.getElementById("alternate_text_body");
  text_title.innerHTML = '';
  text_body.innerHTML = '';
}
function show_next_alternate_image(which){
  var i = alternate_selected_images['curr_display'];

  document.getElementById('Blank_LG').src = 'Images/Portfolio/'+Page+'/'+alternate_selected_images[i]
  
  var text_title = document.getElementById("alternate_text_title");
  var text_body = document.getElementById("alternate_text_body");
  text_title.innerHTML = alternate_selected_text[i].title;
  text_body.innerHTML = alternate_selected_text[i].body;
  
  if(i < alternate_selected_images.length - 1) i = i + 1
  else i = 0;
  alternate_selected_images['curr_display'] = i;

}
setTimeout("flash(30,-20,3)",0); 
