function WinOpen(url,winName)
{
	features = "toolbar=0,location=0,menubar=0,directories=0,resizable=1,status=0,scrollbars=1,width=610,height=480";
	window.open(url,winName,features);
}

function GalleryOpen(url,winName)
{
	features = "toolbar=0,location=0,menubar=1,directories=0,resizable=0,status=0,scrollbars=0,width=640,height=595";
	window.open(url,winName,features);
}

function InventoryOpen(url,winName)
{
	features = "toolbar=0,location=0,menubar=1,directories=0,resizable=0,status=0,scrollbars=0,width=640,height=595";
	window.open(url,winName,features);
}

function CouponOpen(url,winName)
{
	features = "toolbar=1,location=0,menubar=0,directories=0,resizable=1,status=0,scrollbars=0,width=520,height=250";
	window.open(url,winName,features);
}

function VtourOpen(url,winName,pxWidth,pxHeight)
{
	features = "toolbar=0,location=0,menubar=0,directories=0,resizable=1,status=0,scrollbars=0,width=" + pxWidth + ",height=" + pxHeight;
	window.open(url,winName,features);
}

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;
}

function ImageFit() {

	// netscape 4.x
	if ((isNav) && (nVer < 5)) {
		var w = document.images.GalleryShot.width + 100;
		var h = document.images.GalleryShot.height + 250;
		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.GalleryShot.width + 100;
		var h = document.images.GalleryShot.height + 155;
		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) {
		var w = document.images.GalleryShot.width + 120;
		var h = document.images.GalleryShot.height + 190;
		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);
   }
   
   self.focus();
}

function GalleryFit() {

	// netscape 4.x
	if ((isNav) && (nVer < 5)) {
		var w = document.images.GalleryShot.width + 100;
		var h = document.images.GalleryShot.height + 298;
		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.GalleryShot.width + 100;
		var h = document.images.GalleryShot.height + 233;
		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) {
		var w = document.images.GalleryShot.width + 120;
		var h = document.images.GalleryShot.height + 270;
		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);
   }
   
   self.focus();
}

function InventoryFit() {

	// netscape 4.x
	if ((isNav) && (nVer < 5)) {
		var w = document.images.GalleryShot.width + 100;
		var h = document.images.GalleryShot.height + 308;
		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.GalleryShot.width + 100;
		var h = document.images.GalleryShot.height + 276;
		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) {
		var w = document.images.GalleryShot.width + 120;
		var h = document.images.GalleryShot.height + 310;
		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);
   }
   
   self.focus();
}
