// Author: Jaime Bueza & Eric Puchmayr //var imgArray = new Array(); //Stack of images we want to preload (the enlarged view); //http://forum.mootools.net/viewtopic.php?pid=16321 //unfortunately mootools will have to be modified or updated to work properly in ie7 window.addEvent('domready', function(evt) { var anchors = $$('#games li a'); anchors.each(function(element) { //element is an anchor var img = $E("img", element); //Find the first img within the anchor tag. var startHeight = 243; var startWidth = 116; var targetHeight = Math.round(startHeight*1.25); var targetWidth = Math.round(startWidth*1.25); img.oldSrc = img.src; img.newSrc = img.src.replace(/.png/g, "_large.png"); //Strip out .png and add _large.png var fx = new Fx.Styles(img, { duration: 150, wait: false }); //element.onmouseover = function(evt) { element.addEvent('mouseover', function(evt){ fx.start({ "height": targetHeight, "width": targetWidth, "margin-left": -((targetWidth)-(startWidth))/2, //"margin-right": -((targetWidth)-(startWidth))/2, //"margin-top": -((targetHeight)-(startHeight))/2, "margin-top": -12 //"margin-bottom": -((targetHeight)-(startHeight))/2 }); //Swap to higher rez verison of the image img.src = img.newSrc; }); element.addEvent('mouseout', function(evt){ fx.start({ "height": startHeight, "width": startWidth, "margin-left": 0, "margin-top": 0 }); //Return the old source to the img img.src = img.oldSrc; }); element.addEvent('click', function(evt){ evt = new Event(evt).stop(); var url = "/eaallplay/components/games.jsp?gameId="+this.id; new Ajax(url, { method: 'get', evalScripts: true, update: $('content') }).request(); }); }); });