	var browser = navigator.appName;
	var images = {};
	
	//important variable, to indiate whether the preview is currently being shown or not
	var showingPreview = false;
	
	function adjustModalPosition(cursor)
	{
		if (!isVisible())
			return false;
		
		adjustPopPosition(cursor.x, cursor.y, 15);
	}
	
	
	function hidePreview()
	{
		showingPreview = false;
		
		//alert('hidePreview');
		if(document.getElementById('popupFrame').contentWindow.showLoading)
			document.getElementById('popupFrame').contentWindow.showLoading();
		else if(top.frames['popupFrame'].showLoading)
			top.frames['popupFrame'].showLoading();
		hidePopWin(false);
	}

	function getScrollLeft()
	{
		if (self.pageXOffset) // all except Explorer
		{
			return self.pageXOffset;
		}
		else if (document.documentElement && document.documentElement.scrollLeft)
			// Explorer 6 Strict
		{
			return document.documentElement.scrollLeft;
		}
		else if (document.body) // all other Explorers
		{
			return document.body.scrollLeft;
		}
	}
	function getScrollTop()
	{
		if (self.pageYOffset) // all except Explorer
		{
			return self.pageYOffset;
		}
		else if (document.documentElement && document.documentElement.scrollTop)
			// Explorer 6 Strict
		{
			return document.documentElement.scrollTop;
		}
		else if (document.body) // all other Explorers
		{
			return document.body.scrollTop;
		}
	}
	
	function getPosition(e)
	{
		//alert('inside getPosition');
		//e = e || window.event;
		var cursor = {x:0, y:0};
		if (e.pageX || e.pageY)
		{
			//alert(1);
			//alert(e.pageY);
			cursor.x = e.pageX - getScrollLeft();
			cursor.y = e.pageY - getScrollTop();
			//alert(cursor.y);
		} 
		else if (e.clientX && e.clientY)
		{
			//alert(2);
			//alert(e.clientY);
			cursor.x = e.clientX;// - getScrollLeft();// + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
			cursor.y = e.clientY;// - getScrollTop();// + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
			//alert(cursor.y);
		}
		else
		{
			cursor = null;
		}
		return cursor;
	}
	function doNothing(val)
	{
		return false;
	}
