$("a.prev").colorbox({scalePhotos:true,scrolling:false,maxWidth: "90%",maxHeight: "90%"});

if(document.getElementsByTagName){
	var contact = ['miner', '@', 'nofuture','.','cz']; 
	var a = document.getElementsByTagName("a");
	var i = 0, l=a.length;
	contact = contact.join(''); 
	while(i<l){
		if(a[i].href.match(/^mailto:/)){	// email contact
			if(a[i].innerHTML.match(/at domain/))
				a[i].innerHTML = contact; 
			
			a[i].href = "mailto:"+contact; 
		} else if (a[i].href.match(/(jpg|jpeg|png|gif)$/i)) {	// image
			//a[i].onclick = function(){return detail.show(this)};
		}
		i++;
	}
	detail = {
		show: function(tg){
			var dt = document.getElementById("detail"); 
			dt.onclick = detail.hide;
			dt.innerHTML = "<div class='message'>Click to close the detail</div><img src='"+tg.href+"'>";
			dt.style.display="block"; 
			var pos = Element.position(tg.firstChild) ;
			dt.style.top = pos.y+"px";
			dt.style.left = pos.x + "px";
			return false;
		}, 
		hide: function(){
			document.getElementById("detail").style.display = "none";
			return false;
		}
	};
	var Element = {
		position: function(element){
			var curleft = curtop = 0;
			if (element.offsetParent || element.offsetLeft) {
				do {
					curleft += element.offsetLeft;
					curtop += element.offsetTop;
				} while(element = element.offsetParent);
			}
			return {x: curleft, y: curtop};
		},
		
		moveTo: function(element, position){
				element.style.left = position.x + "px";
				element.style.top = position.y + "px";
		}
	}
}
