function jumpAZ(azletter){	if (azletter == "") return alert("No letter specified to jump to.");		var imgcontainer = document.getElementById('refreshingContainer');	imgcontainer.style.visibility = 'visible';		//Set the list to the new letter	var theframe=document.getElementById('azframe');	theframe.src='directoryAZ?openForm&section=' + azletter;		imgcontainer.style.visibility = 'hidden';}function openDirectoryRegion(regionDocUNID, regionName){	var basehrefobj = document.getElementById('baseref');	var basehreftext = basehrefobj.innerHTML;	var breadcrumbs = document.getElementsByName('breadcrumb');	var unidstring = '';	var newURL = '';	var thisunid = '';	//Emergency assign if empty	if (regionName == '') regionName = "Auckland";		unidstring = buildIDString(breadcrumbs)		thisunid = getThisUNID();			//Add the current document unid as the last element	unidstring += ',' + thisunid;			newURL = basehreftext + 'unid/' + regionDocUNID + '?openDocument&method=specifiedregion&region=' + regionName +'&bc=' + unidstring;	window.location.href = newURL;}function getThisUNID(){	var currentURL = window.location.pathname;	var lastpos = currentURL.lastIndexOf('/');		return currentURL.substr(lastpos + 1);}function openDirectoryEntry(documentUNID, openMethod, lastparam){	var basehrefobj = document.getElementById('baseref');	var basehreftext = basehrefobj.innerHTML;	var breadcrumbs = getElementsByClass('breadCrumbLink', null, null);		//Custom function - see below.	var unidstring = '';	var newURL = '';	var thisunid = '';			unidstring = buildIDString(breadcrumbs)	if (openMethod == 'search')	{		thisunid = getThisUNID();	}	else	{		thisunid = documentUNID;	}	//Add the current document unid as the last element	unidstring += ',' + thisunid;		if (documentUNID == "") return alert("Invalid or unknown document id.");	if (openMethod == '') {method = 'AtoZ'} else {method = openMethod}	newURL = basehreftext + 'directoryEntry?openForm&unid=' + documentUNID + '&method=' + openMethod + '&bc=' + unidstring + '&lastparam=' + lastparam;			window.location.href = newURL;}function getElementsByClass(searchClass,node,tag){	var classElements = new Array();		if ( node == null) node = document;	if ( tag == null)	tag = '*';	var els = node.getElementsByTagName(tag);	var elsLen = els.length;	var pattern = new RegExp("(^|\\\\s)"+searchClass+"(\\\\s|$)");	for (i = 0, j = 0; i < elsLen; i++)	{		if ( pattern.test(els[i].className))		{			classElements[j] = els[i];			j++;		}	}	return classElements;}function buildIDString(breadcrumbs){	var temp = '';	var count = -1;		for (i = 0;i < breadcrumbs.length; i++)	{		if (breadcrumbs[i].id != 'Home')		{			count += 1;					if (count == 0)			{				temp += breadcrumbs[i].id;			}			else			{				temp += ',' + breadcrumbs[i].id;			}		}	}		return temp;}function serviceGoTo(objectID){	var newURL = '';		var currentURL = window.location.href;	var combobox = document.getElementById(objectID);	var seletedString = combobox.value;	var foundat = currentURL.indexOf('&');	var nonselect = 'select a service';			if (seletedString.toLowerCase() == nonselect) return;		if (foundat == 0)	{		newURL = currentURL + '&method=Service&start=' + seletedString;	}	else	{		newURL = currentURL.substr(0, foundat) + '&method=Service&start=' + seletedString;	}		//Set the new URL;	window.location.href = newURL;}