function toggleDiv(toggleDivId, hideDivs) {
	divtotoggle = document.getElementById(toggleDivId);
	divstohide = hideDivs.split('|');
	
	for(i=0;i<divstohide.length;i++) {
		hidediv = document.getElementById(divstohide[i]);
		hidediv.style.visibility = 'hidden';
	}
	
	if (divtotoggle.style.visibility == 'visible') {
		divtotoggle.style.visibility = 'hidden';
	} else {
		divtotoggle.style.visibility = 'visible';
		var inputs = divtotoggle.getElementsByTagName('INPUT');
		for(i=0;i<inputs.length;i++) {
			if (inputs[i].type == 'text') {
				inputs[i].focus();
				i = inputs.length;
			}
		}
	}
}

function checkFocus(focusDivId, action) {
	if (action == 0) {
		setTimeout("checkFocus('" + focusDivId + "',1)",1000);
	}
	if (action == 1) {
		focusDiv = document.getElementById(focusDivId);
		if (focusDivId == 'contactpopup') {
			if (contactfocus == 0) {
				focusDiv.style.visibility = 'hidden';
			}
		} else {
			if (loginfocus == 0) {
				focusDiv.style.visibility = 'hidden';
			}
		}
	}
}
