
var nav1 = {};

nav1.showSub = function(obj) {
	// var pa = obj.parentNode;
	obj.className = 'expanded';
	/*
	if (obj.className.indexOf('active') == -1) {
		img = obj.firstChild;
		ext = img.src.substring(img.src.lastIndexOf('.'), img.src.length);
		img.src = img.src.replace(ext, '_s'+ext);
	}
	*/
}

nav1.hideSub = function(obj) {
	obj.className = '';
}

nav1.over = function(obj) {
	if (obj.className.indexOf('active') == -1) {
		img = obj.firstChild;
		ext = img.src.substring(img.src.lastIndexOf('.'), img.src.length);
		img.src = img.src.replace(ext, '_s'+ext);
	}
}

nav1.out = function(obj) {
	if (obj.className.indexOf('active') == -1) {
		img = obj.firstChild;
		ext = img.src.substring(img.src.lastIndexOf('.'), img.src.length);
		img.src = img.src.replace( '_s'+ext, ext);
	}
}

createMailto = function(pers, domain) {
	var email = pers + '@' + domain;
	document.write('<a href="mailto:'+email+'">'+email+'</a>');
}

showPopup = function(lnk) {
	var url = lnk.href;
	var w = 400;
	var h = 420;
	var x = parseInt(screen.width / 2) - parseInt(w/2);
	var y = parseInt(screen.height / 2) - parseInt(h/2);
	var parameters = 'location=0,menubar=1,toolbar=1,scrollbars=0,width=' + w + ',height=' + h + ',top=' + y + ',left=' + x + ',screenY=' + y + ',screenX=' + x;
	var w = window.open(url, 'p', parameters);
	if (w.focus) w.focus();
	return false;
}

addCssClass = function(id, cssClass) {
	var obj = document.getElementById(id);
	var c = obj.className + ' ';
	if (c.indexOf(cssClass + ' ') == -1) obj.className = c + cssClass;
}	

removeCssClass = function(id, cssClass) {
	var obj = document.getElementById(id);
	var c = obj.className + ' ';
	obj.className = c.replace(cssClass + ' ', '');
}		

