//var GDIpath="http://maps.bgs.ac.uk/geoindex/?theme=";
var GDIpath="http://maps.bgs.ac.uk/geoindex/default.aspx?resetsession=true";
var GDIoffshore='http://maps.bgs.ac.uk/geoindex_offshore/default.aspx?resetsession=true';
var GDItrialpath="http://mapapps2.bgs.ac.uk/geoindex/home.html";
var scrnWidth=screen.availWidth-30;
var scrnHeight=screen.availHeight-60;

function openGeoIndex(geoIndexUri)
{
	if (geoIndexUri == '') 
	{geoIndexUri = GDIpath;}
	var winName='gdimain';
	var winFeatures="scrollbars=yes,status=yes,width="+scrnWidth+",height="+scrnHeight+",screenX=0,left=0,screenY=0,top=0,resizable=yes";
	var win=window.open(geoIndexUri,winName,winFeatures);
	win.focus();
	}

function openGeoIndexTrial(geoIndexUri)
{
	if (geoIndexUri == '') 
	{geoIndexUri = GDItrialpath;}
	var winName='gdimain';
	var winFeatures="scrollbars=yes,status=yes,width="+scrnWidth+",height="+scrnHeight+",screenX=0,left=0,screenY=0,top=0,resizable=yes";
	var win=window.open(geoIndexUri,winName,winFeatures);
	win.focus();
	}
	
function openGeoIndexOffshore()
{
	var winName='gdioffshore';
	var winFeatures="scrollbars=yes,status=yes,width="+scrnWidth+",height="+scrnHeight+",screenX=0,left=0,screenY=0,top=0,resizable=yes";
	var win=window.open(GDIoffshore,winName,winFeatures);
	win.focus();
	}
	
function setGeoIndexUri(svcId){
	var geoIndexUri='';
	//ditto geoIndexUri=GDIpath + svcId;
	geoIndexUri=GDIpath;
	return geoIndexUri;
	}
	
function linkClick(aRef){
	var geoIndexUri='';
	if(aRef.id.length > 0)
		{
			if(aRef.id != 'offshore')
			{geoIndexUri=setGeoIndexUri(aRef.id);}
			else
			{geoIndexUri = GDIoffshore;}
			if(geoIndexUri.length > GDIpath.length){openGeoIndex(geoIndexUri);}
		}
	return false;
	}
