var Foto = {
	
	show: function(escape) {
		this.active = true;
//		this.update();
//		this.notify();	
		new Effect.Appear($('BlendOverlay'), {duration: 0.1, to: 0.4, afterFinish: function() {
			new Effect.Appear($('FotoElement'), {duration: 0.15});							
		}});
	},
	
	hide: function() {		
		this.active = true;
		new Effect.Fade($('BlendOverlay'), {duration: 0.1, afterFinish: function() {
			new Effect.Fade($('FotoElement'), {duration: 0.15});			
		}.bind(this)});
	},
	
	toggle: function() {
		if (this.active) {
			this.hide();
		}
		else {
			this.show();
		}
	},

	FocusFoto: function(id, path, aantal) {
		$('FotoGroot').src = path;
		for(i = 0; i < aantal; i ++) {
			$('popup'+i).className = 'pictureSelect';
		}
		$(id).className = 'pictureFocus';
	},

	showFoto: function(id, path, aantal) {
		Foto.show();
		$('FotoGroot').src = path;	
		if(aantal != 0) {
			for(i = 0; i < aantal; i ++) {
				$('popup'+i).className = 'pictureSelect';
			}
			$(id).className = 'pictureFocus';		
		}
	},
	
	// Requires common.js voor Common.getDocumentSize();
	updatePositions: function()
	{	
		// Set Vars
		var documentSize 	= Foto.getDocumentSize();
//		var windowSize 		= document.viewport.getDimensions();
//		var windowOffset 	= document.viewport.getScrollOffsets();
		var popupHeight		= $('FotoElement').getHeight();
//		var popupMarginTop	= windowOffset.top + (Math.round(windowSize.height / 2) - Math.round(popupHeight / 2));
		
		// Set width&height from blend element
		$('BlendOverlay').setStyle({ width: documentSize.width, height: documentSize.height });
		// Set popupElement's marginTop (+ reset top)
//		this.element.setStyle({ top: 0, marginTop: popupMarginTop });	
	},
	
	getDocumentSize: function()
	{
		var w, h;
		if (window.innerHeight && window.scrollMaxY) {
			w = window.innerWidth + window.scrollMaxX;
			h = window.innerHeight + window.scrollMaxY;
		} else if (document.body.scrollHeight > document.body.offsetHeight) {
			// all but Explorer Mac
			w = document.body.scrollWidth;
			h = document.body.scrollHeight;
		} else {
			// Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
			w = document.body.offsetWidth;
			h = document.body.offsetHeight;
		}
		return { width: w, height: h };
	}
	
}