	function showMask(name) {
		if (document.all)
			document.all(name).style.visibility = 'visible';
		else
			document.getElementById(name).style.visibility = 'visible';
	}
	
	function hideMask(name) {
		if (document.all)
			document.all(name).style.visibility = 'hidden';
		else
			document.getElementById(name).style.visibility = 'hidden';
	}


	var currentPanel;
	
	function showPanel(panelNum) {
		//hide visible panel, show selected panel, 
		//set tab
		if (currentPanel != null) {
			 hidePanel();
		}
		//document.getElementById('panel'+panelNum).style.visibility = 'visible';
		document.getElementById('panel'+panelNum).style.display = 'block';
			 currentPanel = panelNum;
			 setState(panelNum);
	}
	
 function hidePanel() {
		//hide visible panel, un-highlight tab
		//document.getElementById('panel'+currentPanel).style.visibility = 'hidden';
		document.getElementById('panel'+currentPanel).style.display = 'none';
		document.getElementById('tab'+currentPanel).style.backgroundColor = '#6699FF';
		document.getElementById('tab'+currentPanel).style.color = 'navy';
		document.getElementById('tab'+currentPanel).style.fontWeight = 'normal';
		document.getElementById('tab'+currentPanel).style.border = '#6699FF';
 }
 
	function setState(tabNum) {
		if (tabNum==currentPanel) {
			 document.getElementById('tab'+tabNum).style.backgroundColor = '#000066';
			 document.getElementById('tab'+tabNum).style.border = '#000066';
			 document.getElementById('tab'+tabNum).style.color = 'white';
			 document.getElementById('tab'+tabNum).style.fontWeight = 'bold';
		}
		else {
			 document.getElementById('tab'+tabNum).style.backgroundColor = '#6699FF';
			 document.getElementById('tab'+tabNum).style.border = '#6699FF';
			 document.getElementById('tab'+tabNum).style.color = 'navy';
			 document.getElementById('tab'+tabNum).style.fontWeight = 'normal';
		}
	}
 
	function hover(tab) {
		tab.style.color = 'white';
		tab.style.fontWeight = 'bold';
	}
	
	
	function setPhoneTypes() {
		res_phoneTypes = "";
		addPhoneType(res_type1);
		addPhoneType(res_type2);
		addPhoneType(res_type3);
		addPhoneType(res_type4);
		addPhoneType(res_type5);
		addPhoneType(res_type6);
		addPhoneType(res_type7);
		addPhoneType(res_type8);
		addPhoneType(res_type9);
		addPhoneType(res_type10);
		addPhoneType(res_type11);
		
		//Strip off leading comma
		if (res_phoneTypes.length > 0) {
			res_phoneTypes = res_phoneTypes.substring(2);	
		}
	}
	
	function addPhoneType(value) {
		if (value!="") {
			res_phoneTypes = res_phoneTypes + ", " + value;
		}
	}



	//Used with infoResults and searchResults pages
	function setVar(colName, colValue) {
		//alert(colName);
		switch (colName) {
			case 'No':
				res_houseNumber = colValue;
				break;
			case 'Phone_Type':
				res_phoneType = colValue;
				break;
			case 'Type':
				res_streetType = colValue;
				break;
			case 'Locality':
				res_locality = colValue;
				break;
			case 'Postcode':
				res_postcode = colValue;
				break;
			case 'Cabinet_Id':
				res_cabinetId = colValue;
				break;
			case 'Street':
				res_streetName = colValue;
				break;
			case 'Extra_Info':
				res_extraInfo = colValue;
				break;
			case 'SMS':
				res_smscapable = colValue;
				break;
			case 'URL':
				if (colValue.length > 0){
					res_url = '<a href="' + colValue + '" target="_blank">Picture</a>';
				} else {
					res_url = '';
				}
				break;
			case 'Type1':
				res_type1 = colValue;
				break;
			case 'Type2':
				res_type2 = colValue;
				break;
			case 'Type3':
				res_type3 = colValue;
				break;
			case 'Type4':
				res_type4 = colValue;
				break;
			case 'Type5':
				res_type5 = colValue;
				break;
			case 'Type6':
				res_type6 = colValue;
				break;
			case 'Type7':
				res_type7 = colValue;
				break;
			case 'Type8':
				res_type8 = colValue;
				break;
			case 'Type9':
				res_type9 = colValue;
				break;
			case 'Type10':
				res_type10 = colValue;
				break;
			case 'Type11':
				res_type11 = colValue;
				break;

			default:
				alert('Unknown field name encountered - ' + colName);
				break;
		}
	}
	
	