// main.js
// POPUP WINDOW (BORROWED FROM CNN)

var browser = "";
var browsername = navigator.appName;
var browserversion = parseInt(navigator.appVersion);
if (browsername == "Netscape") 
{
	browser = "ns" + browserversion;
}
else
{
	if (browsername == "Microsoft Internet Explorer") 
	{
		if (browserversion >= 4) 
		{
			browser = "ie" + browserversion;
		}
		else 
		{
			browser = "ie3";
		}
	}
}
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);


// Used for pop-up windows
function openWindow (url,name,widgets) 
{
popupWin = window.open (url,name,widgets);

var agt=navigator.userAgent.toLowerCase();
var is_major    = parseInt(navigator.appVersion);
var is_ie       = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie3      = (is_ie && (is_major < 4));
var is_ie4      = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_aol      = (agt.indexOf("aol") != -1);
var is_aol3     = (is_aol && is_ie3);
var is_aol4     = (is_aol && is_ie4);
var is_aol5     = (agt.indexOf("aol 5") != -1);
var is_aol6     = (agt.indexOf("aol 6") != -1);
var is_comp     = (agt.indexOf("compuserve") != -1);
var is_comp2000 = (agt.indexOf("cs") != -1);	 
var is_compie   = (is_comp && is_ie);

if(!is_aol6 && !is_aol3 && !is_aol4 && !is_aol5 && !is_compie && !is_comp2000) 
	{
	popupWin.opener.top.name = "opener"; popupWin.focus();
	}
}


// WEBCAM RELOAD

var x = 30;
var y = 1;
var now;

function startClock() {
	x = x-y;
	document.form1.clock.value = x;
	if (x <= 1) reload();
	timerID = setTimeout("startClock()", 1000);
	}

function reload() {
	now = new Date();
	var camImg = "images/SpyCam.jpg" + "?" + now.getTime();
	document.campicture.src = camImg;
	x = 30;
	document.form1.clock.value = x;
	}

