/**
 * @copyright  Copyright(c) 2005-2009, IC Zones
 * @author     Michael Jolin
 * @since      2009,04,24
 * @package		JS
**/

/**
 * Object constructor
 *
 * @author		Michael Jolin
 * @since		2009,04,24
**/
var animatedZoom = {
	pbBox: new Array(),			// holds numerous properties related to position, size and motion
	pbZ: 10000,						// holds positioning value for the z axis
	pbSrc: new Array(),			// holds the popped image for each <img> tag with a pbsrc attribute
	pbPopBarFunc: new Array(),	// holds the popbar function for each <img> tag with a pbShowPopBar attribute
	image: {
			wait: '/img/PopBox/spinner40.gif',
			revert: '/img/PopBox/magminus.gif',
			pop: '/img/PopBox/magplus.gif'
		},
	waitImage: new Image(),
	autoClose: true,
	showRevertBar: false,
	showRevertText: false,
	revertBarAbove: false,
	showRevertImage: true,
	revertText: '',
	showPopText: true,
	popBarAbove: false,
	showPopImage: true,
	popText: '',
	showCaption: true,
	captionBelow: true,

	/**
	 * reset all vars and init widget.. used for ajax load
	 *
	 * @author		Guillaume Lacroix
	 * @since		2007,11,19
	**/
	reset: function() {
		this.pbBox = new Array();
		this.pbSrc = new Array();
		this.pbPopBarFunc = new Array();

		this.initPbSrc();
		this.initPbPopBar();
	},

	// Seek nested NN4 layer from string name
	seekLayer: function( doc, name ) {
   	var theObj;
		for( var i=0; i<doc.layers.length; i++ ) {
			if( doc.layers[i].name == name ) {
            theObj = doc.layers[i];
            break;
			}

			// dive into nested layers if necessary
			if( doc.layers[i].document.layers.length > 0 )
				theObj = this.seekLayer( document.layers[i].document, name );
		}
		return theObj;
	},

	// Convert object name string or object reference into a valid element object reference
	getRawObject: function( obj ) {
		var theObj;
		if( typeof obj == 'string' ) {
			var isCSS = ( document.body && document.body.style ) ? true : false;
			if( isCSS && document.getElementById ) {
				theObj = document.getElementById( obj );
			} else if( isCSS && document.all ) {
				theObj = document.all( obj );
			} else if( document.layers ) {
				theObj = this.seekLayer( document, obj );
			}
		} else {
			// pass through object reference
			theObj = obj;
		}
		return theObj;
	},

	// Convert object name string or object reference into a valid style (or NN4 layer) reference
	getObject: function( obj ) {
		var theObj = this.getRawObject( obj );
		if( theObj && document.body && document.body.style ) {
			theObj = theObj.style;
		}
		return theObj;
	},

	// Return the available content width and height space in browser window
	getInsideWindowSize: function() {
		if( window.innerWidth ) {
			return {
					x: window.innerWidth - 6,
					y: window.innerHeight - 6
				};
		} else if( document.compatMode && document.compatMode.indexOf( 'CSS1' ) >= 0 && document.body.parentNode.clientWidth > 0 ) {
			return {
					x: document.body.parentNode.clientWidth - 6,
					y: document.body.parentNode.clientHeight - 6
				};
		} else if( document.body && document.body.clientWidth ) {
			return {
					x:document.body.clientWidth - 6,
					y: document.body.clientHeight - 6
				};
		}
		return 0;
	},

	// Retrieve the x coordinate of a positionable object
	getObjectLeft: function( obj ) {
		var elem = this.getRawObject( obj );
		var result = 0;
		if( document.defaultView ) {
			var style = document.defaultView;
			var cssDecl = style.getComputedStyle( elem, '' );
			result = cssDecl.getPropertyValue( 'left' );
		} else if( elem.currentStyle ) {
			result = elem.currentStyle.left;
		} else if( elem.style ) {
			result = elem.style.left;
		} else if( document.layers ) {
			result = elem.left;
		}
		return parseInt( result );
	},

	// Retrieve the y coordinate of a positionable object
	getObjectTop: function( obj ) {
		var elem = this.getRawObject( obj );
		var result = 0;
		if( document.defaultView ) {
			var style = document.defaultView;
			var cssDecl = style.getComputedStyle( elem, '' );
			result = cssDecl.getPropertyValue( 'top' );
		} else if( elem.currentStyle ) {
			result = elem.currentStyle.top;
		} else if( elem.style ) {
			result = elem.style.top;
		} else if( document.layers ) {
			result = elem.top;
		}
		return parseInt( result );
	},

	// Retrieve the padding around an object
	getObjectPadding: function( obj ) {
		var elem = this.getRawObject( obj );
		var l = 0;
		var r = 0;
		var t = 0;
		var b = 0;

		if( elem.currentStyle ) {
			if( elem.currentStyle.paddingLeft )
				l = parseInt( elem.currentStyle.paddingLeft, 10 );
			if( elem.currentStyle.paddingRight )
				r = parseInt( elem.currentStyle.paddingRight, 10 );
			if( elem.currentStyle.paddingTop )
				t = parseInt( elem.currentStyle.paddingTop, 10 );
			if( elem.currentStyle.paddingBottom )
				b = parseInt( elem.currentStyle.paddingBottom, 10 );
		} else if( window.getComputedStyle ) {
			l = parseInt( window.getComputedStyle( elem, null ).paddingLeft, 10 );
			r = parseInt( window.getComputedStyle( elem, null ).paddingRight, 10 );
			t = parseInt( window.getComputedStyle( elem, null ).paddingTop, 10 );
			b = parseInt( window.getComputedStyle( elem, null ).paddingBottom, 10 );
		}
		if( isNaN( l ) == true) l = 0;
		if( isNaN( r ) == true) r = 0;
		if( isNaN( t ) == true) t = 0;
		if( isNaN( b ) == true) b = 0;

		return { l:(l),r:(r),t:(t),b:(b) };
	},

	// Retrieve the rendered size of an element
	getObjectSize: function( obj ) {
		var elem = this.getRawObject( obj );
		var w = 0;
		var h = 0;
		if( elem.offsetWidth ) {
			w = elem.offsetWidth; h = elem.offsetHeight;
		} else if( elem.clip && elem.clip.width ) {
			w = elem.clip.width; h = elem.clip.height;
		} else if( elem.style && elem.style.pixelWidth ) {
			w = elem.style.pixelWidth; h = elem.style.pixelHeight;
		}

		w = parseInt( w, 10 );
		h = parseInt( h, 10 );

		// remove any original element padding
		var padding = this.getObjectPadding( elem );
		w -= ( padding.l + padding.r );
		h -= ( padding.t + padding.b );

		return { w:(w), h:(h) };
	},

	// Return the element position in the page, not it's parent container
	getElementPosition: function( obj ) {
		var elem = this.getRawObject( obj );
		var left = 0;
		var top = 0;

		// add any original element padding
		var elemPadding = this.getObjectPadding( elem );
		left = elemPadding.l;
		top = elemPadding.t;

		if( elem.offsetParent ) {
			left += elem.offsetLeft;
			top += elem.offsetTop;
			var parent = elem.offsetParent;
			while( parent ) {
				left += parent.offsetLeft;
				top += parent.offsetTop;
				var parentTagName = parent.tagName.toLowerCase();
				if( parentTagName != 'table' && parentTagName != 'body' &&
						parentTagName != 'html' && parentTagName != 'div' &&
						parent.clientTop && parent.clientLeft ) {
					left += parent.clientLeft;
					top += parent.clientTop;
				}

				parent = parent.offsetParent;
			}
		} else if( elem.left && elem.top ) {
			left = elem.left;
			top = elem.top;
		} else {
			if( elem.x )
				left = elem.x;
			if( elem.y )
				top = elem.y;
		}
		return { x:left, y:top };
	},

	// return the number of pixels the scrollbar has moved the visible window
	getScrollOffset: function() {
		if( window.pageYOffset ) {
			return {x:window.pageXOffset, y:window.pageYOffset};
		} else if( document.compatMode && document.compatMode.indexOf( 'CSS1' ) >= 0 ) {
			return {x:document.documentElement.scrollLeft, y:document.documentElement.scrollTop};
		} else if( document.body && document.body.clientWidth ) {
			return {x:document.body.scrollLeft, y:document.body.scrollTop};
		}
		return { x:0, y:0 };
	},

	// Retrieve the element position if the object were centered in the browser window at the given width and height
	getCenteredWindowPoint: function( w, h ) {
		var size = this.getInsideWindowSize();
		var scroll = this.getScrollOffset();

		// get half the window size for center, then add the scroll values and then subtract half of the element size to get the top left pixel
		var newLeft = ( ( size.x / 2 ) + scroll.x ) - ( w / 2 );
		var newTop = ( ( size.y / 2 ) + scroll.y ) - ( h / 2 );

		return { x:newLeft, y:newTop };
	},

	createRandomId: function() {
		var randomNum = 0.0;
		while( randomNum == 0.0 )
			randomNum = Math.random();
		var random = randomNum + '';
		return 'id' + random.substr( 2 );
	},

	// loads all the popped src images
	initPbSrc: function() {
		this.waitImage.src = this.image.wait;

		var images = null;
		if( document.body ) {
			if( document.body.getElementsByTagName )
				images = document.body.getElementsByTagName( 'img' );
			else if( document.body.all )
				images = document.body.all.tags( 'img' );
		}
		if( images != null ) {
			for( var x=0; x<images.length; x++ ) {
				var poppedSrc = images[x].getAttribute( 'pbSrc' );
				if( poppedSrc != null ) {
					images[x].style.cursor = 'pointer';
					if( images[x].id == '' )
						images[x].id = this.createRandomId();

					if( this.pbSrc[images[x].id] == null ) {
						this.pbSrc[images[x].id] = new Image();
						this.pbSrc[images[x].id].src = poppedSrc;
					}
				}
			}
		}
	},

	// adds PopBar to images
	initPbPopBar: function() {
		var images = null;
		if( document.body ) {
			if( document.body.getElementsByTagName )
				images = document.body.getElementsByTagName( 'img' );
			else if( document.body.all )
				images = document.body.all.tags( 'img' );
		}

		if( images != null ) {
			var imgArray = new Array();
			for( var x=0; x<images.length; x++ ) {
				if( images[x].id == '' )
					images[x].id = this.createRandomId();
				imgArray[x] = images[x];
			}

			for( var x=0; x<imgArray.length; x++ )
				this.createPopBar( imgArray[x] );
		}
	},

	// initialize default popbox object
	initPopBox: function( obj ) {
		obj = this.getRawObject( obj );
		if( typeof this.pbBox[obj.id] != 'undefined' && this.pbBox[obj.id] != null )
			return obj;

		var parent = document.body;

		if( obj.id == '' )
			obj.id = this.createRandomId();

		var elem = obj;
		var startPos = this.getElementPosition( elem );
		var initSize = this.getObjectSize( elem );

		if( elem.style.position == 'absolute' || elem.style.position == 'relative' ) {
			parent = elem.parentNode;
			startPos.x = parseInt( elem.style.left, 10 );
			startPos.y = parseInt( elem.style.top, 10 );
		}

		// if there is a pbsrc then create that, else if it's not absolute or relative then create a copy
		if( this.pbSrc[elem.id] != null || ( elem.style.position != 'absolute' && elem.style.position != 'relative' ) ) {
			var img = document.createElement( 'img' );
			// copy image properties
			img.border = elem.border;
			img.className = elem.className;
			img.height = elem.height;
			img.id = 'popcopy' + elem.id;
			img.src = ( this.pbSrc[elem.id] != null) ? this.pbSrc[elem.id].src : elem.src;
			img.alt = elem.alt;
			img.title = elem.title;
			img.width = elem.width;
			img.onclick = elem.onclick;
			img.ondblclick = elem.ondblclick;
			img.onmouseout = elem.onmouseout;

			// remove event so the object doesn't jump
			elem.onmouseout = null;

			img.style.width = initSize.w;
			img.style.height = initSize.h;
			img.style.position = 'absolute';
			img.style.left = startPos.x + 'px';
			img.style.top = startPos.y + 'px';
			img.style.cursor = elem.style.cursor;
			img.style.zIndex = this.pbZ;

			parent.appendChild( img );
			elem.style.visibility = 'hidden';
			elem = img;
		}
	
		this.pbBox[elem.id] = {
				elemId: elem.id,
				xCurr: 0.0,
				yCurr: 0.0,
				xTarg: 0.0,
				yTarg: 0.0,
				wCurr: 0.0,
				hCurr: 0.0,
				wTarg: 0.0,
				hTarg: 0.0,
				xStep: 0.0,
				yStep: 0.0,
				wStep: 0.0,
				hStep: 0.0,
				xDelta: 0.0,
				yDelta: 0.0,
				wDelta: 0.0,
				hDelta: 0.0,
				xTravel: 0.0,
				yTravel: 0.0,
				wTravel: 0.0,
				hTravel: 0.0,
				velM: 1.0,
				velS: 1.0,
				interval: null,
				isAnimating: false,
				xOriginal: 0.0,
				yOriginal: 0.0,
				wOriginal: 0.0,
				hOriginal: 0.0,
				isPopped: false,
				fnClick: null,
				fnDone: null,
				fnPre: null,
				originalId: null,
				cursor: ''
			};

		this.pbBox[elem.id].xOriginal = startPos.x;
		this.pbBox[elem.id].yOriginal = startPos.y;
		this.pbBox[elem.id].wOriginal = parseFloat( initSize.w );
		this.pbBox[elem.id].hOriginal = parseFloat( initSize.h );

		if( typeof obj.onclick == 'function' ) {
			this.pbBox[elem.id].fnClick = elem.onclick;

			if( this.autoClose == true && ( typeof obj.ondblclick != 'function' || obj.ondblclick == null ) && typeof obj.onmouseover != 'function' )
				elem.ondblclick = function() {
						animatedZoom.revert( elem.id, null, elem.className );
					};
		}

		if( this.autoClose == true && typeof obj.onmouseover == 'function' && ( typeof obj.onmouseout != 'function' || obj.onmouseout == null ) )	{
			elem.onmouseout = function() {
					animatedZoom.revert( elem.id, null, elem.className );
				};
		}

		if( obj.id != elem.id )
			this.pbBox[elem.id].originalId = obj.id;

		return elem;
	},

	// calculate next steps and assign to style properties
	doPopBox: function( elem ) {
		if( typeof elem == 'string') elem = this.getRawObject( elem );

		try {
			var bMDone = false;
			var bSDone = false;
			if( ( this.pbBox[elem.id].xTravel + Math.abs( this.pbBox[elem.id].xStep ) ) < this.pbBox[elem.id].xDelta ) {
				var x = this.pbBox[elem.id].xCurr + this.pbBox[elem.id].xStep;
				elem.style.left = parseInt(x, 10) + "px";
				this.pbBox[elem.id].xTravel += Math.abs( this.pbBox[elem.id].xStep );
				this.pbBox[elem.id].xCurr = x;
			} else {
				this.pbBox[elem.id].xTravel += Math.abs( this.pbBox[elem.id].xStep );
				elem.style.left = parseInt( this.pbBox[elem.id].xTarg, 10 ) + 'px';
				bMDone = true;
			}
			if( ( this.pbBox[elem.id].yTravel + Math.abs( this.pbBox[elem.id].yStep ) ) < this.pbBox[elem.id].yDelta ) {
				var y = this.pbBox[elem.id].yCurr + this.pbBox[elem.id].yStep;
				elem.style.top = parseInt( y, 10 ) + 'px';
				this.pbBox[elem.id].yTravel += Math.abs( this.pbBox[elem.id].yStep );
				this.pbBox[elem.id].yCurr = y;
				bMDone = false;
			} else {
				this.pbBox[elem.id].yTravel += Math.abs( this.pbBox[elem.id].yStep );
				elem.style.top = parseInt( this.pbBox[elem.id].yTarg, 10 ) + 'px';
			}
			if( ( this.pbBox[elem.id].wTravel + Math.abs( this.pbBox[elem.id].wStep ) ) < this.pbBox[elem.id].wDelta ) {
				var w = this.pbBox[elem.id].wCurr + this.pbBox[elem.id].wStep;
				elem.style.width = parseInt(w, 10) + 'px';
				this.pbBox[elem.id].wTravel += Math.abs( this.pbBox[elem.id].wStep );
				this.pbBox[elem.id].wCurr = w;
			} else {
				this.pbBox[elem.id].wTravel += Math.abs( this.pbBox[elem.id].wStep );
				elem.style.width = parseInt( this.pbBox[elem.id].wTarg, 10) + 'px';
				bSDone = true;
			}
			if( ( this.pbBox[elem.id].hTravel + Math.abs( this.pbBox[elem.id].hStep ) ) < this.pbBox[elem.id].hDelta ) {
				var h = this.pbBox[elem.id].hCurr + this.pbBox[elem.id].hStep;
				elem.style.height = parseInt(h, 10) + 'px';
				this.pbBox[elem.id].hTravel += Math.abs( this.pbBox[elem.id].hStep );
				this.pbBox[elem.id].hCurr = h;
				bSDone = false;
			} else {
				this.pbBox[elem.id].hTravel += Math.abs( this.pbBox[elem.id].hStep );
				elem.style.height = parseInt( this.pbBox[elem.id].hTarg, 10) + 'px';
			}

			var obj = elem;
			if( bMDone == true && bSDone == true ) {
				clearInterval( this.pbBox[elem.id].interval );
				this.pbBox[elem.id].isAnimating = false;

				elem.style.cursor = this.pbBox[elem.id].cursor;

				var func = null;
				if( this.pbBox[elem.id].fnDone != null && typeof this.pbBox[elem.id].fnDone == 'function' )
				func = this.pbBox[elem.id].fnDone;

				if( this.pbBox[elem.id].isPopped == true ) {
					//elem.style.zIndex = null;

					if( this.pbBox[elem.id].originalId != null ) {
						obj = this.getRawObject( this.pbBox[elem.id].originalId );
						obj.onmouseout = elem.onmouseout; // copy method back to original
						obj.style.visibility = 'visible';

						// remove the copied object from the body and the array
						elem.parentNode.removeChild( elem );
					} else {
						elem.style.width = parseInt( this.pbBox[elem.id].wOriginal, 10 ) + 'px';
						elem.style.height = parseInt( this.pbBox[elem.id].hOriginal, 10 ) + 'px';

						if( typeof this.pbBox[elem.id].fnClick == 'function' )
							elem.onclick = pbBox[elem.id].fnClick;
					}

					delete this.pbBox[elem.id];
					this.pbBox[elem.id] = null;
					this.createPopBar( obj );
				} else {
					this.pbBox[elem.id].isPopped = true;
					this.createRevertBar( elem );
				}

				if( func != null && typeof func == 'function' )
				func( obj );
			}
		} catch( ex ){}
	},

	hasRevertBar: function( obj ) {
		if( typeof obj == 'string' ) obj = this.getRawObject( obj );

		var elem = obj;
		if( this.pbBox[elem.id] != null && this.pbBox[elem.id].originalId != null )
			elem = this.getRawObject( this.pbBox[elem.id].originalId );

		var pbShowBar = elem.getAttribute( 'pbShowRevertBar' );
		var pbShowText = elem.getAttribute( 'pbShowRevertText' );
		var pbShowImage = elem.getAttribute( 'pbShowRevertImage' );
		pbShowBar = ( pbShowBar != null ) ? ( pbShowBar == 'true' || pbShowBar == true ) : this.showRevertBar;
		pbShowText = (pbShowText != null) ? ( pbShowText == "true" || pbShowText == true ) : this.showRevertText;
		pbShowImage = (pbShowImage != null) ? ( pbShowImage == "true" || pbShowImage == true ) : this.showRevertImage;

		return ( pbShowBar || pbShowText || pbShowImage );
	},

	hasCaption: function( obj ) {
		if( typeof obj == 'string') obj = this.getRawObject( obj );
		var elem = obj;

		if( this.pbBox[elem.id] != null && this.pbBox[elem.id].originalId != null )
			elem = this.getRawObject( this.pbBox[elem.id].originalId );

		var pbCaption = elem.getAttribute( 'pbcaption' );

		return ( pbCaption != null && pbCaption != '' );
	},

	createRevertBar: function( obj ) {
		if( typeof obj == 'string' ) obj = this.getRawObject( obj );

		var elem = obj;
		if( this.pbBox[elem.id] != null && this.pbBox[elem.id].originalId != null )
			elem = this.getRawObject( this.pbBox[elem.id].originalId );

		var pbShowBar = elem.getAttribute( 'pbShowRevertBar' );
		var pbShowText = elem.getAttribute( 'pbShowRevertText' );
		var pbShowImage = elem.getAttribute( 'pbShowRevertImage' );
		var pbText = elem.getAttribute( 'pbRevertText' );
		var pbImage = elem.getAttribute( 'pbRevertImage' );
		pbShowBar = ( pbShowBar != null ) ? ( pbShowBar == 'true' || pbShowBar == true ) : this.showRevertBar;
		pbShowText = ( pbShowText != null ) ? ( pbShowText == 'true' || pbShowText == true ) : this.showRevertText;
		pbShowImage = ( pbShowImage != null ) ? ( pbShowImage == 'true' || pbShowImage == true ) : this.showRevertImage;
		if( pbText == null ) pbText = this.revertText;
		if( pbImage == null ) pbImage = this.image.revert;

		var pbCaption = '';
		if( html.$( 'link_' + elem.id ) )
			pbCaption = html.$( 'link_' + elem.id ).getAttribute( 'pbcaption' );
		if( !pbCaption )
			pbCaption = elem.getAttribute( 'pbcaption' );

		this.createPbBar( obj, pbShowBar, pbShowText, pbShowImage, pbText, pbImage, this.revertBarAbove, true, pbCaption );
	},

	createPopBar: function( obj ) {
		if( typeof obj == 'string' ) obj = this.getRawObject( obj );
		if( typeof this.pbPopBarFunc[obj.id] != 'undefined' && this.pbPopBarFunc[obj.id] != null) return;
		var pbShowBar = obj.getAttribute( 'pbShowPopBar' );
		if( pbShowBar != null ) {
			var pbShowText = obj.getAttribute( 'pbShowPopText' );
			var pbShowImage = obj.getAttribute( 'pbShowPopImage' );
			var pbText = obj.getAttribute( 'pbPopText' );
			var pbImage = obj.getAttribute( 'pbPopImage' );
			pbShowBar = ( pbShowBar == 'true' || pbShowBar == true );
			pbShowText = ( pbShowText != null ) ? ( pbShowText == 'true' || pbShowText == true ) : this.showPopText;
			pbShowImage = ( pbShowImage != null ) ? ( pbShowImage == 'true' || pbShowImage == true ) : this.showPopImage;
			if( pbText == null ) pbText = this.popText;
			if( pbImage == null ) pbImage = this.image.pop;

			this.createPbBar( obj, pbShowBar, pbShowText, pbShowImage, pbText, pbImage, this.popBarAbove, false, null );
		}
	},

	createPbBar: function( obj, pbShowBar, pbShowText, pbShowImage, pbText, pbImage, pbBarAbove, isRevert, pbCaption ) {
		if( pbShowBar == false && pbShowText == false && pbShowImage == false && pbCaption == null ) return;
		if( typeof obj == 'string' ) obj = this.getRawObject( obj );

		var objCursor = 'hand';
		if( obj.currentStyle )
			objCursor = obj.currentStyle.cursor;
		else if( window.getComputedStyle )
			objCursor = window.getComputedStyle( obj, null ).cursor;

		var fnClick = function(){
				if( typeof obj.onclick == 'function' ) obj.onclick();
			};
		var fnMouseOut = function(){
				if( typeof obj.onmouseout == 'function') obj.onmouseout();
			};
		var fnMouseOver = function(){
				if( typeof obj.onmouseover == 'function') obj.onmouseover();
			};
		var fnRemove = new Array();

		var isPositioned = ( obj.style.position == 'absolute' || obj.style.position == 'relative' );
		var left = 0;
		var top = 0;
		var parent = obj.parentNode;
		var objSpan = null;
		if( isPositioned == true ) {
			left = parseInt( obj.style.left, 10 );
			top = parseInt( obj.style.top, 10 );
			var padding = this.getObjectPadding( obj );
			left += padding.l;
			top += padding.t;	
		} else {
			objSpan = document.createElement( 'span' );
			objSpan = ( obj.nextSibling != null ) ? parent.insertBefore( objSpan, obj.nextSibling ) : parent.appendChild( objSpan );
			objSpan.style.position = 'relative';
			objSpan.style.left = '0px';
			objSpan.style.top = '0px';
			var floatValue = '';
			if( obj.align == 'left' ) floatValue = 'left';
			else if( obj.align == 'right' ) floatValue = 'right';
			floatValue = ( obj.style.styleFloat && obj.style.styleFloat != '' ) ? obj.style.styleFloat : ( obj.style.cssFloat && obj.style.cssFloat != '' ) ? obj.style.cssFloat : floatValue;
			if( typeof obj.style.styleFloat != 'undefined' ) objSpan.style.styleFloat = floatValue;
			else if( typeof obj.style.cssFloat != 'undefined' ) objSpan.style.cssFloat = floatValue;

			if( checkIt( 'msie 8' ) ) {
				objSpan.style.left = ( -1 * obj.width ) + 'px';
				objSpan.style.top = ( -1 * obj.height ) + 'px';
			} else {
				var imgPos = this.getElementPosition( obj );
				var spanPos = this.getElementPosition( objSpan );

				objSpan.style.left = ( spanPos.x > imgPos.x ) ? ( imgPos.x - spanPos.x ) + 'px' : imgPos.x - spanPos.x + 'px';
				objSpan.style.top = ( spanPos.y > imgPos.y ) ? ( imgPos.y - spanPos.y ) + 'px' : imgPos.y - spanPos.y + 'px';
			}

			objSpan.onclick = fnClick;
			if( isRevert == true )
				objSpan.onmouseout = fnMouseOut;
			else
				objSpan.onmouseover = fnMouseOver;
			parent = objSpan;
		}

		var width = parseInt( obj.style.width, 10 );
		var height = parseInt( obj.style.height, 10 );
		var size = this.getObjectSize( obj );
		if( isNaN( width ) == true )
			width = size.w;
		else if( size.w > width )
			left += ( ( size.w - width ) / 2 );
		if( isNaN( height ) == true )
			height = size.h;
		else if( size.h > height )
			top += ( ( size.h - height ) / 2 );

		if( pbBarAbove == true ) top -= 20;
		var z = obj.style.zIndex + 1;

		if( pbShowBar == true ) {
			var divTrans = document.createElement( 'div' );
			divTrans.id = 'popBoxDivTrans' + z;
			divTrans.style.width = width + 'px';
			divTrans.style.height = '20px';
			divTrans.style.borderStyle = 'none';
			divTrans.style.padding = '0px';
			divTrans.style.margin = '0px';
			divTrans.style.position = 'absolute';
			divTrans.style.left = left + 'px';
			divTrans.style.top = top + 'px';
			divTrans.style.cursor = objCursor;
			divTrans.style.zIndex = z;
			if( pbBarAbove == false ) {
				if( typeof divTrans.style.filter != 'undefined' )
					divTrans.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=20)';
				if( typeof divTrans.style.opacity != 'undefined' )
					divTrans.style.opacity = '0.2';
			}
			divTrans.onclick = fnClick;
			if( isRevert == true )
				divTrans.onmouseout = fnMouseOut;
			else
				divTrans.onmouseover = fnMouseOver;
			parent.appendChild( divTrans );

			fnRemove.push( function(){
					divTrans.parentNode.removeChild( divTrans );
				});
		}

		if( pbShowText == true ) {
			var divText = document.createElement( 'div' );
			divText.id = 'popBoxDivText' + z;
			divText.style.width = width + 'px';
			divText.style.height = '20px';
			divText.style.borderStyle = 'none';
			divText.style.padding = '0px';
			divText.style.margin = '0px';
			divText.style.position = 'absolute';
			divText.style.left = left + 'px';
			divText.style.top = top + 'px';
			divText.style.cursor = objCursor;
			divText.style.textAlign = 'center';
			divText.style.fontFamily = 'Arial, Verdana, Sans-Serif';
			divText.style.fontSize = '11pt';
			divText.style.backgroundColor = 'Transparent';
			divText.style.color = '#ffffff';
			divText.style.zIndex = z;
			divText.innerHTML = pbText;
			divText.onclick = fnClick;
			if( isRevert == true )
				divText.onmouseout = fnMouseOut;
			else
				divText.onmouseover = fnMouseOver;
			parent.appendChild( divText );

			fnRemove.push( function(){
					divText.parentNode.removeChild( divText );
				});
		}

		if( pbShowImage == true ) {
			var imgPopped = document.createElement( 'img' );
			imgPopped.id = "popBoxImgPopped" + z;
			imgPopped.src = pbImage;
			imgPopped.style.width = '20px';
			imgPopped.style.height = '20px';
			imgPopped.style.borderStyle = 'none';
			imgPopped.style.padding = '0px';
			imgPopped.style.margin = '0px';
			imgPopped.style.position = 'absolute';
			imgPopped.style.left = ( left + width - 20 ) + 'px';
			imgPopped.style.top = top + 'px';
			imgPopped.style.cursor = objCursor;
			imgPopped.style.zIndex = z;
			imgPopped.onclick = fnClick;
			if( isRevert == true )
				imgPopped.onmouseout = fnMouseOut;
			else
				imgPopped.onmouseover = fnMouseOver;
			parent.appendChild( imgPopped );

			fnRemove.push( function(){
					if( imgPopped.parentNode )
						imgPopped.parentNode.removeChild( imgPopped );
				});
		}

		if( pbCaption != null && pbCaption != '' ) {
			top += height + 3;
			if( pbBarAbove == true ) top -= 20;
			if( this.captionBelow == true )  top -= 20;

			var divCapTrans = document.createElement( 'div' );
			divCapTrans.id = 'popBoxDivCapTrans' + z;
			divCapTrans.style.width = ( width - 2 ) + 'px';
			divCapTrans.style.height = '20px';
			divCapTrans.style.borderStyle = 'solid';
			divCapTrans.style.borderWidth = '1px';
			divCapTrans.style.borderColor = '#999999';
			divCapTrans.style.padding = '0px';
			divCapTrans.style.margin = '0px';
			divCapTrans.style.position = 'absolute';
			divCapTrans.style.left = left + 'px';
			divCapTrans.style.top = ( top - 1 ) + 'px';
			divCapTrans.style.backgroundColor = '#ffffdd';
			divCapTrans.style.display = 'none';
			divCapTrans.style.zIndex = z;
			if( this.captionBelow == false ) {
				if( typeof divCapTrans.style.filter != 'undefined' )
					divCapTrans.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=70)';
				if( typeof divCapTrans.style.opacity != 'undefined' )
					divCapTrans.style.opacity = '0.7';
			}

			parent.appendChild( divCapTrans );
			fnRemove.push( function(){
					divCapTrans.parentNode.removeChild( divCapTrans );
				});

			var divCapText = document.createElement( 'div' );
			divCapText.id = 'popBoxDivCapText' + z;
			divCapText.style.width = ( width ) +  'px';
			divCapText.style.height = 'auto';
			divCapText.style.left = ( left - 3 ) + 'px';
			divCapText.style.top = ( top + 17 ) + 'px';
			divCapText.style.zIndex = z;
			divCapText.style.overflowY = 'hidden';
			divCapText.className = 'PopBoxTextLarge';
			parent.appendChild( divCapText );
			fnRemove.push( function(){
					divCapText.parentNode.removeChild( divCapText );
				});

			this.addCaptionText( divCapTrans, divCapText, pbCaption );
		}

		if( fnRemove.length != 0 ) {
			if( objSpan != null )
				fnRemove.push( function(){
						objSpan.parentNode.removeChild( objSpan );
					});

			if( isRevert == true ) {
				if( this.pbBox[obj.id].fnPre != null && typeof( this.pbBox[obj.id].fnPre) == 'function' )
					fnRemove.push( this.pbBox[obj.id].fnPre );

				this.pbBox[obj.id].fnPre = function(){
						for( var x=0; x<fnRemove.length; x++ ){
							fnRemove[x]();
						}
					};
			} else {
				this.pbPopBarFunc[obj.id] = function(){
						for( var x=0; x<fnRemove.length; x++ ){
							fnRemove[x]();
						}
					};
			}
		}
	},

	addCaptionText: function( divCapTrans, divCapText, caption ) {
		var width = parseInt( divCapText.style.width, 10 );
		var divSizer = document.createElement( 'div' );
		divSizer.style.position = 'absolute';
		divSizer.style.width = width + 'px';
		divSizer.style.margin = '0px';
		divSizer.style.fontFamily = divCapText.style.fontFamily;
		divSizer.style.fontSize = divCapText.style.fontSize;
		divSizer.style.visibility = 'hidden';
		divSizer.innerHTML = caption;
		document.body.appendChild( divSizer );

		var newSize = this.getObjectSize( divSizer );
		divCapText.innerHTML = caption;

		document.body.removeChild( divSizer );
	},

	resizeCaption: function( divCapTrans, divCapText, height, caption ) {
		if( typeof divCapTrans == 'string' ) divCapTrans = this.getRawObject( divCapTrans );
		if( typeof divCapText == 'string' ) divCapText = this.getRawObject( divCapText );

		var h = parseInt( divCapText.style.height, 10 );
		var top = parseInt( divCapText.style.top, 10 );

		if( h < height ) {
			if( h == 20 ) {
				height += 10;
				divCapText.style.paddingTop = '5px';
				divCapText.innerHTML = caption + '...';

				var spanLess = document.createElement( 'span' );
				spanLess.style.color = '#0000ff';
				spanLess.style.textDecoration = 'underline';
				spanLess.style.cursor = 'pointer';
				spanLess.onclick = function() {
						spanLess.parentNode.removeChild( spanLess );
						divCapText.innerHTML = caption;
						this.resizeCaption( divCapTrans.id, divCapText.id, 20, caption );
					};
				spanLess.innerHTML = 'less';
				divCapText.appendChild( spanLess );

				if( this.captionBelow == false ) {
					if( typeof divCapTrans.style.filter != 'undefined' )
						divCapTrans.style.filter = '';
					if( typeof divCapTrans.style.opacity != 'undefined' )
						divCapTrans.style.opacity = '1.0';
				}
			}

			if( ( h + 10 ) >= height ) {
				top -= ( height - h );
				h = height;
			} else {
				top -= 10;
				h += 10;
			}

			divCapTrans.style.height = h + 'px';
			divCapText.style.height = h + 'px';
			divCapTrans.style.top = (top - 1) + 'px';
			divCapText.style.top = top + 'px';

			if( h != height )
				setTimeout( 'animatedZoom.resizeCaption("' + divCapTrans.id + '","' + divCapText.id + '",' + height + ',"' + caption + '")', 10 );
		} else {
			if( ( h - 10 ) <= height ) {
				top += ( h - height );
				h = height;
			} else {
				top += 10;
				h -= 10;
			}

			divCapTrans.style.height = h + 'px';
			divCapText.style.height = h + 'px';
			divCapTrans.style.top = (top - 1) + 'px';
			divCapText.style.top = top + 'px';
			divCapText.style.paddingTop = '0px';

			if( h == height ) {
				if( typeof divCapTrans.style.filter != 'undefined' )
					divCapTrans.style.filter = 'progid:DXImageTransform.Microsoft.Alpha(opacity=70)';
				if( typeof divCapTrans.style.opacity != 'undefined' )
					divCapTrans.style.opacity = '0.7';

				this.addCaptionText( divCapTrans, divCapText, caption );
			} else {
				setTimeout('animatedZoom.resizeCaption("' + divCapTrans.id + '","' + divCapText.id + '",' + height + ',"' + caption + '")', 10 );
			}
		}
	},

	createWaitImage: function( obj ) {
		if( typeof obj == 'string' ) obj = this.getRawObject( obj );

		var newId = 'popBoxImgWait' + obj.id;
		var imgWait = this.getRawObject( newId );
		if( imgWait != null )
			return imgWait;

		var left = 0;
		var top = 0;
		if( obj.style.position == 'absolute' || obj.style.position == 'relative' ) {
			left = parseInt( obj.style.left, 10 );
			top = parseInt( obj.style.top, 10 );
		} else {
			var xy = this.getElementPosition( obj );
			left = xy.x;
			top = xy.y
			var padding = this.getObjectPadding( obj );
			left -= padding.l;
			top -= padding.t;
		}

		var width = parseInt( obj.style.width, 10 );
		var height = parseInt( obj.style.height, 10 );
		var size = this.getObjectSize( obj );
		if( isNaN( width ) == true )
			width = size.w;
		else if( size.w > width )
			left += ( ( size.w - width ) / 2 );
		if( isNaN( height ) == true )
			height = size.h;
		else if( size.h > height )
			top += ( ( size.h - height ) / 2 );

		var parentNode = obj.parentNode;

		imgWait = document.createElement( 'img' );
		imgWait.id = newId;
		imgWait.src = this.image.wait;
		imgWait.style.position = 'absolute';
		imgWait.style.left = ( left + ( width / 2 ) - ( this.waitImage.width / 2 ) ) + 'px';
		imgWait.style.top = ( top + ( height / 2 ) - ( this.waitImage.height / 2 ) ) + 'px';
		imgWait.style.cursor = obj.style.cursor;
		imgWait.style.zIndex = obj.style.zIndex + 1;
		parentNode.appendChild( imgWait );

		return imgWait;
	},

	popBox: function( obj, startX, startY, endX, endY, startW, startH, endW, endH, speedM, speedS, className, fnDone ) {
		if( typeof obj == 'string' ) obj = this.getRawObject( obj );
		if( obj == null || typeof obj != 'object' || isNaN( startX ) || isNaN( startY ) || isNaN( endX ) || isNaN( endY ) ||
					isNaN( startW ) || isNaN( startH ) || isNaN( endW ) || isNaN( endH ) || isNaN( speedM ) || isNaN( speedS ) )
			return;
		var elem = this.initPopBox( obj );

		if( this.pbBox[elem.id].isAnimating == true ) {
			setTimeout( function() {
					animatedZoom.popBox( elem.id, startX, startY, endX, endY, startW, endW, startH, endH, speedM, speedS, className );
				}, 10 );
		} else {
			this.pbBox[elem.id].isAnimating = true;
			this.pbBox[elem.id].xCurr = parseFloat( startX );
			this.pbBox[elem.id].yCurr = parseFloat( startY );
			this.pbBox[elem.id].wCurr = parseFloat( startW );
			this.pbBox[elem.id].hCurr = parseFloat( startH );
			this.pbBox[elem.id].xTarg = parseFloat( endX );
			this.pbBox[elem.id].yTarg = parseFloat( endY );
			this.pbBox[elem.id].wTarg = parseFloat( endW );
			this.pbBox[elem.id].hTarg = parseFloat( endH );
			this.pbBox[elem.id].xDelta = Math.abs( parseFloat( endX ) - parseFloat( startX ) );
			this.pbBox[elem.id].yDelta = Math.abs( parseFloat( endY ) - parseFloat( startY ) );
			this.pbBox[elem.id].wDelta = Math.abs( parseFloat( endW ) - parseFloat( startW ) );
			this.pbBox[elem.id].hDelta = Math.abs( parseFloat( endH ) - parseFloat( startH ) );
			this.pbBox[elem.id].velM = ( speedM ) ? Math.abs( parseFloat( speedM ) ) : 1.0;
			this.pbBox[elem.id].velS = ( speedS ) ? Math.abs( parseFloat( speedS ) ) : 1.0;
			this.pbBox[elem.id].xTravel = 0.0;
			this.pbBox[elem.id].yTravel = 0.0;
			this.pbBox[elem.id].wTravel = 0.0;
			this.pbBox[elem.id].hTravel = 0.0;
			// set element's start position
			elem.style.position = 'absolute';
			elem.style.left = startX + 'px';
			elem.style.top = startY + 'px';
			// set element's start size
			elem.style.width = startW + 'px';
			elem.style.height = startH + 'px';
			elem.style.display = 'inline';

			// the length of the line between start and end points
			var lenMove = Math.sqrt( ( Math.pow( ( startX - endX ), 2 ) ) + ( Math.pow( ( startY - endY ), 2 ) ) );
			var lenSize = Math.sqrt( ( Math.pow( ( startW - endW ), 2 ) ) + ( Math.pow( ( startH - endH ), 2 ) ) );
			// if the speeds are the same then they should be in sync
			if( this.pbBox[elem.id].velM == this.pbBox[elem.id].velS )
				lenMove = lenSize = Math.sqrt( Math.pow( lenMove, 2 ) + Math.pow( lenSize, 2 ) );

			// how big the pixel steps are along each axis
			this.pbBox[elem.id].xStep = ( ( this.pbBox[elem.id].xTarg - this.pbBox[elem.id].xCurr) / lenMove) * this.pbBox[elem.id].velM;
			this.pbBox[elem.id].yStep = ( ( this.pbBox[elem.id].yTarg - this.pbBox[elem.id].yCurr) / lenMove) * this.pbBox[elem.id].velM;

			// how big the pixel steps are for each resize
			this.pbBox[elem.id].wStep = ( ( this.pbBox[elem.id].wTarg - this.pbBox[elem.id].wCurr) / lenSize) * this.pbBox[elem.id].velS;
			this.pbBox[elem.id].hStep = ( ( this.pbBox[elem.id].hTarg - this.pbBox[elem.id].hCurr) / lenSize) * this.pbBox[elem.id].velS;

			this.pbBox[elem.id].fnDone = fnDone;
			if( className != null )
				elem.className = className;

			this.pbBox[elem.id].cursor = elem.style.cursor;
			elem.style.cursor = 'default';

			if( this.pbBox[elem.id].isPopped == false )
				elem.style.zIndex = ++this.pbZ;

			var id = elem.id;
			if( this.pbBox[elem.id].originalId != null ) id = this.pbBox[elem.id].originalId;
			if( this.pbPopBarFunc[id] != null ) {
				this.pbPopBarFunc[id]();
				this.pbPopBarFunc[id] = null;
			}

			if( this.pbBox[elem.id].fnPre != null && typeof this.pbBox[elem.id].fnPre == 'function' )
				this.pbBox[elem.id].fnPre();

			// start the repeated invocation of the animation
			this.pbBox[elem.id].interval = setInterval( "animatedZoom.doPopBox('" + elem.id + "')", 10 );
		}
	},

	// this basic method centers the image in the browser and displays it at its full resolution
	pop: function( obj, speed, className ) {
		this.popEx( obj, null, null, 0, 0, speed, className );
	},

	// If either newLeft or newTop are null then the image is centered in the browser.
	// End newLeft and/or newTop with "A" for an absolute position, otherwise it is treated as a relative position.
	// Ex: a newLeft of 20 would move right 20 pixels, "20A" would position 20 pixels from the left of it's containing element.
	// If either newWidth or newHeight is 0 then the full image size is used
	popEx: function( obj, newLeft, newTop, newWidth, newHeight, speed, className ) {
		if( checkIt( 'safari' ) ) {
			speed = speed * 5;
		} else if( checkIt( 'msie' ) ) {
			speed = speed * 10;
		} else {
			speed = speed * 4;
		}
		if( !html.$( 'backModal' ) ) {
			var oDiv = document.createElement( 'DIV' );
			oDiv.id = 'backModal';
			document.body.appendChild( oDiv );
		}

		html.$( 'backModal' ).style.height = ( document.body.offsetHeight ) + 'px';
		html.$( 'backModal' ).style.display = 'block';

		if( typeof obj == 'string' ) obj = this.getRawObject( obj );
		if( obj.id == '' )
			obj.id = this.createRandomId();

		if( html.$( 'popcopy' + obj.id ) ) { //GL .. dont want to pop more than 1 in a time
			return;
		}

		var poppedSrc = obj.getAttribute( 'pbSrcNL' );
		if( poppedSrc != null ) {
			if( this.pbSrc[obj.id] != null ) {
				if( this.pbSrc[obj.id].src != poppedSrc )
					this.pbSrc[obj.id].src = poppedSrc;
			} else {
				this.pbSrc[obj.id] = new Image();
				this.pbSrc[obj.id].src = poppedSrc;
			}
		} else if( this.pbSrc[obj.id] == null ) {
			poppedSrc = obj.getAttribute( 'pbSrc' );
			if( poppedSrc != null ) {
				this.pbSrc[obj.id] = new Image();
				this.pbSrc[obj.id].src = poppedSrc;
			}
		}

		var objToPop = ( this.pbSrc[obj.id] != null ) ? this.pbSrc[obj.id] : obj;
		var isReady = ( typeof objToPop.readyState != 'undefined' ) ? ( objToPop.readyState == 'complete' ) : ( ( typeof objToPop.complete != 'undefined' ) ? ( objToPop.complete == true ) : true );
		if( isReady == false ) {
			var imgWait = this.createWaitImage( obj );
			objToPop.onload = function() {
					var imgWait = animatedZoom.getRawObject( 'popBoxImgWait' + obj.id );
					imgWait.parentNode.removeChild( imgWait );
					animatedZoom.popEx( obj.id, newLeft, newTop, newWidth, newHeight, speed, className );
				};
			return;
		}

		var elem = this.initPopBox( obj );
		if( this.pbBox[elem.id].isPopped == true ) return;

		if( typeof elem.ondblclick == 'function' )
			elem.onclick = elem.ondblclick;

		var startX = parseInt( elem.style.left );
		var startY = parseInt( elem.style.top );

		if( newWidth == 0 || newHeight == 0 ) {
			// get size from original object
			if( this.pbSrc[obj.id] != null ) {
				newWidth = this.pbSrc[obj.id].width;
				newHeight = this.pbSrc[obj.id].height;
			} else if( obj.naturalWidth && obj.naturalHeight ) {
				newWidth = obj.naturalWidth;
				newHeight = obj.naturalHeight;
			} else {
				var img = new Image();
				img.src = elem.src;
				newWidth = img.width;
				newHeight = img.height;
				delete img;
			}

			// some browsers have a race condition where it still doesn't get set so just fill the window
			if( newWidth == 0 || newHeight == 0 ) {
				var windowSize = this.getInsideWindowSize();
				var scale = Math.min( parseFloat( windowSize.x ) / parseFloat( elem.width ), parseFloat( windowSize.y ) / parseFloat( elem.height ) );
				newWidth = parseInt( elem.width * scale );
				newHeight = parseInt( elem.height * scale );
			}
		}

		// center it
		if( newLeft == null || newTop == null ) {
			// if image is bigger than the window scale it down (does not take into account any border)
			var windowSize = this.getInsideWindowSize();
			var hasRevertBar = this.hasRevertBar( obj );
			var hasCaption = this.hasCaption( obj );
			if( hasRevertBar == true && this.revertBarAbove == true ) windowSize.y -= 20;
			if( hasCaption == true && this.captionBelow == true ) windowSize.y -= 20;
			if( windowSize.x < newWidth || windowSize.y < newHeight ) {
				var scale = Math.min( parseFloat( windowSize.x ) / parseFloat( newWidth ), parseFloat( windowSize.y ) / parseFloat( newHeight ) );
				newWidth = parseInt( newWidth * scale );
				newHeight = parseInt( newHeight * scale );
			}

			var endPos = this.getCenteredWindowPoint( newWidth, newHeight );
			newLeft = endPos.x;
			newTop = endPos.y;
			if( hasRevertBar == true && this.revertBarAbove == true ) newTop += 10;
			if( hasCaption == true && this.captionBelow == true ) newTop -= 10;
		} else { // check for absolute vs. relative positioning
			if( typeof newLeft == 'string' && newLeft.indexOf( 'A' ) == ( newLeft.length - 1 ) )
				newLeft = parseInt( newLeft, 10 );
			else
				newLeft = this.pbBox[elem.id].xOriginal + parseInt( newLeft, 10 );
			if( typeof newTop == 'string' && newTop.indexOf( 'A' ) == ( newTop.length - 1 ) )
				newTop = parseInt( newTop, 10 );
			else
				newTop = this.pbBox[elem.id].yOriginal + parseInt( newTop, 10 );
		}

		var func = null;
		if( typeof PostPopProcessing == 'function' )
			func = PostPopProcessing;

		if( typeof PrePopProcessing == 'function' )
			PrePopProcessing( obj );

		this.popBox( elem, startX, startY, newLeft, newTop, this.pbBox[elem.id].wOriginal, this.pbBox[elem.id].hOriginal, newWidth, newHeight, speed, speed, className, func );
	},

	// Helper function for PopBox to move/resize the image back to its original position/size. Use this! It's much easier.
	revert: function( obj, speed, className ) {
		if( html.$( 'backModal' ) )
			html.$( 'backModal' ).style.display = 'none';
		if( typeof obj == 'string' ) obj = this.getRawObject( obj ); 
		if( typeof this.pbBox[obj.id] == 'undefined' || this.pbBox[obj.id] == null ) return;

		var iCurrentLeft = this.getObjectLeft( obj );
		var iCurrentTop = this.getObjectTop( obj );
		var iCurrentWidth = parseInt( obj.style.width, 10 );
		var iCurrentHeight = parseInt( obj.style.height, 10 );
		var z = obj.style.zIndex + 1;

		if( typeof speed == 'undefined' || speed == null || speed == 0 )
			speed = Math.max( this.pbBox[obj.id].velM, this.pbBox[obj.id].velS );

		if( typeof className == 'undefined' )
			className = this.pbBox[obj.id].originalClassName;

		var func = null;
		if( typeof PostRevertProcessing == 'function' )
			func = PostRevertProcessing;

		if (typeof PreRevertProcessing == 'function' )
			PreRevertProcessing( obj );

		this.popBox( obj, iCurrentLeft, iCurrentTop, this.pbBox[obj.id].xOriginal, this.pbBox[obj.id].yOriginal, iCurrentWidth, iCurrentHeight, this.pbBox[obj.id].wOriginal, this.pbBox[obj.id].hOriginal, speed, speed, className, func );
	}
}

function PopEx( obj, newLeft, newTop, newWidth, newHeight, speed, className ) {
	animatedZoom.popEx( obj, newLeft, newTop, newWidth, newHeight, speed, className );
}

function resetPopBox() {
	animatedZoom.reset();
}

html.addLoadEvent( function() {
	animatedZoom.initPbSrc();
	animatedZoom.initPbPopBar();
});

