/*###############################################################
			Pop-open Picture Function
input: the picture name,
       the element calling this function,
       the text displayed below the picture.

output: nothing
        (appends body to html, no need for output)

###############################################################*/
function openBig(picture, element, txt){
/*
###########  Creating Image Div  ###########
*/
  var image=document.createElement('div');
  var height, width;

  image.appendChild(eval(picture));
  height=eval(picture).height;
  width=eval(picture).width;

  image.style.height = height+"px";
  image.style.margin='0px';
  image.style.padding='0px';

/*
###########  Creating Text Div  ###########
*/

  var text=document.createElement('div');
  text.style.backgroundColor='#fff';
  text.style.margin='0';
  text.style.padding='0';
  text.style.height='15px';
  text.style.border='1px solid';

  var titleText = txt.split(" - ");
  var name=document.createElement('div');
  name.className="popoutText";
  name.innerHTML=titleText[0];
  text.appendChild(name);

/*
###########  Creating Main Container Div  ###########
*/
  var content=document.createElement('div');
  content.id = "mouseover-image";
  content.style.border = "3px solid #67573E";
  content.style.position = "absolute";
  content.style.zIndex = "2";
  content.style.width = width+"px";
  content.style.height = (height+15)+"px";

  if (navigator.userAgent.match('MSIE')){
    if (element.offsetParent) {
      var curleft = element.offsetLeft;
      var curtop = element.offsetTop;
      var newEl = element;
      while (newEl = newEl.offsetParent) {
          curleft += newEl.offsetLeft;
          curtop += newEl.offsetTop;
          if (!newEl.offsetParent)
            break;
      }
    }
    content.style.top = curtop+"px";
    content.style.left = curleft+"px";
  }else{
    content.style.top = (element.offsetTop-(height+25))+"px";
    content.style.left = element.offsetLeft+"px";
  }
/*
###########  Appending Divs Together  ###########
###########    Inserting into Page    ###########
*/
  content.appendChild(image);
  content.appendChild(text);

  if (navigator.userAgent.match('MSIE')){
    document.body.appendChild(content);
  }else{
    element.parentNode.appendChild(content);
  }
}

function closeBig(){
/*
###########  Removing pop-open from page  ###########
*/
  var pic = document.getElementById('mouseover-image');
  pic.parentNode.removeChild(pic);
}