function findBrowser() {
	var browser; 
	if (navigator.appName == 'Netscape' && document.layers != null) {
		browser = "ns";
	} else if (document.all != null) {
		browser = "ie"
	} else if (navigator.appName == 'Netscape' && document.layers == null && navigator.appVersion.substring(0,1) > 4) {
		browser = "ns6";
	} 
	return browser;
}

function getRef(id) {
	if (findBrowser() == "ns") {
		return document.layers[id];
	} else if (findBrowser() == "ie") {
		return document.all[id];
	} else if (findBrowser() == "ns6") {
		return document.getElementById(id);
	}
}

function setNoSelection() {
	document.onselectstart = function() {return false;} // ie
	document.onmousedown = function() {return false;} 
}

function changeColor(id,color) {
	if (findBrowser() == "ns") {
		getRef(id).bgcolor = color;
	}
	else if (findBrowser() == "ie" || findBrowser() == "ns6") {
		getRef(id).style.backgroundColor = color;
	}	
}

function changeClass(id,newClass) {
	getRef(id).className = newClass;
}

function changeImage(id,imageUrl) {
	document.images[id].src = imageUrl;
}

function changeBackground(id,imageUrl) {
	document.getElementById(id).style.backgroundImage = "url(" + imageUrl + ")";	
}

function hideLayer(id) {
	document.getElementById(id).style.display = "none";		
}

function showLayer(id) {
	document.getElementById(id).style.display = "block";
}

function changeURL(URL) {
	document.location.href = URL;
}

function changeTopURL(URL) {
	top.location.href = URL;
}

function openWindow(URL) {
	window.open(URL);
}

function closeWindow() {
	window.close();	
}

function historyGo(howmuch) {
	history.go(howmuch);	
}

function showhide(layer_ref) { 
	var state = "";
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		state = getRef(layer_ref).style.display;
	} 
	
	if (document.layers) { //IS NETSCAPE 4 or below 
		state = document.layers[layer_ref].display; 
	} 
	
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		state = hza.style.display; 
	}
	
	if (state == 'block') { 
		state = 'none'; 
	} else { 
		state = 'block'; 
	} 
	
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
		eval( "document.all." + layer_ref + ".style.display = state");
	} 
	
	if (document.layers) { //IS NETSCAPE 4 or below 
		document.layers[layer_ref].display = state; 
	} 
	
	if (document.getElementById &&!document.all) { 
		hza = document.getElementById(layer_ref); 
		hza.style.display = state; 
	} 
}

function checkEmail(email) {
//	var email = document.getElementById(’emailaddress’);
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	var returnValue = true;
	if (!filter.test(email)) {
		returnValue = false;
	}
	return returnValue;
}


function popupNewPass() {
	var myNewWindow = window.open('popup_newpass.asp','popupNewPass','height=250, width=450, resizable=no, scrollbars=no');
	myNewWindow.moveTo((window.screen.availWidth -  450) / 2, (window.screen.availHeight - 250) / 2);
	myNewWindow.focus();
}

function promptAlert(msg) {
	alert(msg);
}

function disOrEnableField(fieldid,action) {
	if (action == "disable") {
		document.getElementById(fieldid).disabled = true;
	} else {
		document.getElementById(fieldid).disabled = false;
	}
}


















