var tim;

var ie = (navigator.appName == "Microsoft Internet Explorer");
var bv;
if (ie)
{ var i = navigator.appVersion.indexOf('MSIE') + 5;
	bv = parseInt(navigator.appVersion.substr(i,1));
}
else
{ bv = parseInt(navigator.appVersion);
}
var sv = (location.href.indexOf('localhost') > 0) ? 'http://localhost/symposia/symposia/' : 'http://www.symposia.org.uk/';
var fldr = 'main/';

pg = [];
pg[0] = ['about.html','0','',''];
pg[1] = ['events.asp','0','',''];
pg[2] = ['progform.asp','0','',''];
pg[3] = ['appform.asp','0','',''];
pg[4] = ['payment.html','0','',''];
pg[5] = ['where','0','10','15'];
pg[6] = ['accom.asp','0','',''];
pg[7] = ['links.html','0','',''];
pg[8] = ['contact.html','0','',''];
pg[9] = ['pbform.asp','0','',''];
pg[10] = ['venue-hcc.html','1','',''];
pg[11] = ['venue-icsk.html','1','',''];
pg[12] = ['venue-nhli.html','1','',''];
pg[13] = ['venue-rgc.html','1','',''];
pg[14] = ['venue-rcp.html','1','',''];
pg[15] = ['venue-tl.html','1','',''];
pg[16] = [null,'1','',''];

var ncl;

function emlk(n, d, s)
{
	var a = n+'@'+d;
	var t = s==null?a:s;
	document.write('<a href="mailto:'+a+'">'+t+'</a>');
}

function setNav()
{
	var i;
	var id;
	var x = 0;
	for (i=0; i<pg.length; i++)
	{ id = 'nav'+i;
		if (pg[i][1]==0)
		{ if (thisPage(location.href, pg[i][0]))
			{ document.getElementById(id).className = 'nava';
			}
			else
			{	document.getElementById(id).className = 'navn'
			}
			document.getElementById(id).style.left = x+'px';
			x += 88;
		}
	}
}

function thisPage(locn, menu)
{
	var i = locn.indexOf('main/') + 5;
	var prog = locn.substr(i);
	return (prog.indexOf(menu.substr(0, 3)) == 0);
}

function plusNav(el)
{
	var i;
	var j = el.id.substr(3);
	var id;
	var x;
	var y = 64;
	for (i=pg[j][2]; i<=pg[j][3]; i++)
	{ id = 'nav'+i;
		if (document.getElementById(id).className == 'navh')
		{ document.getElementById(id).className = 'navd';
			x = parseInt(document.getElementById(el.id).style.left) + 10;
			document.getElementById(id).style.left = x+'px';
			document.getElementById(id).style.top = y+'px';
			y += 16;
		}
		else
		{ document.getElementById(id).className = 'navh';
		}
	}
}

function closeSub(n)
{
	plusNav(document.getElementById('nav'+n));
}

function moverNav(el)
{
	ncl = el.className;
	el.className += 'h';
	el.style.cursor = 'pointer';
}
 
function moutNav(el)
{
	el.style.cursor = 'auto';
	if (el.className!='navh')
	{ el.className = ncl;
	}
}

function goPage(n)
{
	 self.location = sv+fldr+pg[n][0];
}

function goPageRef(n, r)
{
	 self.location = sv+fldr+pg[n][0]+'?ref='+r;
}

function fav()
{
	var url = 'http://www.symposia.org.uk';
	var title = 'The Symposium Office, Imperial College London';
	if (ie && bv >= 4)
	{ window.external.AddFavorite(url,title);
	}
}

function splash(on)
{
	if (on==true)
	{ document.getElementById('splash').style.visibility = 'visible';
	}
}

function hideSplash()
{
	document.getElementById('splash').style.visibility = 'hidden';
}

function goNn()
{
	self.location = sv+'nnpres/login.asp';
}



