var isNav, isIE, nVer = parseInt(navigator.appVersion.charAt(0));
if (nVer >= 4) {
	isNav = (navigator.appName == "Netscape") ? 1 : 0;
	isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
	agt = navigator.userAgent.toLowerCase();
	is_mac = (agt.indexOf("mac")!=-1);
}

function PhotoOpen(url,winName)
{
	features = "toolbar=0,location=0,menubar=0,directories=0,resizable=1,status=0,scrollbars=0,width=550,height=350";
	window.open(url,winName,features);
}

function VideoOpen(url,winName,pSize)
{
	if(pSize == "large") features = "toolbar=0,location=0,menubar=0,directories=0,resizable=0,status=0,scrollbars=0,width=320,height=256";
	if(pSize == "small") features = "toolbar=0,location=0,menubar=0,directories=0,resizable=0,status=0,scrollbars=0,width=240,height=196";
	window.open(url + "&size=" + pSize,winName,features);
}

function fit() {

	// netscape 4.x
	if ((isNav) && (nVer < 5)) {
		var w = document.images.PortfolioShot.width + 0;
		var h = document.images.PortfolioShot.height + 0;
		window.innerWidth = w;
		window.innerHeight = h;
		window.moveTo((screen.availWidth - window.outerWidth) / 2, (screen.availHeight - window.outerHeight) / 2);
		return;
	}


	// netscape 6.x
	if (isNav) {
		var w = document.images.PortfolioShot.width + 0;
		var h = document.images.PortfolioShot.height + 0;
		w = w - window.innerWidth;
		h = h - window.innerHeight;
		window.resizeBy(w, h);
		window.moveTo((screen.availWidth - window.outerWidth) / 2, (screen.availHeight - window.outerHeight) / 2);
   		return;
   }

	// i.e.
	if ((isIE) && (is_mac)) {
		var w = document.images.PortfolioShot.width + 0;
		var h = document.images.PortfolioShot.height + 0;
		if (w > screen.availWidth) w = screen.availWidth;
		if (h > screen.availHeight) h = screen.availHeight;
		
		window.resizeTo(w, h);
		window.moveTo((screen.availWidth - w) / 2, (screen.availHeight - h) / 2);
   		return;
	}

	if (isIE) {
		var w = document.images.PortfolioShot.width + 11;
		var h = document.images.PortfolioShot.height + 30;
		if (w > screen.availWidth) w = screen.availWidth;
		if (h > screen.availHeight) h = screen.availHeight;
		
		window.resizeTo(w, h);
		window.moveTo((screen.availWidth - w) / 2, (screen.availHeight - h) / 2);
   		return;
	}
}