// PopImages 09FEB2005 Version 1.0
// Christopher T. Tillman, February 2005
// Copyright © 2005 Digital Magic Productions, Inc.
// E-mail me at CTTillman@hotmail.com for any technical questions.
//
// Digital Magic Productions, Inc. grants you a royalty free license to use or
// modify this software provided that this copyright notice appears on all copies.
// This software is provided "AS IS" without a warranty of any kind.
function BrowserCheck() {
	this.version = navigator.appVersion;
	this.pc = (this.version.indexOf('Win')>0);
	this.mac = (this.version.indexOf('PPC')>0);
	this.ie = document.all?true:false;
	this.ns6 = document.getElementById&&!document.all?true:false;
}
var is = new BrowserCheck();
var SmallPath, MidPath, HighPath;
// set dimensions to default settings if no values are passed through ImageSizes.
var SmallW = 400;
var SmallH = 300;
var MidW = 640;
var MidH = 480;
var HighW = 800;
var HighH = 600;
function ImageSizes(sw,sh,mw,mh,hw,hh) {
// Call this function in <body> with onLoad and enter image sizes for Small, Medium, and High resolution images.
	SmallW = sw;
	SmallH = sh;
	MidW = mw;
	MidH = mh;
	HighW = hw;
	HighH = hh;
}
function ImagePath(s,m,h) {
// Call this function in <body> with onLoad and enter the paths to Small, Medium, and High resolution images.
	SmallPath = s;
	MidPath = m;
	HighPath = h;
}
function CheckAndPop(u,n) {
	var path;
	if (screen.width>(parseInt(HighW) + 50) && (HighPath)) {
		path = HighPath + u;
		PopImage(path,n,HighW,HighH);
	}
	else if (screen.width>(parseInt(MidW) + 50) && (MidPath)) {
		path = MidPath + u;
		PopImage(path,n,MidW,MidH);
	}
	else if (screen.width>(parseInt(SmallW) + 50) && (SmallPath)) {
		path = SmallPath + u;
		PopImage(path,n,SmallW,SmallH);
	}
// If no paths are set, default to 400 x 300
	else {
		path = u;
		PopImage(path,n,SmallW,SmallH);
	}	
}
function PopImage(u, n, w, h) {
// PC systems automatically add a 10 pixel margin to top and left of Pop Up window - This centers the image.
	if (is.pc||is.ns6) {
		w = parseInt(w) + 20;
		h = parseInt(h) + 20;
	}
// This centers the Pop Up window  on the viewers screen.
	newWindow = window.open(u, n,"width=" + w + ",height=" + h + ",screenX=" + (screen.width-w)/2 + ",screenY=" + (screen.height-h)/2 + ",left=" + (screen.width-w)/2 + ",top=" + (screen.height-h)/2 + ",dependent=1,status=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,toolbar=0");
}