function isSupported()
{
	var returnValue=false;
	if (750<self.screen.height)
	{
		if ((getScreenWidth()/getScreenHeight())>1.7)
		{
			if(parent.document.all)
			{
				parent.document.all.MainFrames.rows = "35%,*, 70";
			}
			else
			{
				parent.document.getElementById("MainFrames").rows = "35%,*, 70";
			}
		}
		returnValue=true;
	}
	return returnValue;
}
function getScreenWidth()
{
	var x;
	if (top.document.documentElement && top.document.documentElement.clientWidth)
	// Explorer 6 Strict Mode
	{
		x = top.document.documentElement.clientWidth;
	}
	else 
		if (top.document.body) // other Explorers
		{
			x = top.document.body.clientWidth;
		}
	return x;
}
function getScreenHeight()
{
	var y;
	if (top.document.documentElement && top.document.documentElement.clientHeight)
	{
		y = top.document.documentElement.clientHeight;
	}
	else 
		if (top.document.body) 
		{
			y = top.document.body.clientHeight;
		}
	return y;
}
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	dataBrowser: [
		{ 	string: navigator.userAgent,
			subString: "OmniWeb",
			versionSearch: "OmniWeb/",
			identity: "OmniWeb"
		},
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{
			string: navigator.vendor,
			subString: "Camino",
			identity: "Camino"
		},
		{
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	]
};
function Relocate(page)
{
	BrowserDetect.init();
	if (
		("Explorer"==BrowserDetect.browser) ||
		("Mozilla"==BrowserDetect.browser) ||
		("Safari"==BrowserDetect.browser) ||
		("Camino"==BrowserDetect.browser) ||
		("Opera"==BrowserDetect.browser) ||
		("Konqueror"==BrowserDetect.browser) ||
		("Firefox"==BrowserDetect.browser) ||
		("Netscape"==BrowserDetect.browser) 
	)
	{
		if (0!=page.length) page = "?"+page;
		// Replace next line with commented out line that follows before distributing!
		// location.href = "index.htm"+page;
		location.href = "http://www.trosolwg.co.uk/"+page;
	}
}
function framesLoaded(page)
{
	if (!page)
	{
		page = "";
	}
	if (parent.document.all)
	{
		if (!top.MainFrames) Relocate(page);
	}
	else
	{
		if (!parent.document.getElementById("MainFrames")) Relocate(page);
	}
	if (0!=page.length)
	{
		var ctsTable = top.contents.document.getElementsByTagName("ul");
		for (var uli=0;uli<ctsTable.length;uli++) 
		{
			var ul=ctsTable[uli];
			if (ul.nodeName=="UL" && ul.className=="mktree") 
			{
				openListElement(ul, page);
			}
		}
	}
}
function loadQuery()
{
	var query = (location.href.indexOf("?")+1);
	if (query)
	{
		top.main.location.href = location.href.substring(query);
	}
}
function openPopUp(doc)
{
	var targetDocument = "formbody.htm?" +doc;
	var theScreenHeight = Math.min(getScreenHeight(),800);
	var theScreenParams = "status=1,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1, width=500, height=";
	theScreenParams +=theScreenHeight;
	mailWindow = window.open(targetDocument,null, theScreenParams);
}
function openDownloadPopUp(doc)
{
	var targetDocument = "download_form.htm?" +doc;
	var theScreenHeight = Math.min(getScreenHeight(),700);
	var theScreenParams = "status=1,toolbar=0,menubar=0,location=0,resizable=1,scrollbars=1, width=500, height=";
	theScreenParams +=theScreenHeight;
	mailWindow = window.open(targetDocument,null, theScreenParams);
}

function openListElement(ul, page)
{
	if (!ul.childNodes || ul.childNodes.length==0) { return false; }
	var returnValue = false;
	for (var itemi=0;itemi<ul.childNodes.length;itemi++) 
	{
		var item = ul.childNodes[itemi];
		if (item.nodeName == "LI") 
		{
			if(item.className=="liOpen") item.className="liClosed";
			for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) 
			{
				var sitem = item.childNodes[sitemi];
				if (sitem.nodeName=="UL") 
				{
					if (openListElement(sitem, page))
					{
						if(item.className!="liBullet") item.className="liOpen";
						returnValue = true;
					}
				}
				if (sitem.nodeName=="A")
				{
					var filepath = new RegExp("/"+page, "i");
					var file = sitem.href.match(filepath);
					if (file)
					{
						if(item.className!="liBullet") item.className="liOpen";
						sitem.style.color = "#191970";
						returnValue = true;
					}
					else
					{
						if ((sitem.style.color == "#191970")||
							(sitem.style.color == "rgb(25, 25, 112)")) sitem.style.color = "gray";
					}
				}
			}
		}
	}
	return returnValue;
}
function swapImage() 
{ 
	var i,j=0,x,a=swapImage.arguments; 
	document.sr=new Array; 
	for(i=0;i<(a.length-2);i+=3)
	{
		if ((x=findObj(a[i]))!=null)
		{
			document.sr[j++]=x; 
			if(!x.oSrc) x.oSrc=x.src; 
			x.src=a[i+2];
		}
	}
}
function findObj(n, d) 
{ 
	var p,i,x;  
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0 && parent.frames.length) 
	{
		d=parent.frames[n.substring(p+1)].document; 
		n=n.substring(0,p);
	}
	if(!(x=d[n])&& d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
	{
		x=d.forms[i][n];
	}
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
	{
		x=findObj(n,d.layers[i].document);
	}
	if(!x && d.getElementById) x=d.getElementById(n); 
	return x;
}
function swapImgRestore() 
{ 
	var i,x,a=document.sr; 
	for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++)
	{
		x.src=x.oSrc;
	}
}