function detectVersion()
{ 
version = parseInt(navigator.appVersion);
//alert("version="+version);
return version; 
} 

function detectOS()
{ 
if(navigator.userAgent.indexOf('Win') == -1) {
OS = 'Macintosh'; 
} else { 
OS = 'Windows'; 
} 
return OS; 
} 

function detectBrowser()
{ 
if(navigator.appName.indexOf('Netscape') == -1) {
browser = 'IE'; 
} else { 
browser = 'Netscape';
} 
//alert("Browser="+browser);
return browser; 
} 


function FullScreen(){
var adjWidth = 10; 
var adjHeight = 60; 
if((detectOS() == 'Macintosh') && (detectBrowser() == 'Netscape'))
{ 
adjWidth = 20; 
adjHeight = 35; 
} 
if((detectOS() == 'Macintosh') && (detectBrowser() == 'IE'))
{ 
adjWidth = 0; 
adjHeight = 0; 
} 
if((detectOS() == 'Windows') && (detectBrowser() == 'Netscape'))
{ 
adjWidth = 0; 
adjHeight = 30; 
} 
if(detectVersion() < 4)
{ 
self.location.href = 'main.html';
} 

	if((detectOS() == 'Macintosh') && (detectBrowser() == 'IE')){
		var maciewindow = window.open('main.html', 'popupwindow','resizable=yes');
		maciewindow.moveTo(0,0);
		maciewindow.resizeTo(screen.width - 10,screen.height - 45);
	}else{ 
		var winWidth = screen.width - adjWidth;
		var winHeight = screen.height - adjHeight;
		var winSize = 'width=' + winWidth + ',height=' + winHeight+ ',resizable=yes';
		var thewindow = window.open('main.html', 'popupwindow', winSize);
		thewindow.moveTo(0,0);
	}
} 

function FitPic() { 
	iWidth = (NS)?window.innerWidth:document.body.clientWidth; 
	iHeight = (NS)?window.innerHeight:document.body.clientHeight; 
	iWidth = document.imgDoc.width - iWidth+80; 
	iHeight = document.imgDoc.height - iHeight+80; 
	window.resizeBy(iWidth, iHeight); 
	self.focus();
}

function winCenter() {
	if (document.layers) {
		var sinist = screen.width / 2 - outerWidth / 2;
		var toppo = screen.height / 2 - outerHeight / 2;
	} else {
		var sinist = screen.width / 2 - document.body.offsetWidth / 2;
		var toppo = screen.height / 2 - document.body.offsetHeight / 2;
	}
	self.moveTo(sinist, toppo);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
