var wasClass = '';


/* ---------------- */
function CIM(obj)
{
  var pObj = obj.parentNode;
  wasClass = pObj.className;
  pObj.className = 'mmOver';
  obj.onmouseout = function() {CIMout(obj);}
}

/* ---------------- */
function CIMout(obj)
{
  var pObj = obj.parentNode;
  pObj.className = wasClass;
}

/* ---------------- */
function ODimg(who,src)
{
  //who.onmouseout = function() {ODimgOut(who,name);};
  var img = who.firstChild.firstChild;
  if (img.nodeName != "IMG") {img = img.firstChild;}
  img.src = src; //'/_img/od/'+name+'_.jpg';
}

/* ---------------- */
function ODimgOut(who,src)
{
  var img = who.firstChild .firstChild;
  if (img.nodeName != "IMG") {img = img.firstChild;}
  img.src = src; //'/_img/od/'+name+'.jpg';
}



function ShowImage(src)
{

  var img=new Image;
  img.src=src; // loading
  if (img.readyState == 'complete')
  {
    ShowImage2(img,src);
  }
  else
  {
    img.onload = function() {ShowImage2(img,src);};
  }
}


function ShowImage2(img,src)
{
  var w = img.width;
  var h = img.height;
  var ww = w + 21;
  var hh = h + 21;

  var DIV = document.getElementById('ShowPic');
  if (!DIV)
  {
    DIV = document.createElement('DIV');
    document.body.appendChild(DIV);
    DIV.style.display = 'none';
    DIV.className = 'ShowPic';
    DIV.id = 'ShowPic';
    DIV.onclick =  function() {CloseWindow('ShowPic');};
    DIV.title = 'Close Window';
  }

  DIV.innerHTML = '';
  DIV.innerHTML = '<div class="ShowPicWrap"><img src="'+src+'" width="'+w+'" height="'+h+'" alt="" /></div>'

  ShowWindow(DIV, '', 1, ww);
}


