|
|||
var strAgent = navigator.userAgent.toLowerCase(); var bIE = (strAgent.indexOf("msie") != -1); var bXP = (strAgent.indexOf("nt 5.1") != -1); var bIE7 = (strAgent.indexOf("msie 7.0") != -1);
var bSafari = (strAgent.indexOf("konqueror") != -1 || strAgent.indexOf("safari") != -1); var bFirefox = (strAgent.indexOf("firefox")!= -1); var bOpera = (strAgent.indexOf("opera") > -1);
var Dom = new Object;
Dom.getLocation = function (el) { var c = { x : 0, y : 0 }; while (el) { c.x += el.offsetLeft; c.y += el.offsetTop; el = el.offsetParent; } return c; };
var Event_moo = new Object;
Event_moo.getTarget = function (event) { var oElement; if (event.srcElement) { oElement = event.srcElement; } else { oElement = event.target; } return oElement; };
var iBoomToX = 120; // 189 var iBoomTimeoutId; var iBoomOriginW; var oBoomCurObj; var iBoomCount = 0; var iBoomSpeed = 3; var iBoomTop
function showOriginImage(event, boomSort, imgSrc, imgLink) { clearTimeout(iBoomTimeoutId); iBoomCount = 0;
var oDivShow = document.getElementById("divShowImage"); var oTarget= Event_moo.getTarget(event); var width= oTarget.width; var height= oTarget.height; var oEventXY = Dom.getLocation(oTarget); var nLocalX= event.clientX - oEventXY.x; var nLocalY= event.clientY - oEventXY.y; //alert(oEventXY.y); var iLocalCenterX = event.clientX + (width - nLocalX); var iLocalCenterY = event.clientY + (height - nLocalY); var iX
oDivShow.style.left = (iLocalCenterX - width - iX"px"; oDivShow.style.top = (iLocalCenterY - height) - iBoomTop"px"; oDivShow.style.width = width - 1 + "px"; oDivShow.style.height= height - 2 + 70 + "px"; oDivShow.style.visibility = "visible"; iBoomOriginW = width; var sBUrl = (oTarget.bsrc != undefined)? oTarget.bsrc : oTarget.src; var sBUrl = imgSrc;
oCur = oDivShow boomUp(120, 300, boomSort); }
function boomUp(w, h, boomSort) {
iBoomCount++; oCur.style.width = (parseInt(oCur.style.width) + iBoomSpeed) + "px";
switch(boomSort) { case "center": if ((iBoomCount % 2) != 0) break; case "right": oCur.style.left = (parseInt(oCur.style.left) - iBoomSpeed) + "px"; break; }
if (parseInt(oCur.style.width) < iBoomToX)
iBoomTimeoutId = setTimeout("boomUp("+w+","+h+",'"+boomSort+"')", 10);
}