if (parent==self) 
{ if (document.location.href.lastIndexOf("/") >= 0)
    window.location.replace("alv-home.html?"+document.location.href.substring(1 + document.location.href.lastIndexOf("/")));
  else
    window.location.replace("alv-home.html?"+document.location.href);
}

function CellSet(item, mode)
{ if (mode == 0)  { item.className='CellNormal'; item.childNodes[0].className='MenuNormal'; }
  if (mode == 1)  { item.className='CellActive'; item.childNodes[0].className='MenuActive'; }
  if (mode == 9)  { document.location.href=item.childNodes[0].href; }
  if (mode == 10) { item.className='ImgNormal'; }
  if (mode == 11) { item.className='ImgActive'; }
}

function anim(o, i) 
{ var obj;
  if (! document[((typeof o.cil == "object")?o.cil[i]:o.cil)]) return false;
  if ((o.obr[o.inx[i]]) && (o.obr[o.inx[i]].complete)) document[((typeof o.cil == "object")?o.cil[i]:o.cil)].src=o.obr[o.inx[i]].src; 
  window.setTimeout('anim(' + o.jmn + ', ' + ((i+1)%o.inx.length) + ')', o.cas[i]); 
  if (! (document.getElementById && document.getElementById((typeof o.pps == "object")?o.pps[i]:o.pps)) ) return false;
  if (o.txt[o.inx[i]]) document.getElementById((typeof o.pps == "object")?o.pps[i]:o.pps).innerHTML=o.txt[o.inx[i]]; 
  return true;
}

var Detail;
var DetailFrame;
var DetailValue = new Object();

function DetailView(DetLink)
{ var l, t, p;
  var w, h;      // temp width, temp height
  var frm;       // clipped window frame
  var obj, htm;  // current object, html code
  if (! document.getElementById)
  { window.open('alv-detail.html?' + DetLink.href, 'Detail', 'width=660,height=670,resizable'); 
    return false;
  }
  htm = '<TABLE bgcolor="#807060" border="0" cellpadding="0" cellspacing="1"><TR><TD class="ImgBorder">';
  htm += '<TABLE border="0" cellpadding="0" cellspacing="0">';
  htm += '<TR><TD class="ImgDetail">';
  htm += '<TABLE width="100%" border="0" cellpadding="0" cellspacing="0">';
  htm += '<TR align="center"><TD width="24" id="ImgMover" class="ImgSymbol" onmouseover="this.style.cursor=\'move\';">&curren;</TD><TD class="ImgTitle">' + (DetLink.childNodes[0].alt?DetLink.childNodes[0].alt:'&nbsp;') + '</TD><TD width="24" class="ImgSymbol" onclick="DetailHide();">&times;</TD></TR>';
  htm += '</TABLE></TD></TR><TR><TD height="4"></TD></TR>';
  htm += '<TR><TD class="ImgDetail" onclick="DetailHide(1);"><IMG src="' + DetLink.href + '" border="0" alt=""></TD></TR>';
  htm += '</TABLE></TD></TR></TABLE>';
  for(l=t=0, p=document.images[0]; (p!=null)&&(p!=p.parentNode); p=p.parentNode) 
    if ((p.nodeName=='TABLE') && (p.offsetLeft)) { l+=p.offsetLeft; t+=p.offsetTop; }
  if (Detail) 
    obj = Detail; 
  else 
  { frm = document.createElement('DIV');
    with (document.body)
    { w = (clientWidth  > scrollWidth) ? clientWidth : scrollWidth;
      h = (clientHeight > scrollHeight)? clientHeight: scrollHeight;
    }
    frm.id = 'ImgCanvas';
    frm.style.top        = '0px';
    frm.style.left       = '0px';
    frm.style.width      = w  + 'px';
    frm.style.height     = h + 'px';
    frm.style.clip       = 'rect(0px ' + w + 'px ' + h + 'px 0px)';
    frm.style.position   = 'absolute';
    //frm.style.zIndex     = 6; 
    frm.style.visibility = 'visible';
    frm.style.overflow   = 'hidden';
    document.body.appendChild(frm);
    DetailFrame=frm;
    obj = document.createElement('DIV');
  }
  obj.id               = 'ImgDetail';
  obj.innerHTML        = htm;
  if ((Detail) && (DetailValue.Lock))
  { obj.style.left = DetailValue.StartX + 'px';
    obj.style.top  = DetailValue.StartY + 'px';
  }
  else
  { obj.style.left = l + document.body.scrollLeft + 'px';
    obj.style.top  = ((document.body.scrollTop>32+t)?document.body.scrollTop:(32 + t))  + 'px';
  }
  obj.style.position   = 'absolute';
  //obj.style.zIndex     = 7;
  obj.style.visibility = 'visible';
  DetailFrame.style.visibility = 'hidden';
  if (! Detail) { DetailFrame.appendChild(obj); Detail = obj; }
  document.onmousedown=DetailMove1;
  DetailValue.MaxX=document.body.scrollWidth-128;
  DetailValue.MaxY=document.body.scrollHeight-128;
  return false;
}

function DetailHide(m)
{ Detail.style.visibility = 'hidden';
  DetailFrame.style.visibility = 'hidden';
  if (m) {Detail.style.left = 0 + 'px';  Detail.style.top  = 0 + 'px'; DetailValue.Lock = false;}
}
function DetailMove1(e) 
{ if (! e) e = event; if (! e) return false;
  if ((e.srcElement) && (e.srcElement.id=='ImgMover') 
  || (e.target) && (e.target.id=="ImgMover"))
  { DetailValue.MouseX=e.clientX; DetailValue.StartX=parseInt(Detail.style.left);
    DetailValue.MouseY=e.clientY; DetailValue.StartY=parseInt(Detail.style.top);
    document.onmousemove=DetailMove2;
    document.onmouseup=DetailMove3;
  }
}
function DetailMove2(e) 
{ var NewX, NewY;
  if (! e) e = event; if (! e) return false;
  NewX=DetailValue.StartX+e.clientX-DetailValue.MouseX; if ((NewX<DetailValue.MaxX)&&(NewX>0)) Detail.style.left= NewX + 'px';
  NewY=DetailValue.StartY+e.clientY-DetailValue.MouseY; if ((NewY<DetailValue.MaxY)&&(NewY>0)) Detail.style.top = NewY + 'px';
  return false;
}
function DetailMove3(e) 
{ DetailValue.StartX=parseInt(Detail.style.left);
  DetailValue.StartY=parseInt(Detail.style.top);
  DetailValue.Lock=true;
  document.onmousemove=null;
  document.onmouseup=null;
}
