function Enlarge(cat) {

var catpath = cat? "mid" : "hi";
var catpref =  cat? "m" : "hi";
var imgwidth =  cat? midwidth : hiwidth;
var imgheight = cat? midheight : hiheight;
var scrollbars = "no";
var width = cat? midwidth + 18 : hiwidth + 20;
var height = cat? midheight + 19 : hiheight + 25;
var margin = "0";

if ((width+50) > screen.width) {width = screen.width - 100; scrollbars = "yes"}
if ((height+50) > screen.height) {height = screen.height - 100; width = width + 30; scrollbars = "yes"; margin = "16"}

if (width > 1200 && screen.width < 1280) {width = 1200}
if (height > 970 && screen.height < 1024) {height = 970}

var WindowName = "Window" + Math.random().toString().substring(2,7);
WindowName = window.open( "about:blank",WindowName,'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=' + scrollbars + ',toolbar=no,status=no')
WindowName.document.open();
WindowName.document.write("<html><head></head><title>GALLERY " + NumGallery + " PHOTO " + NumCurrent + "</title><body bgcolor='#060620' text='white' topmargin=" + margin + " bottommargin=" + margin + " leftmargin=0 rightmargin=0>");
WindowName.document.write("<table width=100% height=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle>");
WindowName.document.write("<img src='" + bigimageserver + "photo/gallery" + NumGallery + "/" + catpath + "/photo" + NumCurrent + catpref + ".jpg' width=" + imgwidth + " height=" + imgheight + " vspace=0 hspace=0 align=top border=0 style='border:1px solid white'>");
WindowName.document.write("</td></tr></table></body></html>");
WindowName.document.close();
}

function ExifEnlarge() {

var scrollbars = "no";
var winwidth = width + 20;
var winheight = height + 25;
var margin = "0";

if ((winwidth +50) > screen.width) {winwidth = screen.width - 100; scrollbars = "yes"}
if ((winheight +50) > screen.height) {winheight = screen.height - 100; winwidth = winwidth + 30; scrollbars = "yes"; margin = "16"}


var WindowName = "Window" + Math.random().toString().substring(2,7);
WindowName = window.open( "about:blank",WindowName,'width=' + winwidth + ',height=' + winheight + ',resizable=yes,scrollbars=' + scrollbars + ',toolbar=no,status=no')
WindowName.document.open();
WindowName.document.write("<html><head></head><title>GALLERY " + NumGallery + " PHOTO " + NumCurrent + "</title><body bgcolor='#060620' text='white' topmargin=" + margin + " bottommargin=" + margin + " leftmargin=0 rightmargin=0>");
WindowName.document.write("<table width=100% height=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center valign=middle>");
WindowName.document.write("<img src='" + Server + "photo/gallery" + NumGallery + "/lo/photo" + NumCurrent + "lo.jpg' width=" + width + " height=" + height + " vspace=0 hspace=0 align=top border=0 style='border:1px solid white'>");
WindowName.document.write("</td></tr></table></body></html>");
WindowName.document.close();
}

function OpenExif() {
var scrollbars = "no";
var width = 260;
var height = 400;
var margin = "0";

if ((width+50) > screen.width) {width = screen.width - 100; scrollbars = "yes"}
if ((height+50) > screen.height) {height = screen.height - 100; width = width + 30; scrollbars = "yes"; margin = "16"}

var WindowName = "Window" + Math.random().toString().substring(2,7);
var addr = Server + "photo/exif" + NumGallery + NumCurrent + ".html";
WindowName = window.open(addr,WindowName,'width=' + width + ',height=' + height + ',resizable=yes,scrollbars=' + scrollbars + ',toolbar=no,status=no')
WindowName.focus();
}

function Browser() {
	var b=navigator.appName;
	if (b=="Netscape") this.b="ns";
	else if ((b=="Opera") || (navigator.userAgent.indexOf("Opera")>0)) this.b = "opera";
	else if (b=="Microsoft Internet Explorer") this.b="ie";
	if (!b) alert('Unidentified browser./nThis browser is not supported,');
	this.version=navigator.appVersion;
	this.v=parseInt(this.version);
	this.ns=(this.b=="ns" && this.v>=4);
	this.ns4=(this.b=="ns" && this.v==4);
	this.ns6=(this.b=="ns" && this.v==5);
	this.ie=(this.b=="ie" && this.v>=4);
	this.ie4=(this.version.indexOf('MSIE 4')>0);
	this.ie5=(this.version.indexOf('MSIE 5')>0);
	this.ie55=(this.version.indexOf('MSIE 5.5')>0);
	this.ie6=(this.version.indexOf('MSIE 6.0')>0);
	this.opera=(this.b=="opera");
	this.dom=(document.createElement && document.appendChild && document.getElementsByTagName)?true:false;
	this.def=(this.ie||this.dom); // most used browsers, for faster if loops
	var ua=navigator.userAgent.toLowerCase();
	if (ua.indexOf("win")>-1) this.platform="win32";
	else if (ua.indexOf("mac")>-1) this.platform="mac";
	else this.platform="other";
}
is = new Browser();


