	
	function blendimage(group, id) { 
	    var millisec = 200; 
	    var speed = Math.round(millisec / 100); 
	    var timer = 0;
	     
	    //set the current image as background 
	    document.getElementById("div_" + group).style.backgroundImage = "url(" + document.getElementById("image_" + group).src + ")"; 
	     
	    //make image transparent 
	    changeOpac(0, "image_" + group); 
	     
	    //make new image 
	    document.getElementById("image_" + group).src = "images/small/" + group + "[" + id + "].jpg"; 
	
	    //fade in image 
	    for(i = 0; i <= 100; i++) { 
	        setTimeout("changeOpac(" + i + ",'" + "image_" + group + "')",(timer * speed)); 
	        timer++; 
	    } 
	}
	
	function changeOpac(opacity, object_id) { 
	    var object = document.getElementById(object_id).style; 
	    object.opacity = (opacity / 100); 
	    object.MozOpacity = (opacity / 100); 
	    object.KhtmlOpacity = (opacity / 100); 
	    object.filter = "alpha(opacity=" + opacity + ")"; 
	}
	
	
	
	var cur_group = 'home';
	var cur_id = 1;
	
	max_count = new Object();
	max_count['alpbach'] = 8;
	max_count['apartment'] = 8;
	max_count['bathroom'] = 7;
	max_count['bedroom1'] = 4;
	max_count['bedroom2'] = 3;
	max_count['home'] = 13;
	max_count['kitchen'] = 10;
	max_count['livingroom'] = 10;
	max_count['summer'] = 6;
	max_count['winter'] = 5;
	max_count['seenlandcard'] = 1;
	
	
	function lightbox_start(group, id) {
		cur_group = group;
		cur_id = id;
		
		//fade
			object = document.getElementById("lightbox_back");
			
			object.style.display = "block";
			object.style.opacity = 0; 
	   	 	object.style.MozOpacity = 0; 
	   	 	object.style.KhtmlOpacity = 0; 
	    	object.style.filter = "alpha(opacity=0)"; 
		
			var millisec = 500; 
		    var speed = Math.round(millisec / 100); 
		    var timer = 0;	    
			for(i = 0; i <= 100; i++) { 
		        setTimeout("changeOpac(" + i + ",'" + "lightbox_back" + "')",(timer * speed)); 
		        timer++; 
		    }
		    
		//swap image
			document.getElementById("lightbox_image").src= "images/big/" + group + "[" + id + "].jpg";
		    
	}
	
	function lightbox_stop() {
		object = document.getElementById("lightbox_back");
						
		if(object.style.opacity == 1) {
		
			//fade
				var millisec = 250; 
			    var speed = Math.round(millisec / 100); 
			    var timer = 0;
			    for(i = 0; i <= 100; i++) { 
			        setTimeout("changeOpac(" + (100-i) + ",'" + "lightbox_back" + "')",(timer * speed)); 
			        timer++; 
			    }
			    setTimeout("object.style.display = 'none'", (timer * speed));			    
		}
	}
	
	function lightbox_nextimg(direction) {
		if((cur_id + direction) > max_count[cur_group]) id = 1;
		else if((cur_id + direction) < 1) id = max_count[cur_group];
		else id = cur_id + direction;
		cur_id = id;
		
		
		document.getElementById("lightbox_image").src= "images/big/" + cur_group + "[" + id + "].jpg";
	}
