function openGalery(url) {
	// for 800x600
	var width = 770;
	var height = 500;
	var dim = "width=" + width + ",height=" + height;
	if (screen && screen.availHeight && screen.availWidth) {
		//alert(screen.availHeight);
		//alert(screen.height);
		if (screen.availHeight > 700) height = screen.availHeight - 120;
		var top =  Math.ceil((screen.availHeight - height) * 0.5);
		var left = Math.ceil((screen.availWidth - width) * 0.5);
		dim = "width=" + width + ",height=" + height + ",top=" + top + ",left=" + left;
	}
	w = window.open('/upload/imgallery/' + url, 'galerija', "scrollbars=1,resizable=1," + dim);
	w.focus();
}
