function popWindow(url,w,h)
{
	var poppedWindow = window.open(url,'pWin','width=' + w + ',height=' + h + ',scrollbars,resizable,status');
	poppedWindow.moveTo(screen.width/2-w/2, screen.height/2-h/2);
	poppedWindow.focus();
}

function showObj(obj)
{
	obj.style.visibility = 'visible';
}

function hideObj(obj)
{
	obj.style.visibility = 'hidden';
}

function centreObj(obj)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	var scW, scH, obW, obH;
	if (ie4) {
		scW = parseInt(document.body.clientWidth);
		scH = parseInt(document.body.clientHeight); }
	else {
		scW = parseInt(screenSize.width);
		scH = parseInt(screenSize.height); }
		
	obW = parseInt(obj.style.width);
	obH = parseInt(obj.style.height);
	
	obj.style.left = (scW/2)-(obW/2) + 'px';
	obj.style.top = (scH/2)-(obH/2) + 'px';
}

function centreOffsetObj(obj, offX, offY)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	var scW, scH, obW, obH;
	if (ie4) {
		scW = parseInt(document.body.clientWidth);
		scH = parseInt(document.body.clientHeight); }
	else {
		scW = parseInt(screenSize.width);
		scH = parseInt(screenSize.height); }
		
	obW = parseInt(obj.style.width);
	obH = parseInt(obj.style.height);
	
	obj.style.left = (scW/2)-(obW/2)+parseInt(offX) + 'px';
	obj.style.top = (scH/2)-(obH/2)+parseInt(offY) + 'px';
}

function centreVertOffsetObj(obj, offX, posY)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	var scW, scH, obW, obH;
	if (ie4) {
		scW = parseInt(document.body.clientWidth);
		scH = parseInt(document.body.clientHeight); }
	else {
		scW = parseInt(screenSize.width);
		scH = parseInt(screenSize.height); }
		
	obW = parseInt(obj.style.width);
	obH = parseInt(obj.style.height);
	
	obj.style.left = (scW/2)+parseInt(offX) + 'px';
	obj.style.top = parseInt(posY) + 'px';
}

function mnuObj(obj, offX, offY)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	var scW, scH, obW, obH;
	if (ie4) {
		scW = parseInt(document.body.clientWidth);
		scH = parseInt(document.body.clientHeight); }
	else {
		scW = parseInt(screenSize.width);
		scH = parseInt(screenSize.height); }
		
	obW = parseInt(obj.style.width);
	obH = parseInt(obj.style.height);
	
	obj.style.left = (scW/2)-(obW/2)+parseInt(offX) + 'px';
	obj.style.top = parseInt(offY) + 'px';
}

function placeMenu(obj, posX, posY)
{
	ns4 = (document.layers)? true:false
	ie4 = (document.all)? true:false

	var scW, scH, obW, obH;
	if (ie4) {
		scW = parseInt(document.body.clientWidth);
		scH = parseInt(document.body.clientHeight); }
	else {
		scW = parseInt(screenSize.width);
		scH = parseInt(screenSize.height); }
		
	obW = parseInt(obj.style.width);
	obH = parseInt(obj.style.height);
	
	obj.style.left = parseInt(posX) + 'px';
	obj.style.top = parseInt(posY) + 'px';
}

var prevClass;

function hiLiteCell(obj, newClass)
{
	prevClass = obj.className;
	obj.className = newClass;
}

function normaliseCell(obj)
{
	obj.className = prevClass;
}

function newImage(arg) 
{
	if (document.images) 
	{
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() 
{
	if (document.images && (preloadFlag == true)) 
	{
		for (var i=0; i<changeImages.arguments.length; i+=2) 
		{
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

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 showTag(obj, e, hOff, vOff)
{
	if (obj.style.visibility == 'visible')
		hideObj(obj);
	else
	{
	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';
	}
	}
}