//HIGHLIGHT CURRENT PAGE

var CurPage = '';

linkCounter = 0;

var alllinks = '';

var linkoncolour = '#0069B4';

	function linkPos(obj){

		CurPage = window.location.href;

		var CounterEnabled = 'Y';

		alllinks = document.links.length;
		
		
		
		for (var i = 0; i < document.links.length; i++)
		{

		if (document.links[i].href == CurPage)
			{
			document.links[i].style.color = linkoncolour;//LINK HIGHLIGHT COLOUR
//			document.styles.class.add
            document.links[i].className += document.links[i].className?' Active':'Active';


			CounterEnabled = 'N';
			}else{
				if(CounterEnabled == 'Y')	
				{
				linkCounter = parseInt(linkCounter+1);	
				}
			}

		}

		var mname = '';//alert(window.document.title.substring(29,33))
		mname = window.document.title.substring(29,33);
		if(window.document.getElementById(mname + 'txt')){
			window.document.getElementById(mname + 'txt').style.color = linkoncolour;	
			window.document.getElementById(mname + 'txt').style.fontWeight = 'bold';	
			 document.getElementById(mname + 'txt').className += document.getElementById(mname + 'txt').className?' Active':'Active';
			}

	}

// OPEN A HIDDEN DIV

	var LstOpenedDiv = 'aboutdiv'

	function oDiv(divid){
		cDiv(LstOpenedDiv);
		window.document.getElementById(divid).style.display = 'block';
		LstOpenedDiv = divid;
		}

	function cDiv(divid){
		window.document.getElementById(divid).style.display = 'none';
		}

// CLOSES MENUS WHEN A NON-LINK IS CLICKED ===

	function cls(e){
		if(e)	{
			var obj = e.target
			}else{
			var obj = event.srcElement
			}
			if(obj.nodeName != 'A')
				{
				cDiv(LstOpenedDiv);
				}
			}
	document.onmouseup = cls;

//BRANCH PAGE

	var LstBtnON = 'harpenden';

	function btnon(objnme){
		window.document.getElementById(LstBtnON + 'btn').style.borderColor = '#ccc';
		window.document.getElementById(LstBtnON + 'btn').style.backgroundColor = '#fff';
		window.document.getElementById(objnme + 'btn').style.borderColor = '#C68CD9';
		window.document.getElementById(objnme + 'btn').style.backgroundColor = '#C68CD9';
		
		window.document.getElementById(LstBtnON + 'div').style.display = 'none';
		window.document.getElementById(objnme + 'div').style.display = 'inline';

		LstBtnON = objnme;

		}

// 	QUICK SHOW AND HIDE

	function shwObj(objid,styprop){
		window.document.getElementById(objid).style.display = styprop;
		}

//	BOARD PANELS

	var lastpanel = ''

	function panel(objid){
		if(lastpanel == ''){
			window.document.getElementById(objid).style.display = 'inline';			
			}else{
			window.document.getElementById(lastpanel).style.display = 'none';
			window.document.getElementById(objid).style.display = 'inline';
			}
			lastpanel = objid;
		}
	
//Clears the value of a textbox		
function ClearIfDefaultValue(formField, defaultValue) {
      if(defaultValue == formField.value) formField.value = '';
}
//resets the cleared value of a text box
function ResetDefaultValueIfBlank(formField, defaultValue) {
      if('' == formField.value) formField.value = defaultValue;
}
