var nyr = '10';
var nev = '14';
var nref = nyr+'.'+nev;
var tim;

var ind = 'index.html';
var wnd;
var ns = (navigator.appName == 'Netscape');
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 ss = 'https://www.prossl.com/symposiassl/';
var sv = 'http://www.symposia.org.uk/';
var sn = 'http://www.symposia.org.uk/neonatal/';
if (location.href.indexOf('localhost')>0) // test
{ ss = 'http://localhost/symposia/symposiassl/';
	sv = 'http://localhost/symposia/symposia/';
	sn = 'http://localhost/symposia/neonatal/';
}
pg = new Array(9);
pg[0] = sv+'index.html';
pg[1] = 'info.html';
pg[2] = ss+'getstatus.asp?year='+nyr+'&evcd='+nev+'&redir='+sn+'programme.html';
pg[3] = ss+'regform.asp';
pg[4] = 'venue.html';
pg[5] = 'exhibitors.html';
pg[6] = 'transport.html';
pg[7] = 'accomodation.html';
pg[8] = 'default.html';
var ncl;

function emlk(n, d, s, h)
{
	var a = n+'@'+d;
	var t = (s==null) ? a : s;
	var sh = (h==null) ? 'Neonatal update' : h;
	document.write('<a href="mailto:'+a+'?Subject='+h+'">'+t+'</a>');
}

function moverNav(el)
{
	ncl = el.className;
	el.className = 'navh';
	el.style.cursor = 'pointer';
}
 
function moutNav(el)
{
	el.style.cursor = 'auto';
	el.className = ncl;
}

function goPage(n)
{
	var i = location.search.indexOf('sti') + 4;
	var j = location.search.indexOf('sts') + 4;
	var sti = parseInt(location.search.substr(i,1));
	var sts = location.search.substr(j).replace('%20',' ');
	if (n==3)
	{ regWnd(nref);
	} 
	else
	{ self.location = pg[n]+'?sti='+sti+'&sts='+sts;
	}
}


function regWnd(ref)
{
	var url = pg[3];
  var props = 'dependent=no,width=680,height=600,titlebar=yes,status=yes,menubar=no,toolbar=yes,directories=no,scrollbars=yes,location=no,resizable=yes';
	url += '?ref='+ref;
  wnd = window.open(url, 'reg', props);
	wndName = 'reg';
	wndURL = url;
	tim = setTimeout('chkWnd()', 2000);
	return false;
}

function pbWnd(ref)
{
	var url = pg[8];
  var props = 'dependent=no,width=680,height=600,titlebar=yes,status=yes,menubar=no,toolbar=yes,directories=no,scrollbars=yes,location=no,resizable=yes';
	url += '?ref='+ref;
  wnd = window.open(url, 'reg', props);
	wndName = 'reg';
	wndURL = url;
	tim = setTimeout('chkWnd()', 2000);
	return false;
}

function mapWnd(ref)
{
	var url = 'http://www.streetmap.co.uk/streetmap.dll?'+ref;
  var props = 'dependent=no,width=800,height=560,left=40,top=20,titlebar=yes,status=yes,menubar=yes,toolbar=yes,directories=no,scrollbars=yes,location=no,resizable=yes';
  wnd = window.open(url, 'map', props);
	wndName = 'map';
	wndURL = url;
	tim = setTimeout('chkWnd()', 2000);
	return false;
}

function chkWnd()
{
	var typ;
	if (wnd.closed)
	{	typ = (wndName=='map')?'map':'form';
		alert('Unable to open a new window, possibly due to a popup blocker.  The '+typ+' you have requested will open in the main window.');
		self.location = wndURL;
	}  
}

function status()
{
	var i = location.search.indexOf('sti') + 4;
	var j = location.search.indexOf('sts') + 4;
	var sti = parseInt(location.search.substr(i,1));
	var sts = location.search.substr(j).replace('%20',' ');
	if (sti==1 || sti==2 || sti==6)
	{ document.getElementById('status1').innerHTML = '<p>'+sts+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" onclick="goPage(3)"><strong>Click here</strong></a> to register for this event.</p>';
	}
	else
	{ if (sti==7)
		{ document.getElementById('status1').innerHTML = '<p>Sorry, this event is fully booked this year but please <a href="#" onclick="goPage(8)"><strong>Click here</strong></a> for priority booking for next year.</p>';
		}
		else
		{ document.getElementById('status1').innerHTML = '<p>'+sts+'</p>';
		}
	}
	document.getElementById('status2').innerHTML = document.getElementById('status1').innerHTML;
}
