/**
* Statcounter parameters
*/
var sc_project=1670804;
var sc_invisible=1;
var sc_partition=11;
var sc_security="a593bec0";
var sc_remove_link=1;
var MAP = null;
var MSVEMAP = null;
var MAP_START_ZOOM = 15;

var xmlhttp;
var pinID = 1;
var LAT;
var LONG;
var imageMap;

var EXTN = 'png';

if(document.all && navigator.userAgent.indexOf('MSIE 7')==-1)
{
	EXTN = 'gif';
}

/**
* google params
*/
_uacct = "UA-515912-10";
urchinTracker();

function onLoad()
{
	try{
		makeCollapsableMenus();
	}catch(e){
		//alert(e);
	}
	try{
		initCalmTree();
	}catch(e){

	}
	try{
		imageMap = new imageMap('imageMap');
	}catch(e){
	}
	try{
		makeTreeview = new treeviewFromList('makeTreeview');
	}catch(e){

	}
	try{
		if (GBrowserIsCompatible()) {
			//Now using MS Virtual Earth
			//getGoogleMap();
		}

	}catch(e){
		//alert(e);
	}

	try{getVEMap();}catch(e){}


	try{
		/*new createOutline('xml_Form');*/
	}catch(e){}
	return;
}
function makeCollapsableMenus()
{
	if(div = document.getElementById('left'))
	{
		var uls = div.getElementsByTagName('UL');
		if(uls.length>0)
		{
			for(var i=0;i<uls.length;i++)
			{
				lis = uls[i].getElementsByTagName('LI');
				for(var j=0;j<lis.length;j++)
				{
					liULs = lis[j].getElementsByTagName('UL');
					if(liULs.length>0)
					{
						var a = lis[j].getElementsByTagName('A')[0];
						a.UL = liULs[0];
						a.href='javascript:void(0);';
						liULs[0].START_DISPLAY = liULs[0].style.display;
						liULs[0].style.display = 'block';
						a.onclick = function(){
							if(this.UL.style.display!='none')
							{
								this.UL.style.display = 'none';
							}
							else
							{
								this.UL.style.display = this.UL.START_DISPLAY;
							}
						}
					}
				}
			}
		}
	}

}
function ajaxVEGetRelatedPoints()
{
	//Use ajax to get the nearestTos
	xmlhttp = false;
	var url = '/xml/nearestTos/?latitude='+LAT+'&longitude='+LONG;
	//alert(url);
	try{
		if (window.XMLHttpRequest)
		{
			xmlhttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
	}catch(e){
		//alert('Could not load XML');
	}

	try{
		if (xmlhttp!=null)
		{
			xmlhttp.onreadystatechange=state_Change_msve;
			xmlhttp.open("GET",url,true)
			xmlhttp.send(null)
		}
		else
		{
			//alert("Your browser does not support XMLHTTP.")
		}
	}catch(e){
		//alert(e);
	}
}
function getVEMap()
{
	try{
		MSVEMAP = new VEMap('veMap');
		LAT = document.getElementById("Lat").firstChild.nodeValue;
		LONG = document.getElementById("Lng").firstChild.nodeValue;
		var oLatLong = new VELatLong(LAT,LONG);
		MSVEMAP.LoadMap();
	}catch(e){
		//alert('ERR 102: '+e);
	}
	try{
		MSVEMAP.SetCenterAndZoom(oLatLong,MAP_START_ZOOM);
		MSVEMAP.SetMapStyle(VEMapStyle.Hybrid);
		
		try{

			//var points = getPoints(52.552688887843,-2.7725761880595,0.001);

			var prc = document.getElementById('Prn').firstChild.nodeValue/1609;
			
			var poly = VECircle('Circle',LAT,LONG,prc,new VEColor(255,0,0,0.3),2);
			MSVEMAP.AddPolygon(poly);
			//MSVEMAP.SetMapView(points);
		}catch(e){
			//alert('154	: '+e);
		}

		//Load the default pin
		var title = document.getElementById("dc:title").innerHTML;
		var description = document.getElementById("dc:description").innerHTML;
		var thumbnail = '';
		if(document.getElementById('thumbnail'))
		{
			var thumbnail = document.getElementById('thumbnail').cloneNode(true);
			thumbnail.style.display = '';
			thumbnail = thumbnail.innerHTML;
		}
		var pin = new VEPushpin(pinID,oLatLong,'/html/assets/images/googleMaps/marker.'+EXTN,'<div><h3>'+title+'</h3>','<p align="left">'+thumbnail+description+'</p></div>');
		MSVEMAP.AddPushpin(pin);
		pinID++;


		ajaxVEGetRelatedPoints();

	}catch(e){
		//alert(e);
	}
}

function VECircle(polyname,latin, lonin, radius,vecolor, linewidth)
{
	var locs = new Array();
	var lat1 = latin * Math.PI/180.0;
	var lon1 = lonin * Math.PI/180.0;
	var d = radius/3956;
	var x;
	for (x = 0; x <= 360; x++)
	{
		var tc = (x / 90)* Math.PI / 2;
		var lat = Math.asin(Math.sin(lat1)*Math.cos(d)+Math.cos(lat1)*Math.sin(d)*Math.cos(tc));
		lat = 180.0 * lat / Math.PI;
		var lon;
		if (Math.cos(lat1)==0)
		{
			lon=lonin; // endpoint a pole
		}
		else
		{
			lon = ((lon1 - Math.asin(Math.sin(tc) * Math.sin(d)/Math.cos(lat1)) + Math.PI) % (2 * Math.PI)) - Math.PI;
		}
		lon = 180.0 * lon / Math.PI;
		var loc = new VELatLong(lat,lon);
		locs.push(loc);
	}
	var poly = new VEPolygon(polyname, locs, vecolor ,vecolor , linewidth);
	return poly;
}


function getPoints(originX,originY,radius)
{
	var xRadius = radius;
	var yRadius = radius*1.6;
	/*
	var points = new Array();
	points.push(new VELatLong(originX,originY+yRadius));
	for(var i=0;i<=360;i++)
	{
	//points.push(new VELatLong(originX-xRadius*Math.sin(i),originY-yRadius*Math.cos(i)));
	points.push(new VELatLong(originX+(xRadius*Math.sin(i)),originY+(yRadius*Math.cos(i))));
	}
	points.push(new VELatLong(originX,originY+yRadius));
	*/
	var points = new Array(
	new VELatLong(originX-xRadius,originY-yRadius),
	new VELatLong(originX+xRadius,originY-yRadius),
	new VELatLong(originX+xRadius,originY+yRadius),
	new VELatLong(originX-xRadius,originY+yRadius),
	new VELatLong(originX-xRadius,originY-yRadius)
	);

	return points;
}
function getGoogleMap()
{
	try{
		MAP = new GMap2(document.getElementById("googleMap"));
		MAP.addMapType(G_SATELLITE_MAP);
		MAP.addControl(new GSmallMapControl());
		MAP.addControl(new GMapTypeControl());
		MAP.addControl(new GOverviewMapControl());

		var icon = null;
		var title = document.getElementById("dc:title");
		var description = document.getElementById("dc:description");
		var Lat = document.getElementById("Lat");
		var Lng = document.getElementById("Lng");
		var point = new GLatLng(Lat.firstChild.nodeValue,Lng.firstChild.nodeValue);
		MAP.setCenter(point, MAP_START_ZOOM);
		var marker = new GMarker(point);
		MAP.addOverlay(marker);
		/**
		* Create a display DIV to put in the InfoWindow
		*/
		var displayNode = document.createElement('DIV');
		var thumb = '';
		displayNode.style.width = '250px';
		if(document.getElementById('thumbnail'))
		{
			var thumbnail = document.getElementById('thumbnail').cloneNode(true);
			thumbnail.style.display = '';
			displayNode.appendChild(thumbnail);
		}
		var header = document.createElement('h3');
		header.innerHTML = title.innerHTML;
		displayNode.appendChild(header);

		var descriptionNode = document.createElement('span');
		descriptionNode.innerHTML = description.innerHTML;
		MAP.openInfoWindow(MAP.getCenter(),displayNode);


		//alert(title.innerHTML);
		//alert(description.innerHTML);
		try{
			var marker = createMarker(point,false,title.innerHTML,description.innerHTML,icon,thumbnail);
			MAP.addOverlay(marker);
		}catch(e){
			//alert(e);
		}

		//Use ajax to get the nearestTos
		xmlhttp = false;
		var url = '/xml/nearestTos/?latitude='+Lat.innerHTML+'&longitude='+Lng.innerHTML;
		//alert(url);
		try{
			if (window.XMLHttpRequest)
			{
				xmlhttp=new XMLHttpRequest()
			}
			else if (window.ActiveXObject)
			{
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
			}
		}catch(e){
			//alert('Could not load XML');
		}

		try{
			if (xmlhttp!=null)
			{
				setGoogleLoadingMessage('Loading SMR related records...');
				xmlhttp.onreadystatechange=state_Change;
				xmlhttp.open("GET",url,true)
				xmlhttp.send(null)
			}
			else
			{
				setGoogleLoadingMessage("Your browser does not support XMLHTTP.");
				//alert("Your browser does not support XMLHTTP.")
			}

			document.getElementById("googleMapLoading").style.display = 'none';
			document.getElementById("googleMapLoading").style.visibility = 'hidden';
			document.getElementById("googleMap").style.visibility = 'visible';
		}catch(e){
			//alert(e);
		}
	}catch(e){
		//alert(e);
	}
}
function setGoogleLoadingMessage(msg)
{
	try{
		window.status = msg;
		document.getElementById("googleMapLoading").innerHTML = msg;
		document.getElementById("googleMapLoading").style.visibility = 'hidden';
		document.getElementById("googleMapLoading").style.visibility = 'visible';
		//document.getElementById("googleMapLoading").style.display = 'none';
		//document.getElementById("googleMapLoading").style.display = 'block';
	}catch(e){
		//alert(e);
	}
}
function state_Change_msve()
{
	try{
		if (xmlhttp.readyState!=4){return;}
		//alert(xmlhttp.responseText);

		if(xmlhttp.responseXML)
		{

			//Create mini Icons

			//Plot points
			var records = xmlhttp.responseXML.firstChild.childNodes;
			for(var i = 0;i<records.length;i++)
			{
				var icon = '';
				var type = records[i].getAttribute('type');
				switch(type)
				{
					case 'H':
					icon = "/html/assets/images/googleMaps/mm_20_blue."+EXTN;
					break;
					case 'E':
					icon = "/html/assets/images/googleMaps/mm_20_green."+EXTN;
					break;
					case 'M':default:
					icon = "/html/assets/images/googleMaps/mm_20_red."+EXTN;
					break;
				}

				var lat = records[i].getAttribute('latitude');
				var lng = records[i].getAttribute('longitude');
				var identifier = records[i].getAttribute('identifier');
				var title = records[i].getElementsByTagName('title')[0].firstChild.nodeValue;
				try{var description = records[i].getElementsByTagName('description')[0].firstChild.nodeValue;}catch(e){var description = '';}
				var oLatLong = new VELatLong(lat,lng);
				var thumbnail = '';
				try
				{
					//alert(records[i].getAttribute('image'));
					var src = records[i].getAttribute('image');
					if(src!=null)
					{
						var thumbnail = document.createElement('IMG');
						thumbnail.src = '/html/resource/preview/'+src;
						thumbnail.setAttribute('align','left');
						thumbnail.style.marginRight = '3px';
						var p = document.createElement('P');
						p.appendChild(thumbnail);
						thumbnail = p.innerHTML;
					}
				}catch(e){
					//alert('No image');
				}
				var pin = new VEPushpin(pinID,oLatLong,icon,'<h3>'+title+'</h3>',thumbnail+'<p align="left">'+description+'<br/><a href="/html/search/verb/GetRecord/'+identifier+'">More...</a></p>');
				MSVEMAP.AddPushpin(pin);
				pinID++;



			}
			addKey('veMap');
		}
	}catch(e){
		//alert(e);
	}
}
function state_Change()
{
	try{
		if (xmlhttp.readyState!=4){return;}
		//alert(xmlhttp.responseText);

		setGoogleLoadingMessage('SMR related records loaded. Plotting points');
		if(xmlhttp.responseXML)
		{

			//Create mini Icons
			var icon = new GIcon();
			icon.image = "/html/assets/images/googleMaps/mm_20_red.png";
			icon.shadow = "/html/assets/images/googleMaps/mm_20_shadow.png";
			icon.iconSize = new GSize(12, 20);
			icon.shadowSize = new GSize(22, 20);
			icon.iconAnchor = new GPoint(6, 20);
			icon.infoWindowAnchor = new GPoint(5, 1);

			var records = xmlhttp.responseXML.firstChild.childNodes;
			setGoogleLoadingMessage('Plotting points...');
			//alert(records.length);
			for(var i = 0;i<records.length;i++)
			{
				//window.status = 'Plotting point '+i;
				setGoogleLoadingMessage('Loading record '+(i+1)+' of '+records.length);
				var type = records[i].getAttribute('type');
				switch(type)
				{
					case 'H':
					icon.image = "/html/assets/images/googleMaps/mm_20_blue.png";
					break;
					case 'E':
					icon.image = "/html/assets/images/googleMaps/mm_20_green.png";
					break;
					case 'M':default:
					icon.image = "/html/assets/images/googleMaps/mm_20_red.png";
					break;
				}

				var lat = records[i].getAttribute('latitude');
				var lng = records[i].getAttribute('longitude');
				var identifier = records[i].getAttribute('identifier');
				var title = records[i].getElementsByTagName('title')[0].firstChild.nodeValue;
				try{var description = records[i].getElementsByTagName('description')[0].firstChild.nodeValue;}catch(e){var description = '';}
				var point = new GLatLng(lat,lng);
				var thumb = false;
				try
				{
					//alert(records[i].getAttribute('image'));
					var src = records[i].getAttribute('image');
					if(src!=null)
					{
						var thumb = document.createElement('IMG');
						thumb.src = '/html/resource/preview/'+src;
						thumb.align = 'left';
						thumb.style.marginRight = '3px';
					}
				}catch(e){
					//alert('No image');
				}
				var marker = createMarker(point,identifier,title,description,icon,thumb);

				MAP.addOverlay(marker);



			}
			setGoogleLoadingMessage('Adding key...');
			addKey();
		}
	}catch(e){
		//alert(e);
	}

	setGoogleLoadingMessage('Finished');

	ajaxVEGetRelatedPoints();
}
function addKey(id)
{
	try{
		if(id==null){id='googleMap';}
		var googleMap = document.getElementById(id);

		var div = document.createElement('DIV');
		var html = '<h2>Key to other nearby SMR Records</h2><blockquote style="margin-left:20px;">';
		html+='<img src="/html/assets/images/googleMaps/key_blue.jpg" style="margin-right:5px;" width="27" height="22" alt="Blue Marker"/>Historical Landscape Characterisation<br/>';
		html+='<img src="/html/assets/images/googleMaps/key_green.jpg" style="margin-right:5px;" width="27" height="22" alt="Green Marker"/>Events<br/>';
		html+='<img src="/html/assets/images/googleMaps/key_red.jpg" style="margin-right:5px;" width="27" height="22" alt="Red Marker"/>Monuments';
		html+='</blockquote>';
		div.innerHTML = html;

		googleMap.parentNode.insertBefore(div,googleMap.nextSibling);
	}catch(e){
		//alert(e);
	}
}
function createMarker(point, identifier, title, description,icon,thumbnail) {
	//alert(thumbnail);
	try{
		var marker = new GMarker(point,icon);
		GEvent.addListener(marker, "click", function() {

			var div = document.createElement('DIV');
			div.style.width = '250px';
			if(thumbnail)
			{
				div.appendChild(thumbnail);
			}
			div.innerHTML+='<h3>'+title+'</h3>';
			div.innerHTML+='<span>'+description+'</span>';
			if(identifier)
			{
				div.innerHTML+='<br/><a href="/html/search/verb/GetRecord/'+identifier+'">More...</a>';
			}
			div.innerHTML+='</div>';
			marker.openInfoWindowHtml(div);
			MAP.setCenter(point);
		});
		return marker;
	}catch(e){
		//alert(e);
	}
}



/** BROWSER SNIFFER - primarily to switch between PNGs and GIFs for IE6 */


function Is ()
{   // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is.ie5up to detect IE5.

    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    this.nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    this.nav2 = (this.nav && (this.major == 2));
    this.nav3 = (this.nav && (this.major == 3));
    this.nav4 = (this.nav && (this.major == 4));
    this.nav4up = (this.nav && (this.major >= 4));
    this.navonly      = (this.nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    this.nav6 = (this.nav && (this.major == 5));
    this.nav6up = (this.nav && (this.major >= 5));
    this.gecko = (agt.indexOf('gecko') != -1);


    this.ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    this.ie3    = (this.ie && (this.major < 4));
    this.ie4    = (this.ie && (this.major == 4) && (agt.indexOf("msie 4")!=-1) );
    this.ie4up  = (this.ie  && (this.major >= 4));
    this.ie5    = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    this.ie5_5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
    this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);
    this.ie5_5up =(this.ie && !this.ie3 && !this.ie4 && !this.ie5);
    this.ie6    = (this.ie && (this.major == 4) && (agt.indexOf("msie 6.")!=-1) );
    this.ie6up  = (this.ie  && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);

    // KNOWN BUG: On AOL4, returns false if IE3 is embedded browser
    // or if this is the first browser window opened.  Thus the
    // variables is.aol, is.aol3, and is.aol4 aren't 100% reliable.
    this.aol   = (agt.indexOf("aol") != -1);
    this.aol3  = (this.aol && this.ie3);
    this.aol4  = (this.aol && this.ie4);
    this.aol5  = (agt.indexOf("aol 5") != -1);
    this.aol6  = (agt.indexOf("aol 6") != -1);

    this.opera = (agt.indexOf("opera") != -1);
    this.opera2 = (agt.indexOf("opera 2") != -1 || agt.indexOf("opera/2") != -1);
    this.opera3 = (agt.indexOf("opera 3") != -1 || agt.indexOf("opera/3") != -1);
    this.opera4 = (agt.indexOf("opera 4") != -1 || agt.indexOf("opera/4") != -1);
    this.opera5 = (agt.indexOf("opera 5") != -1 || agt.indexOf("opera/5") != -1);
    this.opera5up = (this.opera && !this.opera2 && !this.opera3 && !this.opera4);

    this.webtv = (agt.indexOf("webtv") != -1); 

    this.TVNavigator = ((agt.indexOf("navio") != -1) || (agt.indexOf("navio_aoltv") != -1)); 
    this.AOLTV = this.TVNavigator;

    this.hotjava = (agt.indexOf("hotjava") != -1);
    this.hotjava3 = (this.hotjava && (this.major == 3));
    this.hotjava3up = (this.hotjava && (this.major >= 3));

    // *** JAVASCRIPT VERSION CHECK ***
    if (this.nav2 || this.ie3) this.js = 1.0;
    else if (this.nav3) this.js = 1.1;
    else if (this.opera5up) this.js = 1.3;
    else if (this.opera) this.js = 1.1;
    else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2;
    else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3;
    else if (this.hotjava3up) this.js = 1.4;
    else if (this.nav6 || this.gecko) this.js = 1.5;
    // NOTE: In the future, update this code when newer versions of JS
    // are released. For now, we try to provide some upward compatibility
    // so that future versions of Nav and IE will show they are at
    // *least* JS 1.x capable. Always check for JS version compatibility
    // with > or >=.
    else if (this.nav6up) this.js = 1.5;
    // note ie5up on mac is 1.4
    else if (this.ie5up) this.js = 1.3

    // HACK: no idea for other browsers; always check for JS version with > or >=
    else this.js = 0.0;

    // *** PLATFORM ***
    this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    // NOTE: On Opera 3.0, the userAgent string includes "Windows 95/NT4" on all
    //        Win32, so you can't distinguish between Win95 and WinNT.
    this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));

    // is this a 16 bit compiled version?
    this.win16 = ((agt.indexOf("win16")!=-1) || 
               (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) || 
               (agt.indexOf("windows 16-bit")!=-1) );  

    this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
                    (agt.indexOf("windows 16-bit")!=-1));

    // NOTE: Reliable detection of Win98 may not be possible. It appears that:
    //       - On Nav 4.x and before you'll get plain "Windows" in userAgent.
    //       - On Mercury client, the 32-bit version will return "Win98", but
    //         the 16-bit version running on Win98 will still return "Win95".
    this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
    this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
    this.win32 = (this.win95 || this.winnt || this.win98 || 
                    ((this.major >= 4) && (navigator.platform == "Win32")) ||
                    (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));

    this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
    this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));

    this.os2   = ((agt.indexOf("os/2")!=-1) || 
                    (navigator.appVersion.indexOf("OS/2")!=-1) ||   
                    (agt.indexOf("ibm-webexplorer")!=-1));

    this.mac    = (agt.indexOf("mac")!=-1);
    // hack ie5 js version for mac
    if (this.mac && this.ie5up) this.js = 1.4;
    this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) || 
                               (agt.indexOf("68000")!=-1)));
    this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) || 
                                (agt.indexOf("powerpc")!=-1)));

    this.sun   = (agt.indexOf("sunos")!=-1);
    this.sun4  = (agt.indexOf("sunos 4")!=-1);
    this.sun5  = (agt.indexOf("sunos 5")!=-1);
    this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
    this.irix  = (agt.indexOf("irix") !=-1);    // SGI
    this.irix5 = (agt.indexOf("irix 5") !=-1);
    this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
    this.hpux  = (agt.indexOf("hp-ux")!=-1);
    this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
    this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
    this.aix   = (agt.indexOf("aix") !=-1);      // IBM
    this.aix1  = (agt.indexOf("aix 1") !=-1);    
    this.aix2  = (agt.indexOf("aix 2") !=-1);    
    this.aix3  = (agt.indexOf("aix 3") !=-1);    
    this.aix4  = (agt.indexOf("aix 4") !=-1);    
    this.linux = (agt.indexOf("inux")!=-1);
    this.sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
    this.unixware = (agt.indexOf("unix_system_v")!=-1); 
    this.mpras    = (agt.indexOf("ncr")!=-1); 
    this.reliant  = (agt.indexOf("reliantunix")!=-1);
    this.dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
                  (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
                  (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
    this.sinix = (agt.indexOf("sinix")!=-1);
    this.freebsd = (agt.indexOf("freebsd")!=-1);
    this.bsd = (agt.indexOf("bsd")!=-1);
    this.unix  = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux || 
                 this.sco ||this.unixware || this.mpras || this.reliant || 
                 this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);

    this.vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
}

