
var isNav4, isIE4;

if (parseInt(navigator.appVersion.charAt(0)) >= 4)
{
	isNav4 = (navigator.appName == "Netscape") ? 1 : 0;
	isIE4 = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
}

function openwin(picture)
{
	var win;
	var linker;

	win = window.open("image-window.html","","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, top=50, left=150");

	win.document.open();
	win.document.write("<html><head><script src='images.js'></script><script src='window.js'></script><script type='text/javascript'>var linker ='" + picture + "'</script><title>Celebrity Photo Studio</title></head><body onmousedown='noclick()'; onLoad='fitWindowSize()'; onBlur=this.close();><div style='position:absolute; left:0px; top:0px'><script type='text/javascript'>document.write(\"<img border=0 src=\" +linker + \" galleryimg='no'>\");</script></div></body></html>");
	win.document.close();
}

function opengallery(gallery)
{
	window.open(gallery,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, top=50, left=150");
}

function fitWindowSize()
{
	if (isNav4)
	{
		window.innerWidth = document.layers[0].document.images[0].width;
		window.innerHeight = document.layers[0].document.images[0].height;
	}

	if (isIE4)
	{
		window.resizeTo(500, 500);
		width = 500 - (document.body.clientWidth -  document.images[0].width);
		height = 500 - (document.body.clientHeight -  document.images[0].height);
		window.resizeTo(width, height);
	}
}

function noclick()
{
	if (event.button == 2)
	{
		var name = confirm(message);

		if (name == true)
		{
			alert(emailWarning);

			open("mailto:robert@celebrityphotostudio.com?subject=Website%20Customer")
		}
	}

	if(event.srcElement.tagName=='IMG')
		disable.button = 1;
}

function noclick_index()
{
	if (event.button == 2)
	{
		if(event.srcElement.tagName=='IMG')
		{
			var name = confirm(message);

			if (name == true)
			{
				alert(emailWarning);	


				open("mailto:robert@celebrityphotostudio.com?subject=Website%20Customer")
			}
		}
	}
}
