//******************************************************************************************************************************/
//	LyteBox v2.02
//
//	 Author: Markus F. Hay
//  Website: http://www.dolem.com/
//	   Date: November 13, 2006
//	License: Creative Commons Attribution 2.5 License (http://creativecommons.org/licenses/by/2.5/)
// Browsers: Tested successfully on WinXP with the following browsers (using no DOCTYPE, Strict DOCTYPE, and Transitional DOCTYPE):
//				* Firefox: 2.0, 1.5
//				* Internet Explorer: 7.0, 6.0 SP2, 5.5 SP2
//				* Opera: 9.10
//
//     NOTE: LyteBox was written from the Lightbox class that Lokesh Dhakar (http://www.huddletogether.com)
//			 originally wrote. The purpose was to write a self-contained object that eliminates the dependency
//			 of prototype.js, effects.js, and scriptaculous.js. Most of the core functionality and code was
//			 left in tact, and several functions were added to mimic the effects provided by sciptaculous. These
//			 newly added functions include: appear(), fade(), resizeW(), resizeH(), and toggleSelects(). Functions
//			 that were not needed were removed, as were global variables. Additionally, support has been added for
//			 iFrame environments without any code modifications needed by the end user (auto-detect).
//
//			 Other changes include:
//				- new close, next, and previous images
//				- prev/next images are always displayed (as opposed to mousing over a part of the DIV to see them)
//
//			 That being said, the original comments by Lokesh are below:
//
//				* Lightbox v2.02
//				* by Lokesh Dhakar - http://www.huddletogether.com
//				* 3/31/06
//
//				* For more information on this script, visit: http://huddletogether.com/projects/lightbox2/
//				* Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
//	
//				* Credit also due to those who have helped, inspired, and made their code available to the public.
//				* Including: Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.org), Thomas Fuchs(mir.aculo.us), and others.
//
//******************************************************************************************************************************/
//  Extended Built-in Objects
//  - Array.prototype.removeDuplicates()
//  - Array.prototype.empty()
//
//	LyteBox Class Definition
//	- LyteBox()
//  - initialize()
//  - start()
//  - changeImage(imageNum)
//  - resizeImageContainer(imgWidth, imgHeight)
//  - showImage()
//  - updateDetails()
//  - updateNav()
//  - enableKeyboardNav()
//  - disableKeyboardNav()
//  - keyboardAction()
//  - preloadNeighborImages()
//  - end()
//  - appear(id, opacity)
//  - fade(id, opacity)
//  - resizeW(id, curW, maxW, timer)
//  - resizeH(id, curH, maxH, timer)
//  - getPageScroll()
//  - getPageSize()
//  - toggleSelects(state)
//  - pause(numberMillis)
//
//  - initLytebox()
//**************************************************************************************************************/
Array.prototype.removeDuplicates = function () { for (var i = 1; i < this.length; i++) { if (this[i][0] == this[i-1][0]) { this.splice(i,1); } } }
Array.prototype.empty = function () { for (var i = 0; i <= this.length; i++) { this.shift(); } }
var lbImageTag = "Obrázek ";
var lbOfTag = " z ";
//*************************/
// LyteBox constructor
//*************************/
function LyteBox(base) {
	/*** Start Configuration ***/	
  
	this.fileLoadingImage	= base+"plugins/content/jwsigpro/loading.gif";
	this.fileCloseImage 	= base+"plugins/content/jwsigpro/lytebox/english/closelabel.gif";
	
	this.resizeSpeed		= 5;	// controls the speed of the image resizing (1=slowest and 10=fastest)
	this.borderSize			= 12;	//if you adjust the padding in the CSS, you will need to update this variable
	this.maxOpacity			= 80;	// higher opacity = darker overlay, lower opacity = lighter overlay
	/*** End Configuration ***/
	
	
	if(this.resizeSpeed > 10) { this.resizeSpeed = 10; }
	if(this.resizeSpeed < 1) { resizeSpeed = 1; }
	this.resizeDuration = (11 - this.resizeSpeed) * 0.15;
	
	/* MEMBER VARIABLES USED TO CLEAR SETTIMEOUTS */
	this.resizeWTimerArray		= new Array();
	this.resizeWTimerCount		= 0;
	this.resizeHTimerArray		= new Array();
	this.resizeHTimerCount		= 0;
	this.showImageTimerArray	= new Array();
	this.showImageTimerCount	= 0;
	this.overlayTimerArray		= new Array();
	this.overlayTimerCount		= 0;
	this.imageTimerArray		= new Array();
	this.imageTimerCount		= 0;
	this.timerIDArray			= new Array();
	this.timerIDCount			= 0;
	
	/* GLOBAL */
	this.imageArray	 = new Array();
	this.activeImage = null;
	
	/* Check for iFrame environment (will set this.isFrame and this.doc member variables) */
	this.checkFrame();
	
	// We need to know the certain browser versions (or if it's IE) since IE is "special" and requires spoon feeding.
	/*@cc_on
		/*@if (@_jscript)
			this.ie = (document.all) ? true : false;
		/*@else @*/
			this.ie = false;
		/*@end
	@*/
	this.ie7 = (this.ie && window.XMLHttpRequest);
	
	/* INITIALIZE */
	this.initialize();
}
//********************************************************************************************/
// initialize()
// Constructor runs on completion of the DOM loading. Loops through anchor tags looking for 
// 'lytebox' references and applies onclick events to appropriate links. The 2nd section of
// the function inserts html at the bottom of the page which is used to display the shadow 
// overlay and the image container.
//********************************************************************************************/
LyteBox.prototype.initialize = function() {
	if (!document.getElementsByTagName) { return; }
	
	// populate array of anchors from the appropriate window (could be the parent or iframe document)
	var anchors = (this.isFrame) ? window.parent.frames[window.name].document.getElementsByTagName('a') : document.getElementsByTagName('a');
	// loop through all anchor tags
	for (var i = 0; i < anchors.length; i++) {
		var anchor = anchors[i];		
		var relAttribute = String(anchor.getAttribute('rel'));
		
		// use the string.match() method to catch 'lytebox' references in the rel attribute
		if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lytebox'))) {
			anchor.onclick = function () { myLytebox.start(this); return false; }
		}
	}
	
	// The rest of this code inserts html at the bottom of the page that looks similar to this:
	//
	//	
	//	
	//		
	//			
	//				
![]()
	//				
	//				
	//			
	//		
	//		
	//			
	//				
	//					
	//					
	//				
	//				
	//					

	//				
	//			
	//		
	//