var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
	if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "an unknown operating system";
}

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}

function showData(obj, e, hOff, vOff)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false
	
	var msX, msY;
	
	if (ie4)
	{
		msX = e.clientX + document.body.scrollLeft;
		msY = e.clientY + document.body.scrollTop;
	}
	else
	{
		msX = e.pageX;
		msY = e.pageY;
	}
	if (msX < 0) {msX = 0;}
	if (msY < 0) {msY = 0;}
	
	obj.style.left = parseInt(msX + hOff) + 'px';
	obj.style.top = parseInt(msY + vOff) + 'px';
	if (OS != "Mac")
	{
		obj.style.visibility = 'visible';
	}
}

function hidePopup(obj)
{
	obj.style.left = '-1000px';
	obj.style.top = '-1000px';
	hideObj(obj);
}

function hideObj(obj)
{
	obj.style.visibility = 'hidden';
}

function embedFlash(inMovie, inWidth, inHeight)
{
	document.write('<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="' + inWidth + '" height="' + inHeight + '"><param name="movie" value="' + inMovie + '"><param name="quality" value="High"><embed src="' + inMovie + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="' + inWidth + '" height="' + inHeight + '" quality="High"></object>');
}

function validateContact(f)
{
	if (f.Name.value == '')
	{
		window.alert('Please enter your name to continue.');
		f.Name.focus();
		return false;
	}
	
	if (f.Email.value == '')
	{
		window.alert('Please enter your email address to continue.');
		f.Email.focus();
		return false;
	}
	
		if (f.Phone.value == '')
	{
		window.alert('Please enter your phone number to continue.');
		f.Phone.focus();
		return false;
	}
	return true;
}

function showSectors(inID)
{
	w = 480;
	h = 400;
	
	var p = window.open('showSectors.asp?ind_id=' + inID,'p','width=' + w + ',height=' + h + ',scrollbars,resizable');
	p.moveTo(screen.width/2-w/2, screen.height/2-h/2);
	p.focus();
}

function popWindow(url, w, h)
{
	var newWin = window.open(url, 'pWin', 'width=' + w + ',height=' + h + ',scrollbars,resizable');
	newWin.moveTo(screen.width / 2 - w / 2, screen.height / 2 - h / 2);
}