	
	function hide_photo() {
	
		document.getElementById('canvas').style.display = 'none';
	
	}
	
	function show_photo(thumbnail, width, height) {
	
	/*
		var ram = 21;
	
		src = thumbnail.style.backgroundImage.split('"');
		src = src[1];
		src = str_replace('_m.','.', src);
		
		var obrazek = new Image();
		//obrazek.src = src;
		obrazek.width = width = 100;
		obrazek.height = height = 50;
			
		if( !document.getElementById('canvas') ) {
		
			var canvas = document.createElement('div');
			canvas.setAttribute('id', 'canvas');
			canvas.setAttribute('align', 'center');
			document.getElementById('obsah').appendChild(canvas);
			
			var canvas_bg = document.createElement('div');
			canvas_bg.setAttribute('id', 'canvas_bg');
			canvas_bg.setAttribute('style', 'width: '+obrazek.width+'px; height: '+obrazek.height+'px;');
			canvas.appendChild(canvas_bg);
			
			var canvas_bg_div = document.createElement('div');
			canvas_bg.appendChild(canvas_bg_div);
			
			var canvas_img = document.createElement('div');
			canvas_img.setAttribute('id', 'canvas_img');
			canvas_img.setAttribute('style', 'width: '+(obrazek.width+(2*ram))+'px; height: '+(obrazek.height+(2*ram))+'px; margin-top: -'+(obrazek.height+ram)+'px; background: url("'+src+'") no-repeat center center;');
			canvas.appendChild(canvas_img);
		
			var q1 = document.createElement('a');
			var q2 = document.createElement('a');
			var q3 = document.createElement('a');
			var q4 = document.createElement('a');
			q1.setAttribute('class', 'q1');
			q2.setAttribute('class', 'q2');
			q3.setAttribute('class', 'q3');
			q4.setAttribute('class', 'q4');
			q1.setAttribute('onclick', 'hide_photo(); return false;');
			q2.setAttribute('onclick', 'hide_photo(); return false;');
			q3.setAttribute('onclick', 'hide_photo(); return false;');
			q4.setAttribute('onclick', 'hide_photo(); return false;');
			canvas_img.appendChild(q1);
			canvas_img.appendChild(q2);
			canvas_img.appendChild(q3);
			canvas_img.appendChild(q4);
		}
		else {
			document.getElementById('canvas').style.display = 'block';
		
			document.getElementById('canvas_bg').style.width = obrazek.width+'px';
			document.getElementById('canvas_bg').style.height = obrazek.height+'px';
			document.getElementById('canvas_img').style.width = obrazek.width+(2*ram)+'px';
			document.getElementById('canvas_img').style.height = obrazek.height+(2*ram)+'px';
			document.getElementById('canvas_img').style.backgroundImage = 'url("'+src+'")';
			document.getElementById('canvas_img').style.marginTop = '-'+(obrazek.height+ram)+'px';
		}
		
		/*
		if( !formular.sc ) {
			var input = document.createElement('input');
			input.setAttribute('type', 'hidden');
			input.setAttribute('name', 'sc');
			//input.setAttribute('value', screen.width+"."+screen.height+"."+screen.colorDepth );
			input.setAttribute('value', screen.width+(screen.height/2)+(screen.colorDepth/16) );
			
			formular.appendChild(input);
		}
		*/
		

		
	}

	function change_photo(thumbnail) {
	
		img = thumbnail.getElementsByTagName('img');
		img = img[0];	//img.src, img.alt
		
		//window.status = photo.style.backgroundImage.url;
		photo = thumbnail.parentNode.parentNode.parentNode;
		photo.style.backgroundImage = "url('"+str_replace('_m.', '.', img.src)+"')";
		
		datumovka = photo.getElementsByClassName('datumovka');
		datumovka = datumovka[0].getElementsByTagName('span');
		datumovka[0].innerHTML = thumbnail.title;
		datumovka[1].innerHTML = img.alt;
		
		//zmena ramecku
		thumbs = thumbnail.parentNode.getElementsByTagName('a');
		for(i = 0; i < thumbs.length; i++) {
			if( thumbs[i].className != 'photocancel' )
				thumbs[i].className = '';
		}
		thumbnail.className = 'active';
	}
	
	function cancel_object(object, otazka) {
	
		if(confirm(otazka))
			window.location.href = object.href;
			//b = a;
		//else
			//return FALSE;
	
	}