function CTransPopupWindow(a_oTransManager, a_szTableID, a_szCellID, a_szCloseClassName)
{ var m_oTransManager = a_oTransManager; this.m_oTransManager = m_oTransManager; var m_szTableID = a_szTableID; this.m_szTableID = m_szTableID; var m_szCellID = a_szCellID; this.m_szCellID = m_szCellID; var m_szCloseClassName = a_szCloseClassName; this.m_szCloseClassName = m_szCloseClassName; var m_iLeftOffset = 16; this.m_iLeftOffset = m_iLeftOffset; var m_iTopOffset = 17; this.m_iTopOffset = m_iTopOffset; var m_iTop = null; this.m_iTop = m_iTop; var m_iLeft = null; this.m_iLeft = m_iLeft; var m_iWidth = null; this.m_iWidth = m_iWidth; var m_iHeight = null; this.m_iHeight = m_iHeight; var m_iMouseX = null; this.m_iMouseX = m_iMouseX; var m_iMouseY = null; this.m_iMouseY = m_iMouseY; var m_iCenterX = null; this.m_iCenterX = m_iCenterX; var m_iCenterY = null; this.m_iCenterY = m_iCenterY; var m_szCloseButtonUpPath = 'images/button_close_up.gif'; this.m_szCloseButtonUpPath = m_szCloseButtonUpPath; var m_szCloseButtonHoverPath = 'images/button_close_hover.gif'; this.m_szCloseButtonHoverPath = m_szCloseButtonHoverPath; var m_oTable = ei(m_szTableID); var m_oCell = ei(m_szCellID); var m_cTransAccelWidth = new CTransAccel(0); var m_cTransAccelHeight = new CTransAccel(0); var m_cTransAccelTop = new CTransAccel(0); var m_cTransAccelLeft = new CTransAccel(0); var m_iSlideToInterval = 25; var m_iSlideToID = -1; var m_iExpandToInterval = 25; var m_iExpandToID = -1; var m_iFadeInInterval = 25; var m_iFadeInID = -1; var m_iFadeOutInterval = 25; var m_iFadeOutID = -1; var m_iAlphaDelta = 10; var m_iResizeToID = -1; var m_iResizeToInterval = 25; if(m_oTable)
{ if(ns6)
{ if(m_oTable.style.MozOpacity)
{ m_oTable.style.MozOpacity = 1;}
else
{ m_oTable.style.cssText += ';-moz-opacity:1;';}
}
else if(m_oTable.filters && m_oTable.filters.alpha)
{ m_oTable.filters.alpha.opacity = 100;}
else
{ m_oTable.style.cssText += ';filter:alpha(opacity=100)';}
if(m_szCloseClassName)
{ var oCollection = etc("td", m_szCloseClassName); if(oCollection)
{ for(var i = 0; i < oCollection.length; i++)
{ oCollection[i].onmouseover = itemMouseOver; oCollection[i].onmouseout = itemMouseOut;}
}
}
}
function getContainer()
{ return m_oTable;}
this.getContainer = getContainer; function isVisible()
{ if(!m_oTable) return null; if('none' == m_oTable.style.display)
{ return false;}
return true;}
this.isVisible = isVisible; function isHidden()
{ return !isVisible();}
this.isHidden = isHidden; function hide()
{ if(!m_oTable) return; m_oTable.style.display = 'none'; if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
this.hide = hide; function show()
{ if(!m_oTable) return; m_oTable.style.display = 'block'; if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
this.show = show; function moveCenterToMouse()
{ if(null == this.m_iMouseX) return; if(null == this.m_iMouseY) return; moveCenter(this.m_iMouseX, this.m_iMouseY);}
this.moveCenterToMouse = moveCenterToMouse; function setTransparency(a_newAlphaValue)
{ if(!m_oTable) return; if(null == a_newAlphaValue) return; setAlpha(m_oTable,a_newAlphaValue); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
this.setTransparency = setTransparency; function fadeIn()
{ stop(); m_iFadeInID = setTimeout(__fadeIn,m_iFadeInInterval);}
this.fadeIn = fadeIn; function fadeOut()
{ stop(); m_iFadeOutID = setTimeout(__fadeOut,m_iFadeOutInterval);}
this.fadeOut = fadeOut; function maximize()
{ resize(this.m_iTop, this.m_iLeft, this.m_iWidth, this.m_iHeight);}
this.maximize = maximize; function minimize()
{ resize(this.m_iCenterY - m_iTopOffset, this.m_iCenterX - m_iLeftOffset, 0, 0);}
this.minimize = minimize; function maximizeTo()
{ resizeTo(this.m_iTop, this.m_iLeft, this.m_iWidth, this.m_iHeight);}
this.maximizeTo = maximizeTo; function minimizeTo()
{ resizeTo(this.m_iCenterY - m_iTopOffset, this.m_iCenterX - m_iLeftOffset, 0, 0);}
this.minimizeTo = minimizeTo; function minimizeToMouse()
{ resizeTo(this.m_iMouseY - m_iTopOffset, this.m_iMouseX- m_iLeftOffset, 0, 0);}
this.minimizeToMouse = minimizeToMouse; function slideToCenter()
{ slideTo(this.m_iCenterY - m_iTopOffset, this.m_iCenterX - m_iLeftOffset);}
this.slideToCenter = slideToCenter; function slideTo(a_iTop, a_iLeft)
{ if(!m_oTable) return; if(!m_oCell) return; if(null == a_iTop) return; if(null == a_iLeft) return; m_oTable.style.lastTop = parseInt(m_oTable.style.top); m_oTable.style.lastLeft = parseInt(m_oTable.style.left); m_oTable.style.finalTop = a_iTop; m_oTable.style.finalLeft = a_iLeft; var iTopDistance = Math.abs(m_oTable.style.finalTop - m_oTable.style.lastTop); var iLeftDistance = Math.abs(m_oTable.style.finalLeft - m_oTable.style.lastLeft); if( Math.abs(iTopDistance - iLeftDistance) == 0 )
{ if(m_oTransManager)
{ m_oTransManager.continueSequence();}
return;}
stop(); m_cTransAccelTop.run(iTopDistance); m_cTransAccelLeft.run(iLeftDistance); m_iSlideToID = setTimeout(__slideTo,m_iSlideToInterval);}
function stop()
{ if(-1 != m_iSlideToID)
{ clearTimeout(m_iSlideToID); m_iSlideToID = -1;}
if(-1 != m_iExpandToID)
{ clearTimeout(m_iExpandToID); m_iExpandToID = -1;}
if(-1 != m_iResizeToID)
{ clearTimeout(m_iResizeToID); m_iResizeToID = -1;}
if(-1 != m_iFadeInID)
{ clearTimeout(m_iFadeInID); m_iFadeInID = -1;}
if(-1 != m_iFadeOutID)
{ clearTimeout(m_iFadeOutID); m_iFadeOutID = -1;}
}
function __slideTo()
{ if(m_cTransAccelTop.isDone() && m_cTransAccelLeft.isDone() )
{ stop(); setTop(m_oTable.style.finalTop); setLeft(m_oTable.style.finalLeft); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
return;}
var iTopDistanceTraveled = m_cTransAccelTop.getDistanceTraveled(); var iLeftDistanceTraveled = m_cTransAccelLeft.getDistanceTraveled(); if(m_oTable.style.finalLeft > m_oTable.style.lastLeft)
{ setLeft(m_oTable.style.lastLeft-0 + iLeftDistanceTraveled);}
else
{ setLeft(m_oTable.style.lastLeft - iLeftDistanceTraveled);}
if(m_oTable.style.finalTop > m_oTable.style.lastTop)
{ setTop(m_oTable.style.lastTop-0 + iTopDistanceTraveled);}
else
{ setTop(m_oTable.style.lastTop - iTopDistanceTraveled);}
m_iSlideToID = setTimeout(__slideTo, m_iSlideToInterval);}
function __expandTo()
{ if(m_cTransAccelWidth.isDone() && m_cTransAccelHeight.isDone() )
{ stop(); setWidth(m_oCell.style.finalWidth); setHeight(m_oCell.style.finalHeight); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
return;}
var xDistanceTraveled = m_cTransAccelWidth.getDistanceTraveled(); var yDistanceTraveled = m_cTransAccelHeight.getDistanceTraveled(); if(m_oCell.style.finalWidth > m_oCell.style.lastWidth)
{ setWidth(m_oCell.style.lastWidth-0 + xDistanceTraveled);}
else
{ setWidth(m_oCell.style.lastWidth - xDistanceTraveled);}
if(m_oCell.style.finalHeight > m_oCell.style.lastHeight)
{ setHeight(m_oCell.style.lastHeight-0 + yDistanceTraveled);}
else
{ setHeight(m_oCell.style.lastHeight - yDistanceTraveled);}
m_iExpandToID = setTimeout(__expandTo, m_iExpandToInterval);}
function itemMouseOver(a_e)
{ var oe = getElementFromEvent(a_e); if(!oe) return; if(!oe.savedColor)
{ oe.savedColor = getStyle(oe, 'color'); var itemMouseOverColor = new HSL(oe.savedColor)
oe.itemMouseOverColor = itemMouseOverColor.brightness(-0.667);}
oe.style.color = oe.itemMouseOverColor; oe.style.backgroundImage = "url("+m_szCloseButtonHoverPath+")";}
function itemMouseOut(a_e)
{ var oe = getElementFromEvent(a_e); if(!oe) return; if(oe.savedColor)
{ oe.style.color = oe.savedColor;}
oe.style.backgroundImage = "url("+m_szCloseButtonUpPath+")";}
function moveCenter(a_x, a_y)
{ move(a_x - m_iLeftOffset, a_y - m_iTopOffset);}
function move(a_x, a_y)
{ if(!m_oTable) return; if(null == a_x) return; if(null == a_y) return; a_x = parseInt(a_x); a_y = parseInt(a_y); setTop(a_y); setLeft(a_x); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
function expandTo(a_iWidth, a_iHeight)
{ if(!m_oTable) return; if(!m_oCell) return; if(null == a_iWidth) return; if(null == a_iHeight) return; a_iWidth = parseInt(a_iWidth); a_iHeight = parseInt(a_iHeight); var iWidth = parseInt(m_oCell.style.width); var iHeight = parseInt(m_oCell.style.height); m_oCell.style.lastWidth = iWidth; m_oCell.style.lastHeight = iHeight; m_oCell.style.finalWidth = a_iWidth; m_oCell.style.finalHeight = a_iHeight; var xDistance = Math.abs(iWidth - a_iWidth); var yDistance = Math.abs(iHeight - a_iHeight); if( Math.abs(yDistance - xDistance) == 0)
{ if(m_oTransManager)
{ m_oTransManager.continueSequence();}
return;}
stop(); m_cTransAccelWidth.run(xDistance); m_cTransAccelHeight.run(yDistance); m_iExpandToID = setTimeout(__expandTo,m_iExpandToInterval);}
function resize(a_iTop, a_iLeft, a_iWidth, a_iHeight)
{ if(!m_oTable) return; if(!m_oCell) return; if(null == a_iTop) return; if(null == a_iLeft) return; if(null == a_iWidth) return; if(null == a_iHeight) return; setTop(a_iTop); setLeft(a_iLeft); setWidth(a_iWidth); setHeight(a_iHeight); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
function __resizeTo()
{ if(m_cTransAccelWidth.isDone() && m_cTransAccelHeight.isDone() &&
m_cTransAccelTop.isDone() && m_cTransAccelLeft.isDone() )
{ stop(); setTop(m_oTable.style.finalTop); setLeft(m_oTable.style.finalLeft); setWidth(m_oCell.style.finalWidth); setHeight(m_oCell.style.finalHeight); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
return;}
var iTopDistanceTraveled = m_cTransAccelTop.getDistanceTraveled(); var iLeftDistanceTraveled = m_cTransAccelLeft.getDistanceTraveled(); var iWidthDistanceTraveled = m_cTransAccelWidth.getDistanceTraveled(); var iHeightDistanceTraveled = m_cTransAccelHeight.getDistanceTraveled(); if(m_oTable.style.finalLeft > m_oTable.style.lastLeft)
{ setLeft(m_oTable.style.lastLeft-0 + iLeftDistanceTraveled);}
else
{ setLeft(m_oTable.style.lastLeft - iLeftDistanceTraveled);}
if(m_oTable.style.finalTop > m_oTable.style.lastTop)
{ setTop(m_oTable.style.lastTop-0 + iTopDistanceTraveled);}
else
{ setTop(m_oTable.style.lastTop - iTopDistanceTraveled);}
if(m_oCell.style.finalWidth > m_oCell.style.lastWidth)
{ setWidth(m_oCell.style.lastWidth-0 + iWidthDistanceTraveled);}
else
{ setWidth(m_oCell.style.lastWidth - iWidthDistanceTraveled);}
if(m_oCell.style.finalHeight > m_oCell.style.lastHeight)
{ setHeight(m_oCell.style.lastHeight-0 + iHeightDistanceTraveled);}
else
{ setHeight(m_oCell.style.lastHeight - iHeightDistanceTraveled);}
m_iResizeToID = setTimeout(__resizeTo, m_iResizeToInterval);}
function resizeTo(a_iTop, a_iLeft, a_iWidth, a_iHeight)
{ if(!m_oTable) return; if(!m_oCell) return; if(null == a_iTop) return; if(null == a_iLeft) return; if(null == a_iWidth) return; if(null == a_iHeight) return; m_oTable.style.lastTop = parseInt(m_oTable.style.top); m_oTable.style.lastLeft = parseInt(m_oTable.style.left); m_oCell.style.lastWidth = parseInt(m_oCell.style.width); m_oCell.style.lastHeight = parseInt(m_oCell.style.height); m_oTable.style.finalTop = a_iTop; m_oTable.style.finalLeft = a_iLeft; m_oCell.style.finalWidth = a_iWidth; m_oCell.style.finalHeight = a_iHeight; var iTopDistance = Math.abs(m_oTable.style.finalTop - m_oTable.style.lastTop); var iLeftDistance = Math.abs(m_oTable.style.finalLeft - m_oTable.style.lastLeft); var iWidthDistance = Math.abs(m_oCell.style.finalWidth - m_oCell.style.lastWidth); var iHeightDistance = Math.abs(m_oCell.style.finalHeight - m_oCell.style.lastHeight); if( (iLeftDistance-0 + iTopDistance-0 + iWidthDistance-0 + iHeightDistance-0) == 0 )
{ if(m_oTransManager)
{ m_oTransManager.continueSequence();}
return;}
stop(); m_cTransAccelTop.run(iTopDistance); m_cTransAccelLeft.run(iLeftDistance); m_cTransAccelWidth.run(iWidthDistance); m_cTransAccelHeight.run(iHeightDistance); m_iResizeToID = setTimeout(__resizeTo, m_iResizeToInterval);}
function setTop(a_iTop)
{ m_oTable.style.top = parseInt(a_iTop);}
function setLeft(a_iLeft)
{ m_oTable.style.left = parseInt(a_iLeft);}
function setWidth(a_iWidth)
{ a_iWidth = parseInt(a_iWidth); if(a_iWidth >= 0)
{ m_oCell.style.width = a_iWidth;}
}
function setHeight(a_iHeight)
{ a_iHeight = parseInt(a_iHeight); if(a_iHeight >= 0)
{ m_oCell.style.height = a_iHeight;}
}
function __fadeIn()
{ if(!m_oTable) return; var iCurrentAlpha = getAlpha(m_oTable); iCurrentAlpha += m_iAlphaDelta; setAlpha(m_oTable,iCurrentAlpha); if(iCurrentAlpha < 100)
{ m_iFadeInID = setTimeout(__fadeIn,m_iFadeInInterval);}
else
{ stop(); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
}
function __fadeOut()
{ if(!m_oTable) return; var iCurrentAlpha = getAlpha(m_oTable); iCurrentAlpha -= m_iAlphaDelta; setAlpha(m_oTable,iCurrentAlpha); if(iCurrentAlpha > 0)
{ m_iFadeOutID = setTimeout(__fadeOut,m_iFadeOutInterval);}
else
{ stop(); if(m_oTransManager)
{ m_oTransManager.continueSequence();}
}
}
}
