﻿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 fitWindowSize() 
{
	var mywidth= 575;
	var myheight = 775;
	var WidthBuffer = 50;
	var HeightBuffer = 130;
	var img = document.images[0];
	var newXPos = (screen.width - mywidth - WidthBuffer) / 2;
	var newYPos = (screen.height - myheight - HeightBuffer) / 2;
	
	if (!(img == null))
	{
		mywidth = img.width + WidthBuffer;
		myheight = img.height + HeightBuffer;
		
		if ( img.width > mywidth )
		{
			if (mywidth > screen.width) 
				mywidth = screen.width;
			if (myheight > screen.height)
				myheight = screen.height;
		}
		
		newXPos = (screen.width - img.width - WidthBuffer) / 2;
		newYPos = (screen.height - img.height - HeightBuffer) / 2;
	}

	window.resizeTo(mywidth, myheight);
	window.moveTo(newXPos, newYPos);
}


var message="Image Copy Is Not Permitted"; // Your no right click message here
var closeWin="1"; // Do you want to close window after message (1 for yes 0 for no)

// JavaScript by Dave Lauderdale
// Published at: www.digi-dl.com

function IE(e) 
{
	if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
	{
		//alert(message); if(closeWin=="1") self.close();
		self.close();
	}
}
function NS(e) 
{
	if (document.layers || (document.getElementById && !document.all))
	{
		if (e.which==2 || e.which==3)
		{
			//alert(message);
			//return false;
		    self.close();
		}
	}
}
document.onmousedown=IE;document.onmouseup=NS;document.oncontextmenu=new Function("return false");

