     var ajxx = {
     
     graphicsDir : '../assets/',
     restoreCursor : "zoomout.cur", 
     expandSteps : 10, 
     expandDuration : 250, 
     restoreSteps : 10,
     restoreDuration : 250,
     allowMultipleInstances: true,
     hideThumbOnExpand : true,
     captionSlideSpeed : 1, 
     outlineWhileAnimating : false, 
     outlineStartOffset : 3, 
     marginLeft : 10,
     marginRight : 35, 
     marginTop : 10,
     marginBottom : 35, 
     numberOfImagesToPreload : 5,
     zIndexCounter : 1001, 
     fullExpandIcon : 'fullexpand.gif',
     fullExpandTitle : 'View full size',
     restoreTitle : 'Click to close image, click and drag to move. Use arrow keys for next and previous.',
     focusTitle : 'Click to bring to front',
     loadingText : 'Loading...',
     loadingTitle : 'Click to cancel',
     loadingOpacity : 0.75,
     showCredits : false, 
     creditsText : 'Integrated by: <i>Eurekapoint Web Solutions</i>',
     creditsHref : 'http://www.eurekapoint.com',
     creditsTitle : 'Go to the eurekapoint.com',
     enableKeyListener : true,
     
     
     anchor : 'auto', 
     align : 'auto', 
     targetX: null, 
     targetY: null,
     captionId : null,
     captionTemplateId : null,
     slideshowGroup : null, 
     spaceForCaption : 30, 
     minWidth: 200,
     minHeight: 200,
     allowSizeReduction: true,
     outlineType : 'drop-shadow', 
     wrapperClassName : null, 
     
     
     preloadTheseImages : [],
     continuePreloading: true,
     expandedImagesCounter : 0,
     expanders : [],
     overrides : [
     	'anchor',
     	'align',
     	'targetX',
     	'targetY',
     	'outlineType',
     	'outlineWhileAnimating',
     	'spaceForCaption', 
     	'wrapperClassName',
     	'minWidth',
     	'minHeight',
     	'captionId',
     	'captionTemplateId',
     	'allowSizeReduction',
     	'slideshowGroup'
     ],
     overlays : [],
     pendingOutlines : {},
     clones : {},
     faders : [],
     ie : (document.all && !window.opera),
     safari : navigator.userAgent.indexOf("Safari") != -1,
     hasFocused : false,
     
        $ : function (id) {
        	return document.getElementById(id);
        },
        
        push : function (arr, val) {
        	arr[arr.length] = val;
        },
        
        createElement : function (tag, attribs, styles, parent, nopad) {
        	var el = document.createElement(tag);
        	if (attribs) ajxx.setAttribs(el, attribs);
        	if (nopad) ajxx.setStyles(el, {padding: 0, border: 'none', margin: 0});
        	if (styles) ajxx.setStyles(el, styles);
        	if (parent) parent.appendChild(el);	
        	return el;
        },
        
        setAttribs : function (el, attribs) {
        	for (var x in attribs) {
        		el[x] = attribs[x];
        	}
        },
        
        setStyles : function (el, styles) {
        	for (var x in styles) {
        		try { 
        			if (ajxx.ie && x == 'opacity') el.style.filter = 'alpha(opacity='+ (styles[x] * 100) +')';
        			else el.style[x] = styles[x]; 
        		}
        		catch (e) {}
        	}
        },
        
        ieVersion : function () {
        	arr = navigator.appVersion.split("MSIE");
        	return parseFloat(arr[1]);
        },
        
        clientInfo : function ()	{
        	var iebody = document.compatMode && document.compatMode != "BackCompat" 
        		? document.documentElement : document.body;
        	
        	this.width = ajxx.ie ? iebody.clientWidth : self.innerWidth;
        	this.height = ajxx.ie ? iebody.clientHeight : self.innerHeight;
        	this.scrollLeft = ajxx.ie ? iebody.scrollLeft : pageXOffset;
        	this.scrollTop = ajxx.ie ? iebody.scrollTop : pageYOffset;
        } ,
        
        position : function(el)	{ 
        	var parent = el;	
        	var p = { x: parent.offsetLeft, y: parent.offsetTop };
        	while (parent.offsetParent)	{
        		parent = parent.offsetParent;
        		p.x += parent.offsetLeft;
        		p.y += parent.offsetTop;
        		if (parent != document.body && parent != document.documentElement) {
        			p.x -= parent.scrollLeft;
        			p.y -= parent.scrollTop;
        		}
        	}
        	return p;
        },
        
        expand : function(a, params, custom) {
        	try {
        		new ajxxExpander(a, params, custom);
        		return false;		
        	} catch (e) { return true; }	
        },
        
        focusTopmost : function() {
        	var topZ = 0, topmostKey = -1;
        	for (i = 0; i < ajxx.expanders.length; i++) {
        		if (ajxx.expanders[i]) {
        			if (ajxx.expanders[i].wrapper.style.zIndex && ajxx.expanders[i].wrapper.style.zIndex > topZ) {
        				topZ = ajxx.expanders[i].wrapper.style.zIndex;
        				
        				topmostKey = i;
        			}
        		}
        	}
        	if (topmostKey == -1) ajxx.focusKey = -1;
        	else ajxx.expanders[topmostKey].focus();
        },
        
        closeId : function(id) { 
        	return ajxx.close(id);
        },
        
        close : function(el) {
        	try { ajxx.getExpander(el).doClose(); } catch (e) {}
        	return false;
        },
        
        getAdjacentAnchor : function(key, op) {
        	var aAr = document.getElementsByTagName('A'), ajxxAr = {}, activeI = -1, j = 0;
        	for (i = 0; i < aAr.length; i++) {
        		if (ajxx.isajxxAnchor(aAr[i]) && ((ajxx.expanders[key].slideshowGroup == ajxx.getParam(aAr[i], 'slideshowGroup')))) {
        			ajxxAr[j] = aAr[i];
        			if (ajxx.expanders[key] && aAr[i] == ajxx.expanders[key].a) {
        				activeI = j;
        			}
        			j++;
        		}
        	}
        	return ajxxAr[activeI + op];
        },
        
        getParam : function (a, param) {
        	try {
        		var s = a.onclick.toString().replace(/\s/g, ' ').split('{')[2].split('}')[0];
        		if (ajxx.safari) { 
        			for (var i = 0; i < ajxx.overrides.length; i++) {
        				s = s.replace(ajxx.overrides[i] +':', ','+ ajxx.overrides[i] +':').replace(new RegExp("^\\s*?,"), '');
        			}
        		}
        		eval('var arr = {'+ s +'};');
        		if (arr[param]) return arr[param];
        		else return ajxx[param];
        	} catch (e) {
        		return ajxx[param];
        	}
        },
        
        getSrc : function (a) {
        	var src = ajxx.getParam(a, 'src');
        	if (src) return src;
        	return a.rel.replace(/_slash_/g, '/') || a.href;
        },
        
        getNode : function (id) {
        	var node = ajxx.$(id), clone = ajxx.clones[id], a = {};
        	if (!node && !clone) return null;
        	if (!clone) {
        		clone = node.cloneNode(true);
        		clone.id = '';
        		ajxx.clones[id] = clone;
        		return node;
        	} else {
        		return clone.cloneNode(true);
        	}
        },
        
        purge : function(d) {
        	if (!ajxx.ie) return;
        	var a = d.attributes, i, l, n;
            if (a) {
                l = a.length;
                for (i = 0; i < l; i += 1) {
                    n = a[i].name;
                    if (typeof d[n] === 'function') {
                        d[n] = null;
                    }
                }
            }
            if (ajxx.geckoBug && ajxx.geckoBug(d)) return;
        	a = d.childNodes;
            if (a) {
                l = a.length;
                for (i = 0; i < l; i += 1) {
                    ajxx.purge(d.childNodes[i]);
                }
            }
        },
        
        previousOrNext : function (el, op) {
        	var exp = ajxx.getExpander(el);	
        	try { ajxx.getAdjacentAnchor(exp.key, op).onclick(); } catch (e) {}
        	try { exp.doClose(); } catch (e) {}	
        	return false;
        },
        
        previous : function (el) {
        	return ajxx.previousOrNext(el, -1);
        },
        
        next : function (el) {
        	return ajxx.previousOrNext(el, 1);	
        },
        
        keyHandler : function(e) {
        	if (!e) e = window.event;
        	if (!e.target) e.target = e.srcElement; 
        	if (e.target.form) return; 
        	
        	var op = null;
        	switch (e.keyCode) {
        		case 34: 
        		case 39: 
        		case 40: 
        			op = 1;
        			break;
        		case 33: 
        		case 37: 
        		case 38: 
        			op = -1;
        			break;
        		case 27: 
        		case 13: 
        			op = 0;
        	}
        	if (op !== null) {
        		ajxx.removeEventListener(document, 'keydown', ajxx.keyHandler);
        		try { if (!ajxx.enableKeyListener) return true; } catch (e) {}
        		
        		if (e.preventDefault) e.preventDefault();
            	else e.returnValue = false;
        		if (op == 0) {
        			try { ajxx.getExpander().doClose(); } catch (e) {}
        			return false;
        		} else {
        			return ajxx.previousOrNext(ajxx.focusKey, op);
        		}
        	} else return true;
        },
        
        registerOverlay : function (overlay) {
        	ajxx.push(ajxx.overlays, overlay);
        },
        
        getWrapperKey : function (element) {
        	var el, re = /^ajaxx-wrapper-([0-9]+)$/;
        	
        	el = element;
        	while (el.parentNode)	{
        		el = el.parentNode;
        		if (el.id && el.id.match(re)) return el.id.replace(re, "$1");
        	}
        	
        	el = element;
        	while (el.parentNode)	{
        		if (el.tagName && ajxx.isajxxAnchor(el)) {
        			for (key = 0; key < ajxx.expanders.length; key++) {
        				exp = ajxx.expanders[key];
        				if (exp && exp.a == el) return key;
        			}
        		}
        		el = el.parentNode;
        	}
        },
        
        getExpander : function (el) {
        	try {
        		if (!el) return ajxx.expanders[ajxx.focusKey];
        		if (typeof el == 'number') return ajxx.expanders[el];
        		if (typeof el == 'string') el = ajxx.$(el);
        		return ajxx.expanders[ajxx.getWrapperKey(el)];
        	} catch (e) {}
        },
        
        cleanUp : function () {
        	for (i = 0; i < ajxx.expanders.length; i++) {
        		if (ajxx.expanders[i] && ajxx.expanders[i].isExpanded) ajxx.focusTopmost();
        	}
        },
        
        mouseClickHandler : function(e) 
        {	
        	if (!e) e = window.event;
        	if (e.button > 1) return true;
        	if (!e.target) e.target = e.srcElement;
        	if (e.target.form) return;
        	
        	var fobj = e.target;
        	while (fobj.parentNode
        		&& !(fobj.className && fobj.className.match(/ajaxx-(image|move|html)/)))
        	{
        		fobj = fobj.parentNode;
        	}
        
        	if (!fobj.parentNode) return;
        	
        	ajxx.dragExp = ajxx.getExpander(fobj);
        	
        	if (fobj.className.match(/ajaxx-(image|move)/)) {
        		var isDraggable = true;
        		var wLeft = parseInt(ajxx.dragExp.wrapper.style.left);
        		var wTop = parseInt(ajxx.dragExp.wrapper.style.top);			
        	}
        
        	if (e.type == 'mousedown') {
        		if (isDraggable) 
        		{
        			if (fobj.className.match('ajaxx-image')) ajxx.dragExp.content.style.cursor = 'move';
        			
        			ajxx.wLeft = wLeft;
        			ajxx.wTop = wTop;
        			
        			ajxx.dragX = e.clientX;
        			ajxx.dragY = e.clientY;
        			ajxx.addEventListener(document, 'mousemove', ajxx.mouseMoveHandler);
        			if (e.preventDefault) e.preventDefault(); 
        			
        			if (ajxx.dragExp.content.className.match(/ajaxx-(image|html)-blur/)) {
        				ajxx.dragExp.focus();
        				ajxx.hasFocused = true;
        			}
        			return false;
        		}
        		else if (fobj.className.match(/ajaxx-html/)) { 
        			ajxx.dragExp.focus();
        			ajxx.dragExp.redoShowHide();
        			ajxx.hasFocused = false;
        		}
        		
        	} else if (e.type == 'mouseup') {
        		ajxx.removeEventListener(document, 'mousemove', ajxx.mouseMoveHandler);
        		if (isDraggable && ajxx.dragExp) {
        			if (fobj.className.match('ajaxx-image')) {
        				fobj.style.cursor = ajxx.styleRestoreCursor;
        			}
        			var hasMoved = wLeft != ajxx.wLeft || wTop != ajxx.wTop;
        			if (!hasMoved && !ajxx.hasFocused && !fobj.className.match(/ajaxx-move/)) {
        				ajxx.dragExp.onClick();
        			} else if (hasMoved || (!hasMoved && ajxx.hasHtmlexpanders)) {
        				ajxx.dragExp.redoShowHide();
        			}
        			ajxx.hasFocused = false;
        		
        		} else if (fobj.className.match('ajaxx-image-blur')) {
        			fobj.style.cursor = ajxx.styleRestoreCursor;		
        		}
        	}
        },
        
        mouseMoveHandler : function(e)
        {
        	if (!ajxx.dragExp || !ajxx.dragExp.wrapper) return;
        	if (!e) e = window.event;
        
        	ajxx.dragExp.x.min = ajxx.wLeft + e.clientX - ajxx.dragX;
        	ajxx.dragExp.y.min = ajxx.wTop + e.clientY - ajxx.dragY;
        	
        	var w = ajxx.dragExp.wrapper;
        	
        	w.style.left = ajxx.dragExp.x.min +'px';
        	w.style.top  = ajxx.dragExp.y.min +'px';
        	
        	if (ajxx.dragExp.objOutline) {
        		var o = ajxx.dragExp.objOutline;
        		o.table.style.left = (ajxx.dragExp.x.min - o.offset) +'px';
        		o.table.style.top = (ajxx.dragExp.y.min - o.offset) +'px';
        	}	
        	return false;
        },
        
        addEventListener : function (el, event, func) {
        	try {
        		el.addEventListener(event, func, false);
        	} catch (e) {
        		try {
        			el.detachEvent('on'+ event, func);
        			el.attachEvent('on'+ event, func);
        		} catch (e) {
        			el['on'+ event] = func;
        		}
        	} 
        },
        
        removeEventListener : function (el, event, func) {
        	try {
        		el.removeEventListener(event, func, false);
        	} catch (e) {
        		try {
        			el.detachEvent('on'+ event, func);
        		} catch (e) {
        			el['on'+ event] = null;
        		}
        	}
        },
        
        isajxxAnchor : function (a) {
        	return (a.onclick && a.onclick.toString().replace(/\s/g, ' ').match(/ajxx.(htmlE|e)xpand/));
        },
        
        preloadFullImage : function (i) {
        	if (ajxx.continuePreloading && ajxx.preloadTheseImages[i] && ajxx.preloadTheseImages[i] != 'undefined') {
        		var img = document.createElement('img');
        		img.onload = function() { ajxx.preloadFullImage(i + 1); };
        		img.src = ajxx.preloadTheseImages[i];
        	}
        },
        
        preloadImages : function (number) {
        	if (number && typeof number != 'object') ajxx.numberOfImagesToPreload = number;
        	var re, j = 0;
        	
        	var aTags = document.getElementsByTagName('A');
        	for (i = 0; i < aTags.length; i++) {
        		a = aTags[i];
        		re = ajxx.isajxxAnchor(a);
        		if (re && re[0] == 'ajxx.expand') {
        			if (j < ajxx.numberOfImagesToPreload) {
        				ajxx.preloadTheseImages[j] = ajxx.getSrc(a); 
        				j++;
        			}
        		}
        	}
        	
        	
        	new ajxxOutline(ajxx.outlineType, function () { ajxx.preloadFullImage(0)} );
        	
        	
        	var cur = ajxx.createElement('img', { src: ajxx.graphicsDir + ajxx.restoreCursor });
        },
        
        genContainer : function () {
        	if (!ajxx.container) {
        		ajxx.container = ajxx.createElement('div', 
        			null, 
        			{ position: 'absolute', left: 0, top: 0, width: '100%', zIndex: ajxx.zIndexCounter }, 
        			document.body,
        			true
        		);
        	}	
        },
        
        fade : function (el, o, oFinal, dir, i) {
        	o = parseFloat(o);
        	el.style.visibility = (o <= 0) ? 'hidden' : 'visible';
        	if (o < 0 || (dir == 1 && o > oFinal)) return;
        	if (i == null) i = ajxx.faders.length;
        	if (typeof(el.i) != 'undefined' && el.i != i) {
        		clearTimeout(ajxx.faders[el.i]);
        		o = el.tempOpacity;
        	}
        	el.i = i;
        	el.tempOpacity = o;
        	el.style.visibility = (o <= 0) ? 'hidden' : 'visible';
        	ajxx.setStyles(el, { opacity: o });
        	ajxx.faders[i] = setTimeout(function() { 
        			ajxx.fade(el, Math.round((o + 0.1 * dir)*100)/100, oFinal, dir, i);
        	 	}, 25);
        }
        }; 
        ajxxOutline = function (outlineType, onLoad) {
        	this.onLoad = onLoad;
        	this.outlineType = outlineType;
        	var v = ajxx.ieVersion(), tr;
        	
        	this.hasAlphaImageLoader = ajxx.ie && v >= 5.5 && v < 7;
        	this.hasPngSupport = !ajxx.ie || (ajxx.ie && v >= 7);
        	if (!outlineType || (!this.hasAlphaImageLoader && !this.hasPngSupport)) {
        		if (onLoad) onLoad();
        		return;
        	}
        	
        	ajxx.genContainer();
        	this.table = ajxx.createElement(
        		'table',
        		{	
        			cellSpacing: 0 
        		},
        		{
        			visibility: 'hidden',
        			position: 'absolute',
        			zIndex: ajxx.zIndexCounter++,
        			borderCollapse: 'collapse'
        		},
        		ajxx.container,
        		true
        	);
        	this.tbody = ajxx.createElement('tbody', null, null, this.table);
        	
        	this.td = Array();
        	for (var i = 0; i <= 8; i++) {
        		if (i % 3 == 0) tr = ajxx.createElement('tr', null, null, this.tbody, true);
        		this.td[i] = ajxx.createElement('td', null, null, tr, true);
        		var style = i != 4 ? { lineHeight: 0, fontSize: 0} : { position : 'relative' };
        		ajxx.setStyles(this.td[i], style);
        	}
        	this.td[4].className = outlineType;
        	
        	this.preloadGraphic(); 
        };
        
        ajxxOutline.prototype.preloadGraphic = function () {	
        	var src = ajxx.graphicsDir + "outlines/"+ this.outlineType +".png";
        				
        	var appendTo = ajxx.safari ? ajxx.container : null;
        	this.graphic = ajxx.createElement('img', null, { position: 'absolute', left: '-9999px', 
        		top: '-9999px' }, appendTo, true); 
        	
        	var pThis = this;
        	this.graphic.onload = function() { pThis.onGraphicLoad(); };
        	
        	this.graphic.src = src;
        };
        
        ajxxOutline.prototype.onGraphicLoad = function () {
        	var o = this.offset = this.graphic.width / 4;
        	var pos = [[0,0],[0,-4],[-2,0],[0,-8],0,[-2,-8],[0,-2],[0,-6],[-2,-2]];
        	for (var i = 0; i <= 8; i++) {
        		if (pos[i]) {
        			if (this.hasAlphaImageLoader) {
        				var w = (i == 1 || i == 7) ? '100%' : this.graphic.width +'px';
        				var div = ajxx.createElement('div', null, { width: '100%', height: '100%', position: 'relative', overflow: 'hidden'}, this.td[i], true);
        				ajxx.createElement ('div', null, { 
        						filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='"+ this.graphic.src + "')", 
        						position: 'absolute',
        						width: w, 
        						height: this.graphic.height +'px',
        						left: (pos[i][0]*o)+'px',
        						top: (pos[i][1]*o)+'px'
        					}, 
        				div,
        				true);
        			} else {
        				ajxx.setStyles(this.td[i], { background: 'url('+ this.graphic.src +') '+ (pos[i][0]*o)+'px '+(pos[i][1]*o)+'px'});
        			}
        			
        		
        			var dim = 2 * o;
        			ajxx.setStyles (this.td[i], { height: dim +'px', width: dim +'px' } );
        		}
        	}
        	
        	ajxx.pendingOutlines[this.outlineType] = this;
        	if (this.onLoad) this.onLoad();
        };
        
        ajxxOutline.prototype.destroy = function() {
        	ajxx.purge(this.table);
        	try { this.table.parentNode.removeChild(this.table); } catch (e) {}
        };
        
        
        ajxxExpander = function(a, params, custom, contentType) {
        	ajxx.continuePreloading = false;
        		
        	this.custom = custom;
        
        	for (i = 0; i < ajxx.overrides.length; i++) {
        		var name = ajxx.overrides[i];
        		if (params && typeof params[name] != 'undefined') this[name] = params[name];
        		else this[name] = ajxx[name];
        	}
        	
        
        	var el;
        	if (params && params.thumbnailId) el = ajxx.$(params.thumbnailId);
        	else el = a.getElementsByTagName('IMG')[0];
        	if (!el) el = a;
        	
        
        	for (i = 0; i < ajxx.expanders.length; i++) {
        		if (ajxx.expanders[i] && ajxx.expanders[i].thumb != el && !ajxx.expanders[i].onLoadStarted) {
        			ajxx.expanders[i].cancelLoading();
        		}
        	}
        
        	for (i = 0; i < ajxx.expanders.length; i++) {
        		if (ajxx.expanders[i] && ajxx.expanders[i].a == a) {
        			ajxx.expanders[i].focus();
        			return false;
        		}		
        	}
        
        	if (!ajxx.allowMultipleInstances) {
        		try { ajxx.expanders[ajxx.expandedImagesCounter - 1].doClose(); } catch (e){}
        	}
        	
        	var key = this.key = ajxx.expandedImagesCounter++;
        	ajxx.expanders[this.key] = this;
        	if (contentType == 'html') {
        		this.isHtml = true;
        		this.contentType = 'html';
        	} else {
        		this.isImage = true;
        		this.contentType = 'image';
        	}
        	this.a = a;
        	
        	this.thumbsUserSetId = el.id || a.id;
        	this.thumb = el;		
        	
        	this.overlays = [];
        
        	var pos = ajxx.position(el); 
        	
        
        	this.wrapper = ajxx.createElement(
        		'div',
        		{
        			id: 'ajaxx-wrapper-'+ this.key,
        			className: this.wrapperClassName
        		},
        		{
        			visibility: 'hidden',
        			position: 'absolute',
        			zIndex: ajxx.zIndexCounter++
        		}, null, true );
        	this.wrapper.onmouseover = function (e) { 
            	try { ajxx.expanders[key].onMouseOver(); } catch (e) {} 
            };
            this.wrapper.onmouseout = function (e) { 
            	try { ajxx.expanders[key].onMouseOut(); } catch (e) {}
        	};
        	
        
        	this.thumbWidth = el.width ? el.width : el.offsetWidth;		
        	this.thumbHeight = el.height ? el.height : el.offsetHeight;
        	this.thumbLeft = pos.x;
        	this.thumbTop = pos.y;
        	
        
        	this.thumbOffsetBorderW = (this.thumb.offsetWidth - this.thumbWidth) / 2;
        	this.thumbOffsetBorderH = (this.thumb.offsetHeight - this.thumbHeight) / 2;
        	
        
        	ajxx.genContainer();
        	if (ajxx.pendingOutlines[this.outlineType]) {
        		this.connectOutline();
        		this[this.contentType +'Create']();
        	} else if (!this.outlineType) {
        		this[this.contentType +'Create']();
        	} else {
        		this.displayLoading();
        		var pThis = this;
        		new ajxxOutline(this.outlineType, 
        			function () { 
        				pThis.connectOutline();
        				pThis[pThis.contentType +'Create']();
        			} 
        		);
        	}
        	
        };
        
        ajxxExpander.prototype.connectOutline = function(x, y) {	
        	var w = ajxx.pendingOutlines[this.outlineType];
        	this.objOutline = w;
        	ajxx.pendingOutlines[this.outlineType] = null;
        };
        
        ajxxExpander.prototype.displayLoading = function() {
        	if (this.onLoadStarted || this.loading) return;
        		
        	this.originalCursor = this.a.style.cursor;
        	this.a.style.cursor = 'wait';
        	
        	if (!ajxx.loading) {
        		ajxx.loading = ajxx.createElement('a',
        			{
        				className: 'ajaxx-loading',
        				title: ajxx.loadingTitle,
        				innerHTML: ajxx.loadingText
        			},
        			{
        				position: 'absolute',
        				opacity: ajxx.loadingOpacity
        			}, ajxx.container
        		);
        	}
        	
        	this.loading = ajxx.loading;
        	this.loading.href = 'javascript:ajxx.expanders['+ this.key +'].cancelLoading()';
        	this.loading.visibility = 'visible';		
        	
        	this.loading.style.left = (this.thumbLeft + this.thumbOffsetBorderW 
        		+ (this.thumbWidth - this.loading.offsetWidth) / 2) +'px';
        	this.loading.style.top = (this.thumbTop 
        		+ (this.thumbHeight - this.loading.offsetHeight) / 2) +'px';
        	setTimeout(
        		"if (ajxx.expanders["+ this.key +"] && ajxx.expanders["+ this.key +"].loading) "
        		+ "ajxx.expanders["+ this.key +"].loading.style.visibility = 'visible';", 
        		100
        	);
        };
        
        ajxxExpander.prototype.imageCreate = function() {
        	var key = this.key;
        
        	var img = document.createElement('img');
            this.content = img;
            img.onload = function () { try { ajxx.expanders[key].onLoad(); } catch (e) {} };
            img.className = 'ajaxx-image';
            img.style.visibility = 'hidden'; 
            img.style.display = 'block';
        	img.style.position = 'absolute';
        	img.style.maxWidth = 'none';
            img.style.zIndex = 3;
            img.title = ajxx.restoreTitle;
            if (ajxx.safari) ajxx.container.appendChild(img);
        
        	img.src = ajxx.getSrc(this.a);
        	
        	this.displayLoading();
        };
        
        ajxxExpander.prototype.onLoad = function() {
        	try { 
        	
        		if (!this.content) return;
        		if (this.onLoadStarted) return; 
        		else this.onLoadStarted = true;
        		
        			   
        		if (this.loading) {
        			this.loading.style.visibility = 'hidden';
        			this.loading = null;
        			this.a.style.cursor = this.originalCursor || '';
        		}
        		if (this.isImage) {			
        			this.newWidth = this.content.width;
        			this.newHeight = this.content.height;
        			this.fullExpandWidth = this.newWidth;
        			this.fullExpandHeight = this.newHeight;
        			
        			this.content.width = this.thumbWidth;
        			this.content.height = this.thumbHeight;
        			
        		} else if (this.htmlGetSize) this.htmlGetSize();
        		
        		this.marginBottom = ajxx.marginBottom;
        		this.getCaption();
        		
        		this.wrapper.appendChild(this.content);
        		this.content.style.position = 'relative'; 
        		if (this.caption) this.wrapper.appendChild(this.caption);
        		this.wrapper.style.left = this.thumbLeft +'px';
        		this.wrapper.style.top = this.thumbTop +'px';
        		ajxx.container.appendChild(this.wrapper);
        		
        
        		this.offsetBorderW = (this.content.offsetWidth - this.thumbWidth) / 2;
        		this.offsetBorderH = (this.content.offsetHeight - this.thumbHeight) / 2;
        		var modMarginRight = ajxx.marginRight + 2 * this.offsetBorderW;
        		this.marginBottom += 2 * this.offsetBorderH;
        		
        		var ratio = this.newWidth / this.newHeight;
        		var minWidth = this.allowSizeReduction ? this.minWidth : this.newWidth;
        		var minHeight = this.allowSizeReduction ? this.minHeight : this.newHeight;
        		
        		var justify = { x: 'auto', y: 'auto' };
        		if (this.align == 'center') {
        			justify.x = 'center';
        			justify.y = 'center';
        		} else {
        			if (this.anchor.match(/^top/)) justify.y = null;
        			if (this.anchor.match(/right$/)) justify.x = 'max';
        			if (this.anchor.match(/^bottom/)) justify.y = 'max';
        			if (this.anchor.match(/left$/)) justify.x = null;
        		}
        		
        		client = new ajxx.clientInfo();		
        		
        		this.x = { 
        			min: parseInt(this.thumbLeft) - this.offsetBorderW + this.thumbOffsetBorderW,
        			span: this.newWidth,
        			minSpan: this.newWidth < minWidth ? this.newWidth : minWidth,
        			justify: justify.x,
        			target: this.targetX,
        			marginMin: ajxx.marginLeft, 
        			marginMax: modMarginRight,
        			scroll: client.scrollLeft,
        			clientSpan: client.width,
        			thumbSpan: this.thumbWidth
        		};
        		var oldRight = this.x.min + parseInt(this.thumbWidth);
        		this.x = this.justify(this.x);
        		this.y = { 
        			min: parseInt(this.thumbTop) - this.offsetBorderH + this.thumbOffsetBorderH,
        			span: this.newHeight,
        			minSpan: this.newHeight < minHeight ? this.newHeight : minHeight,
        			justify: justify.y,
        			target: this.targetY,
        			marginMin: ajxx.marginTop, 
        			marginMax: this.marginBottom, 
        			scroll: client.scrollTop,
        			clientSpan: client.height,
        			thumbSpan: this.thumbHeight
        		};
        		var oldBottom = this.y.min + parseInt(this.thumbHeight);
        		this.y = this.justify(this.y);
        		
        		if (this.isHtml) this.htmlSizeOperations();	
        		if (this.isImage) this.correctRatio(ratio);
        
        		var x = this.x;
        		var y = this.y;
        		
        		this.show();
        	} catch (e) {
        		if (ajxx.expanders[this.key] && ajxx.expanders[this.key].a) 
        			window.location.href = ajxx.getSrc(ajxx.expanders[this.key].a);
        	}
        };
        
        ajxxExpander.prototype.show = function () {
        
        	var imgPos = {x: this.x.min - 20, y: this.y.min - 20, w: this.x.span + 40, h: this.y.span + 40 + this.spaceForCaption};
        	ajxx.hideSelects = (ajxx.ie && ajxx.ieVersion() < 7);
        	if (ajxx.hideSelects) this.showHideElements('SELECT', 'hidden', imgPos);
        
        	ajxx.hideIframes = (window.opera || navigator.vendor == 'KDE' || (ajxx.ie && ajxx.ieVersion() < 5.5));
        	if (ajxx.hideIframes) this.showHideElements('IFRAME', 'hidden', imgPos);
        	
        
        	if (this.objOutline && !this.outlineWhileAnimating) this.positionOutline(this.x.min, this.y.min, this.x.span, this.y.span);
        	var o2 = this.objOutline ? this.objOutline.offset : 0;
        	
        		
        	this.changeSize(
        		1,
        		this.thumbLeft + this.thumbOffsetBorderW - this.offsetBorderW,
        		this.thumbTop + this.thumbOffsetBorderH - this.offsetBorderH,
        		this.thumbWidth,
        		this.thumbHeight,
        		this.x.min,
        		this.y.min,
        		this.x.span,
        		this.y.span, 
        		ajxx.expandDuration,
        		ajxx.expandSteps,
        		ajxx.outlineStartOffset,
        		o2
        	);
        };
        
        ajxxExpander.prototype.justify = function (p) {
        	
        	var tgt, dim = p == this.x ? 'x' : 'y';
        	if (p.target && p.target.match(/ /)) {
        		tgt = p.target.split(' ');
        		p.target = tgt[0];
        	}
        	if (p.target && ajxx.$(p.target)) {
        		p.min = ajxx.position(ajxx.$(p.target))[dim];
        		if (tgt && tgt[1] && tgt[1].match(/^[-]?[0-9]+px$/)) p.min += parseInt(tgt[1]);
        		
        	} else if (p.justify == 'auto' || p.justify == 'center') {
        		var hasMovedMin = false;
        		var allowReduce = true;
        		
        
        		if (p.justify == 'center') p.min = Math.round(p.scroll + (p.clientSpan - p.span - p.marginMax) / 2);
        		else p.min = Math.round(p.min - ((p.span - p.thumbSpan) / 2)); 
        		
        		if (p.min < p.scroll + p.marginMin) {
        			p.min = p.scroll + p.marginMin;
        			hasMovedMin = true;		
        		}
        		
        		if (p.span < p.minSpan) {
        			p.span = p.minSpan;
        			allowReduce = false;
        		}
        
        		if (p.min + p.span > p.scroll + p.clientSpan - p.marginMax) {
        			if (hasMovedMin && allowReduce) p.span = p.clientSpan - p.marginMin - p.marginMax; 
        			else if (p.span < p.clientSpan - p.marginMin - p.marginMax) { 
        				p.min = p.scroll + p.clientSpan - p.span - p.marginMin - p.marginMax;
        			} else { 
        				p.min = p.scroll + p.marginMin;
        				if (allowReduce) p.span = p.clientSpan - p.marginMin - p.marginMax;
        			}
        			
        		}
        		
        		if (p.span < p.minSpan) {
        			p.span = p.minSpan;
        			allowReduce = false;
        		}
        		
        	} else if (p.justify == 'max') {
        		p.min = Math.floor(p.min - p.span + p.thumbSpan);
        	}
        		
        	if (p.min < p.marginMin) {
        		tmpMin = p.min;
        		p.min = p.marginMin; 
        		if (allowReduce) p.span = p.span - (p.min - tmpMin);
        	}
        	return p;
        };
        
        ajxxExpander.prototype.correctRatio = function(ratio) {
        	var x = this.x;
        	var y = this.y;
        	var changed = false;
        	if (x.span / y.span > ratio) { 
        		var tmpWidth = x.span;
        		x.span = y.span * ratio;
        		if (x.span < x.minSpan) { 
        			x.span = x.minSpan;	
        			y.span = x.span / ratio;
        		}
        		changed = true;
        	
        	} else if (x.span / y.span < ratio) { 
        		var tmpHeight = y.span;
        		y.span = x.span / ratio;
        		changed = true;
        	}
        	
        	if (changed) {
        		x.min = parseInt(this.thumbLeft) - this.offsetBorderW + this.thumbOffsetBorderW;
        		x.minSpan = x.span;
        		this.x = this.justify(x);
        		
        		y.min = parseInt(this.thumbTop) - this.offsetBorderH + this.thumbOffsetBorderH;
        		y.minSpan = y.span;
        		this.y = this.justify(y);
        	}
        };
        
        ajxxExpander.prototype.changeSize = function(dir, x1, y1, w1, h1, x2, y2, w2, h2, dur, steps, oo1, oo2) {
        	var dW = (w2 - w1) / steps,
        	dH = (h2 - h1) / steps,
        	dX = (x2 - x1) / steps,
        	dY = (y2 - y1) / steps,
        	dOo = (oo2 - oo1) /steps,
        	t,
        	exp = "ajxx.expanders["+ this.key +"]";
        	for (i = 1; i <= steps; i++) {
        		w1 += dW;
        		h1 += dH;
        		x1 += dX;
        		y1 += dY;
        		oo1 += dOo;
        		t = Math.round(i * (dur / steps));
        		
        		var s = "try {";
        		if (i == 1) {
        			s += exp +".content.style.visibility = 'visible';"
        				+ "if ("+ exp +".thumb.tagName == 'IMG' && ajxx.hideThumbOnExpand) "+ exp +".thumb.style.visibility = 'hidden';"
        		}
        		if (i == steps) {
        			w1 = w2;
        			h1 = h2;
        			x1 = x2;
        			y1 = y2;
        			oo1 = oo2;
        		}
        		s += exp +"."+ this.contentType +"SetSize("+ Math.round(w1) +", "+ Math.round(h1) +", "
        			+ Math.round(x1) +", "+ Math.round(y1) +", "+ Math.round(oo1);
        		s += ");} catch (e) {}";
        		setTimeout(s, t);
        	}
        	if (dir == 1) {
        		setTimeout('try { '+ exp +'.objOutline.table.style.visibility = "visible"; } catch (e){}', t);
        		setTimeout('try { '+ exp +'.onExpanded(); } catch(e){}', t+50);
        	}
        	else setTimeout('try { '+ exp +'.onEndClose(); } catch(e){}', t);
        		
        };
        
        ajxxExpander.prototype.imageSetSize = function (w, h, x, y, offset) {
        	try {
        		this.content.width = w;
        		this.content.height = h;
        		
        		if (this.objOutline && this.outlineWhileAnimating) {
        			var o = this.objOutline.offset - offset;
        			this.positionOutline(x + o, y + o, w - 2 * o, h - 2 * o, 1);
        		}
        		
        		ajxx.setStyles ( this.wrapper,
        			{
        				'visibility': 'visible',
        				'left': x +'px',
        				'top': y +'px'
        			}
        		);
        		
        	} catch (e) { window.location.href = ajxx.getSrc(this.a);	}
        };
        
        ajxxExpander.prototype.positionOutline = function(x, y, w, h, vis) {
        	if (!this.objOutline) return;
        	var o = this.objOutline;
        	if (vis) o.table.style.visibility = 'visible';
        	o.table.style.left = (x - o.offset) +'px';
        	o.table.style.top = (y - o.offset) +'px';
        	o.table.style.width = (w + 2 * (this.offsetBorderW + o.offset)) +'px';
        	w += 2 * (this.offsetBorderW - o.offset);
        	h += + 2 * (this.offsetBorderH - o.offset);
        	o.td[4].style.width = w >= 0 ? w +'px' : 0;
        	o.td[4].style.height = h >= 0 ? h +'px' : 0;
        	if (o.hasAlphaImageLoader) o.td[3].style.height = o.td[5].style.height = o.td[4].style.height;
        };
        
        ajxxExpander.prototype.onExpanded = function() {
        	
        	this.isExpanded = true;
        	this.focus();
        	if (this.isHtml && this.objectLoadTime == 'after') this.writeExtendedContent();
        	this.createCustomOverlays();
        	if (ajxx.showCredits) this.writeCredits();
        	
        	if (this.caption) this.writeCaption();
        	
        	if (this.fullExpandWidth > this.x.span) this.createFullExpand();
        	if (!this.caption) this.onDisplayFinished();
        };
        
        ajxxExpander.prototype.onDisplayFinished = function() {
        	var key = this.key;
        	var outlineType = this.outlineType;
        	new ajxxOutline(outlineType, function () { 
        		try { ajxx.expanders[key].preloadNext();	} catch (e) {}
        	});
        };
        
        ajxxExpander.prototype.preloadNext = function() {
        	var next = ajxx.getAdjacentAnchor(this.key, 1);	
        	if (next.onclick.toString().match(/ajxx\.expand/)) 
        		var img = ajxx.createElement('img', { src: ajxx.getSrc(next) });
        };
        
        ajxxExpander.prototype.cancelLoading = function() {
        	this.a.style.cursor = this.originalCursor;	
        	if (this.loading) ajxx.loading.style.visibility = 'hidden';		
        	ajxx.expanders[this.key] = null;
        };
        
        ajxxExpander.prototype.writeCredits = function () {
        	var credits = ajxx.createElement('a',
        		{
        			href: ajxx.creditsHref,
        			className: 'ajaxx-credits',
        			innerHTML: ajxx.creditsText,
        			title: ajxx.creditsTitle
        		}
        	);
        	this.createOverlay(credits, 'top left');
        };
        
        ajxxExpander.prototype.getCaption = function() {
        	if (!this.captionId && this.thumbsUserSetId)  this.captionId = 'caption-for-'+ this.thumbsUserSetId;
        	if (this.captionId) {
        		this.caption = ajxx.getNode(this.captionId);
        	}
        	if (this.captionTemplateId) {
        		var s = (this.caption) ? this.caption.innerHTML : '';
        		this.caption = ajxx.getNode(this.captionTemplateId);
        		if (this.caption) this.caption.innerHTML
        			= this.caption.innerHTML.replace(/\s/g, ' ').replace('{caption}', s);
        	}		
        	if (this.caption) this.marginBottom += this.spaceForCaption;
        
        };
        
        ajxxExpander.prototype.writeCaption = function() {
        	try {
        		this.wrapper.style.width = this.wrapper.offsetWidth +'px';	
        		this.caption.style.visibility = 'hidden';
        		this.caption.className += ' ajaxx-display-block';
        		
        		var height;
        		if (ajxx.ie && (ajxx.ieVersion() < 6 || document.compatMode == 'BackCompat')) {
        			height = this.caption.offsetHeight;
        		} else {
        			var temp = ajxx.createElement('div', {innerHTML: this.caption.innerHTML}, 
        				null, null, true); 
        			this.caption.innerHTML = '';
        			this.caption.appendChild(temp);	
        			height = this.caption.childNodes[0].offsetHeight;
        			this.caption.innerHTML = this.caption.childNodes[0].innerHTML;
        		}
        		ajxx.setStyles(this.caption, { overflow: 'hidden', height: 0, zIndex: 2 });
        		
        		if (ajxx.captionSlideSpeed) {
        			step = Math.round(height/50);
        			if (step == 0) step = 1;
        			step = step * ajxx.captionSlideSpeed;
        		} else {
        			this.placeCaption(height, 1);
        			return;
        		}
        
        		var t = 0;
        		for (var h = height % step; h <= height; h += step, t += 10) {
        			var end = (h == height) ? 1 : 0;
        			var eval = "try { "
        				+ "ajxx.expanders["+ this.key +"].placeCaption("+ h +", "+ end +");"
        				+ "} catch (e) {}";			
        			setTimeout (eval, t);
        		}
        	
        	} catch (e) {}	
        };
        
        ajxxExpander.prototype.placeCaption = function(height, end) {
        	if (!this.caption) return;
        	this.caption.style.height = height +'px';
        	this.caption.style.visibility = 'visible';
        	this.y.span = this.wrapper.offsetHeight - 2 * this.offsetBorderH;
        	var o = this.objOutline;
        	if (o) {
        		o.td[4].style.height = (this.wrapper.offsetHeight - 2 * this.objOutline.offset) +'px';
        		if (o.hasAlphaImageLoader) o.td[3].style.height = o.td[5].style.height = o.td[4].style.height;
        	}
        	if (end) this.onDisplayFinished();
        };
        
        ajxxExpander.prototype.showHideElements = function (tagName, visibility, imgPos) {
        	var els = document.getElementsByTagName(tagName);
        	if (els) {			
        		for (i = 0; i < els.length; i++) {
        			if (els[i].nodeName == tagName) {  
        				var hiddenBy = els[i].getAttribute('hidden-by');
        				 
        				if (visibility == 'visible' && hiddenBy) {
        					hiddenBy = hiddenBy.replace('['+ this.key +']', '');
        					els[i].setAttribute('hidden-by', hiddenBy);
        					if (!hiddenBy) els[i].style.visibility = 'visible';				
        					
        				} else if (visibility == 'hidden') { 
        					var elPos = ajxx.position(els[i]);
        					elPos.w = els[i].offsetWidth;
        					elPos.h = els[i].offsetHeight;
        				
        					var clearsX = (elPos.x + elPos.w < imgPos.x || elPos.x > imgPos.x + imgPos.w);
        					var clearsY = (elPos.y + elPos.h < imgPos.y || elPos.y > imgPos.y + imgPos.h);
        					var wrapperKey = ajxx.getWrapperKey(els[i]);
        					if (!clearsX && !clearsY && wrapperKey != this.key) { 
        						if (!els[i].currentStyle || (els[i].currentStyle && els[i].currentStyle['visibility'] != 'hidden')) { 
        							if (!hiddenBy) {
        								els[i].setAttribute('hidden-by', '['+ this.key +']');
        							} else if (!hiddenBy.match('['+ this.key +']')) {
        								els[i].setAttribute('hidden-by', hiddenBy + '['+ this.key +']');
        							}
        							els[i].style.visibility = 'hidden';	  
        						}
        					} else if (hiddenBy == '['+ this.key +']' || ajxx.focusKey == wrapperKey) { 
        						els[i].setAttribute('hidden-by', '');
        						els[i].style.visibility = 'visible';
        					} else if (hiddenBy && hiddenBy.match('['+ this.key +']')) {
        						els[i].setAttribute('hidden-by', hiddenBy.replace('['+ this.key +']', ''));
        					}
        				}   
        			}
        		}
        	}
        };
        
        ajxxExpander.prototype.focus = function() {
        
        	for (i = 0; i < ajxx.expanders.length; i++) {
        		if (ajxx.expanders[i] && i == ajxx.focusKey) {
        			var blurExp = ajxx.expanders[i];
        			blurExp.content.className += ' ajaxx-'+ blurExp.contentType +'-blur';
        			if (blurExp.caption) {
        				blurExp.caption.className += ' ajaxx-caption-blur';
        			}
        			if (blurExp.isImage) {
        				blurExp.content.style.cursor = ajxx.ie ? 'hand' : 'pointer';
        				blurExp.content.title = ajxx.focusTitle;	
        			}
        		}
        	}
        	
        
        	this.wrapper.style.zIndex = ajxx.zIndexCounter++;
        	if (this.objOutline) this.objOutline.table.style.zIndex = this.wrapper.style.zIndex;
        	
        	this.content.className = 'ajaxx-'+ this.contentType;
        	if (this.caption) {
        		this.caption.className = this.caption.className.replace(' ajaxx-caption-blur', '');
        	}
        	
        	if (this.isImage) {
        		this.content.title = ajxx.restoreTitle;
        		
        		ajxx.styleRestoreCursor = window.opera ? 'pointer' : 'url('+ ajxx.graphicsDir + ajxx.restoreCursor +'), pointer';
        		if (ajxx.ie && ajxx.ieVersion() < 6) ajxx.styleRestoreCursor = 'hand';
        		this.content.style.cursor = ajxx.styleRestoreCursor;
        	}
        	
        	ajxx.focusKey = this.key;	
        	ajxx.addEventListener(document, 'keydown', ajxx.keyHandler);
        	
        };
        
        ajxxExpander.prototype.onClick = function() {
        	this.doClose();
        };
        
        ajxxExpander.prototype.doClose = function() {
        	ajxx.removeEventListener(document, 'keydown', ajxx.keyHandler);
        	try {
        		this.isClosing = true;
        		
        		var x = parseInt(this.wrapper.style.left);
        		var y = parseInt(this.wrapper.style.top);
        		var w = (this.isImage) ? this.content.width : parseInt(this.content.style.width);
        		var h = (this.isImage) ? this.content.height : parseInt(this.content.style.height);
        		
        		if (this.objOutline) {
        			if (this.outlineWhileAnimating) this.positionOutline(x, y, w, h);
        			else if (this.preserveContent) this.objOutline.table.style.visibility = 'hidden';
        			else this.objOutline.destroy();
        		}
        		
        
        		var n = this.wrapper.childNodes.length;
        		for (i = n - 1; i >= 0 ; i--) {
        			var child = this.wrapper.childNodes[i];
        			if (child != this.content) {
        				ajxx.purge(this.wrapper.childNodes[i]);
        				this.wrapper.removeChild(this.wrapper.childNodes[i]);
        			}
        		}
        		if (this.isHtml) this.htmlOnClose();
        		
        		this.wrapper.style.width = 'auto';
        		this.content.style.cursor = 'default';
        		var o2 = this.objOutline ? this.objOutline.offset : 0;
        		
        		this.changeSize(
        			-1,
        			x,
        			y,
        			w,
        			h,
        			this.thumbLeft - this.offsetBorderW + this.thumbOffsetBorderW,
        			this.thumbTop - this.offsetBorderH + this.thumbOffsetBorderH,
        			this.thumbWidth,
        			this.thumbHeight, 
        			ajxx.restoreDuration,
        			ajxx.restoreSteps,
        			o2,
        			ajxx.outlineStartOffset
        		);
        		
        	} catch (e) {
        		this.onEndClose();
        	} 
        };
        
        ajxxExpander.prototype.onEndClose = function () {
        	this.thumb.style.visibility = 'visible';
        	
        	if (ajxx.hideSelects) this.showHideElements('SELECT', 'visible');
        	if (ajxx.hideIframes) this.showHideElements('IFRAME', 'visible');
        	
        	if (this.isHtml && this.preserveContent) this.sleep();
        	else {
        		if (this.objOutline && this.outlineWhileAnimating) this.objOutline.destroy();
        		ajxx.purge(this.wrapper);
        		if (ajxx.ie && ajxx.ieVersion() < 5.5) this.wrapper.innerHTML = ''; 
        		else this.wrapper.parentNode.removeChild(this.wrapper);
        	}
        	ajxx.expanders[this.key] = null;
        
        	ajxx.cleanUp();
        };
        
        ajxxExpander.prototype.createOverlay = function (el, position, hideOnMouseOut, opacity) {
        	if (typeof el == 'string') el = ajxx.getNode(el);
        	if (!el || typeof el == 'string' || !this.isImage) return;
        	
        	var overlay = ajxx.createElement(
        		'div',
        		null,
        		{
        			'left' : 0,
        			'top' : 0,
        			'position' : 'absolute',
        			'zIndex' : 3,
        			'visibility' : 'hidden'
        		},
        		this.wrapper,
        		true
        	);
        	if (opacity) ajxx.setStyles(el, { 'opacity': opacity });
        	el.className += ' ajaxx-display-block';
        	overlay.appendChild(el);	
        	
        	var left = this.offsetBorderW;
        	var dLeft = this.content.width - overlay.offsetWidth;
        	var top = this.offsetBorderH;
        	var dTop = this.content.height - overlay.offsetHeight;
        	
        	if (!position) position = 'center center';
        	if (position.match(/^bottom/)) top += dTop;
        	if (position.match(/^center/)) top += dTop / 2;
        	if (position.match(/right$/)) left += dLeft;
        	if (position.match(/center$/)) left += dLeft / 2;
        	overlay.style.left = left +'px';
        	overlay.style.top = top +'px';
        	
        	if (hideOnMouseOut) overlay.setAttribute('hideOnMouseOut', true);
        	if (!opacity) opacity = 1;
        	overlay.setAttribute('opacity', opacity);
        	ajxx.fade(overlay, 0, opacity, 1);
        	
        	ajxx.push(this.overlays, overlay);
        };
        
        ajxxExpander.prototype.createCustomOverlays = function() {
        	for (i = 0; i < ajxx.overlays.length; i++) {
        		var o = ajxx.overlays[i];
        		if (o.thumbnailId == null || o.thumbnailId == this.thumbsUserSetId) {
        			this.createOverlay(o.overlayId, o.position, o.hideOnMouseOut, o.opacity);
        		}
        	}
        };
        
        ajxxExpander.prototype.onMouseOver = function () {
        	for (i = 0; i < this.overlays.length; i++) {
        		var o = this.overlays[i];
        		if (o.getAttribute('hideOnMouseOut'))
        			ajxx.fade(o, 0, o.getAttribute('opacity'), 1);
        	}
        };
        
        ajxxExpander.prototype.onMouseOut = function() {
        	for (i = 0; i < this.overlays.length; i++) {
        		var o = this.overlays[i];
        		if (o.getAttribute('hideOnMouseOut')) 
        			ajxx.fade(o, o.getAttribute('opacity'), 0, -1);
        	}
        };
        
        ajxxExpander.prototype.createFullExpand = function () {
        	var a = ajxx.createElement(
        		'a',
        		{
        			href: 'javascript:ajxx.expanders['+ this.key +'].doFullExpand();',
        			title: ajxx.fullExpandTitle
        		},
        		{
        			background: 'url('+ ajxx.graphicsDir + ajxx.fullExpandIcon+')',
        			display: 'block',
        			margin: '0 10px 10px 0',
        			width: '45px',
        			height: '44px'
        		}, null, true
        	);
        	
        	this.createOverlay(a, 'bottom right', true, 0.75);
        	this.fullExpandIcon = a;
        };
        
        ajxxExpander.prototype.doFullExpand = function () {
        	try {
        		ajxx.purge(this.fullExpandIcon);
        		this.fullExpandIcon.parentNode.removeChild(this.fullExpandIcon);
        		this.focus();
        		
        		this.x.min = parseInt(this.wrapper.style.left) - (this.fullExpandWidth - this.content.width) / 2;
        		if (this.x.min < ajxx.marginLeft) this.x.min = ajxx.marginLeft;		
        		this.wrapper.style.left = this.x.min +'px';
        		
        		var borderOffset = this.wrapper.offsetWidth - this.content.width;		
        		
        		this.content.width = this.fullExpandWidth;
        		this.content.height = this.fullExpandHeight;
        		
        		this.x.span = this.content.width;
        		this.wrapper.style.width = (this.x.span + borderOffset) +'px';
        		
        		this.y.span = this.wrapper.offsetHeight - 2 * this.offsetBorderH;
        		this.positionOutline(this.x.min, this.y.min, this.x.span, this.y.span);
        		
        
        		for (var i = 0; i < this.overlays.length; i++) {
        			ajxx.purge(this.overlays[i]);
        			this.overlays[i].parentNode.removeChild(this.overlays[i]);
        		}	
        		if (ajxx.showCredits) this.writeCredits();
        		this.createCustomOverlays();
        		
        		this.redoShowHide();
        	
        	} catch (e) {
        		window.location.href = this.content.src;
        	}
        };
        
        
        ajxxExpander.prototype.redoShowHide = function() {
        	var imgPos = {
        		x: parseInt(this.wrapper.style.left) - 20, 
        		y: parseInt(this.wrapper.style.top) - 20, 
        		w: this.content.offsetWidth + 40, 
        		h: this.content.offsetHeight + 40 + this.spaceForCaption
        	};
        	if (ajxx.hideSelects) this.showHideElements('SELECT', 'hidden', imgPos);
        	if (ajxx.hideIframes) this.showHideElements('IFRAME', 'hidden', imgPos);
        
        };
        
        
        ajxx.addEventListener(document, 'mousedown', ajxx.mouseClickHandler);
        ajxx.addEventListener(document, 'mouseup', ajxx.mouseClickHandler);
        ajxx.addEventListener(window, 'load', ajxx.preloadImages);