jQuery.noConflict();

jQuery(function () {
	jQuery("a.photozoom, #galeria li a").fancybox({
		'overlayShow'   : true,
		'titlePosition' : 'inside',
		'transitionIn'  : 'elastic',
		'transitionOut' : 'elastic'
	});
})

function bch() {
	jQuery('#overlay').css({height: jQuery(document).height()});
}
setInterval('bch()', 100)

function loadContent (id, container) {
	document.getElementById(container).innerHTML = document.getElementById("loadProgress").innerHTML;
	advAJAX.get({
		tag: container,
		url: "/loadContent.php?m=" + id,
		timeout : 9000,
		onTimeout : function() {  },
		retry: 2,
		retryDelay: 2000,
		onRetry : function() {  },
		onRetryDelay : function() {  },
		onSuccess : function(obj) {
	        document.getElementById(obj.tag).innerHTML = obj.responseText;
		},
		onError : function(obj) { alert("Error: " + obj.status); }
	});

}

function loadPhoto (photoUrl, photoWidth, photoHeight) {

	windowWidth = document.width;
	windowWidth = document.body.offsetWidth;
	photoWidth = photoWidth+10;
	math_1 = photoWidth/2;
	math_2 = windowWidth/2;

	marginLeft = math_2-math_1;
	marginLeft = marginLeft +5;
	document.getElementById('photoArea').style.marginLeft = marginLeft + "px";
	document.getElementById('photoArea').style.display = 'block';

	document.getElementById('loadImg').style.display = 'none';
	document.getElementById('loader').style.display = 'block';
	document.getElementById('loadImg').src = photoUrl;
}

function oloadPhoto (){
	document.getElementById('loadImg').style.display = 'block';
	document.getElementById('loader').style.display = 'none';
}

function closePhoto () {
	document.getElementById('photoArea').style.display = 'none';
}

function mailTo (user, domain) {
	document.location.href = 'mailto:' + user + '@' + domain;
}
