function getXOffset() {	var x = 0;	if( typeof(window.pageXOffset) == 'number' ) {		x = window.pageXOffset;	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {		x = document.body.scrollLeft;	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {		x = document.documentElement.scrollLeft;  }  return x;}function getYOffset() {	var y = 0;	if( typeof(window.pageYOffset) == 'number' ) {		y = window.pageYOffset;	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {		y = document.body.scrollTop;	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {		y = document.documentElement.scrollTop;  }  return y;}function add0(x, l) {	var xs = x.toString();	var out = "";	if (xs.length < l) {		for (var i = 0; i < l-xs.length; i++) {			out += "0";		}	}	out += xs;	return out;}var current = 0;var group = 0;function setImage(g,x) {	current = parseInt(x);	group = parseInt(g);		fi.src = di.src;	fi.style.marginTop = '0px';	fi.style.marginLeft = '0px';	fi.style.width = '600px';	fi.style.height = '600px';		var i = new Image();	i.src = '/i/foto/' + add0(g, 8) + '/gallery-' + add0(parseInt(x), 6) + '.jpg';	fi.src = i.src;	if (im[parseInt(x)-1][3] < 600) {		fi.style.marginTop = (300 - im[parseInt(x)-1][3]/2) + 'px';		fi.style.marginLeft = '0px';	} else {		fi.style.marginTop = '0px';		fi.style.marginLeft = (300 - im[parseInt(x)-1][2]/2) + 'px';	}	fi.style.width = im[parseInt(x)-1][2]+'px';	fi.style.height = im[parseInt(x)-1][3]+'px';		if (fpi) {		var i = new Image();		i.src = '/i/foto/' + add0(g, 8) + '/gallery-tn-' + add0(getPrev(parseInt(x)), 6) + '.jpg';		fpi.src = i.src;	}	if (fni) {		var i = new Image();		i.src = '/i/foto/' + add0(g, 8) + '/gallery-tn-' + add0(getNext(parseInt(x)), 6) + '.jpg';		fni.src = i.src;	}}function setSingleImage(im,x) {	fi.src = di.src;		var i = new Image();	i.src = im;	fi.src = i.src;	if (x) {		fi.style.marginTop = '100px';		fi.style.marginLeft = '0px';		fi.style.width = '600px';		fi.style.height = '400px';	} else {		fi.style.marginTop = '0px';		fi.style.marginLeft = '100px';		fi.style.width = '400px';		fi.style.height = '600px';	}}function getPrev(x) {	return (x > 1) ? x - 1 : (im.length - 1);}function getNext(x) {	return (x < im.length - 1) ? x + 1 : 1;}function popup(g,x) {	setImage(g,x);		ffd.style.display = 'block';	ffd.style.height = document.body.scrollHeight;	mvpopup();	fbd.style.display = 'block';		return false;}function popupSingle(im,x) {	setSingleImage(im,x);		ffd.style.display = 'block';	ffd.style.height = document.body.scrollHeight;	mvpopup();	fbd.style.display = 'block';		return false;}function depopup() {	fi.src = di.src;	fi.style.marginTop = '0px';	ffd.style.display = 'none';	ffd.style.height = '1px';	fbd.style.display = 'none';	return false;}function mvpopup() {	ffd.style.height = document.body.scrollHeight;	fbd.style.top = ((document.body.clientHeight - 600) / 2) + "px";}function prev() {	setImage(group, getPrev(current));	return false;}function next() {	setImage(group, getNext(current));	return false;}// fotofade <div>var	ffd = document.getElementById('foto-fade');// fotoframe <div>var	fbd = document.getElementById('foto-box');// foto <div>var	fd = document.getElementById('foto');// foto <img>var	fi = document.getElementById('foto-img');// fotoprev <img>var	fpi = document.getElementById('foto-img-prev');// fotoprev <img>var	fni = document.getElementById('foto-img-next');// default imagevar di = new Image();di.src = '/i/foto/fade.png';var b = document.getElementsByTagName('body');b = b[0];if (window.addEventListener) {	window.addEventListener ("resize", mvpopup, false);} else if (window.attachEvent) {	//window.attachEvent ("resize", re);} else {	window.onresize = mvpopup;}