/**
 *
 *
 */
function Fotos(){
	
	/**
	 * Mach das Div mit der ID divShowPic sichtbar und spannt es auf die Groesse
	 * des gesamten Browserfenster auf
	 */
	this.show = function (objEv, idImage){
		var objDivShowPic, arrSize, url;
		var param = new Array();
	
		if(!(objDivShowPic = document.getElementById('divShowPic'))){
			alert("Can't get Div divShowPic'");
			return;
		}
		
		objDivShowPic.style.display = 'block';
		objDivShowPic.style.top     = '0px';
		objDivShowPic.style.left    = '0px';
		
		document.getElementsByTagName('body')[0].style.overflow = 'hidden';
		
		arrSize = this.getWindowSize();
		
		objDivShowPic.style.width  = arrSize[0] + 'px';
		objDivShowPic.style.height = arrSize[1] + 'px';
				
		param.push('width='  + arrSize[0]);
		param.push('height=' + arrSize[1]);
		
		url = '/image/show/' + idImage;
		
		objSite.sendXmlHttpRequest(url, 'divShowPic', param);
		
		return;	
	}
	
	
	/**
	 * Leert das Div mit der ID divShowPic und macht es wieder unsichtbar
	 */
	this.close = function(objEv){
		var objDivShowPic;
	
		if(!(objDivShowPic = document.getElementById('divShowPic'))){
			alert("Can't get Div divShowPic'");
			return;
		}
		
		objDivShowPic.innerHTML     = ''; 
		objDivShowPic.style.display = 'none';
		objDivShowPic.style.top     = '0px';
		objDivShowPic.style.left    = '0px';
		objDivShowPic.style.width   = '0px';
		objDivShowPic.style.height  = '0px';
		
		document.getElementsByTagName('body')[0].style.overflow = 'auto';
		
		return;
	}
	 
	
	
	/**
	 * Ermittelt die Groesse des Browserfesnsters und liefert diese als Array
	 * Index 0 = Breite
	 * Index 1 = Hoehe
	 */
	this.getWindowSize = function(){
		var arrSize = new Array();
		
		try{
			arrSize[0] = window.innerWidth;
			arrSize[1] = window.innerHeight;
		} catch(e) {
			// f**king IEs
			arrSize[0] = document.body.clientWidth;
			arrSize[1] = document.body.clientHeight;
		}
		
		if(arrSize[0] == undefined){
			// f**king IEs
			arrSize[0] = document.documentElement.clientWidth;
			arrSize[1] = document.documentElement.clientHeight;
		}
		
		return arrSize;
	}


}

var objFotos = new Fotos();
