// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function fullimage(id, file) {
  tag="<image src='/fullimage/"+id+"/"+file+"'/>";
  tag += "<a href='javascript: void(0)' onClick=\"document.getElementById('showphoto').style.display='none'\" class='photoclose'>";
  tag += "<image src='/images/close.png' border='0'/>";
  tag += "</a>";
  displayblock = document.getElementById('showphoto');
  displayblock.innerHTML=tag;
  displayblock.style.display='block';
}



function setupchildboxes() {
	var x = document.getElementsByName("childbox");
	for (var i=0;i<x.length;i++) {
//	  x[i].onmouseover = openchildbox;
//	  x[i].onmouseout = closechildbox;
	}
}
var childBoxContentSaved
var isSaved = 0;

function openchildbox() {
  if (isSaved != 1) {
    childBoxContentSaved = this.innerHTML;
    isSaved=1; 
    new Effect.Opacity(this.id, { from: 1.0, to: 0.2, duration: 0.5 });
    this.innerHTML = this.innerHTML;
    new Effect.Opacity(this.id, { from: 0.2, to: 1.0, duration: 0.5 });
  }
}

function closechildbox() {
  if (isSaved = 1) {
    this.innerHTML = childBoxContentSaved;
    isSaved=0;
  }
}

var microphoto = new Array();
function microphoto_rendered(photo_id) {
  if (!microphoto[photo_id]) {
    microphoto[photo_id]=0;
  }
  microphoto[photo_id]++;
  if (microphoto[photo_id]%4 == 0) {
    document.getElementById('microthumb'+photo_id).style.display='inline';
  }
}

