// Email Spam hiding.
function popMail(host,user,args) {
	var acct = user +'@'+ host;
	self.location.href = 'mailto:'+ acct +'?'+ args;
}
function linkMail(host,user,cls,args) {
	document.write('<a href="javascript:popMail(\''+ host +'\',\''+ user +'\',\''+ args +'\');"');
	if (cls) {
		document.write(' class="'+ cls +'"');
	}
	document.write('>');
	showMail(host,user);
	document.write('</a>');
}
function showMail(host,user) {
	var acct = user +'@'+ host;
	document.write(acct);
}
	



function centerPop(page,w,h,args){
	if (w > 0) {
	} else {
		w = 650
	}
	if (h > 0) {
	} else {
		h = 550
	}
	var width
	var height
	var leftdist
	var topdist
	width = screen.width;
	height = screen.height;
	leftdist = Math.round((width - w) / 2);
	topdist = Math.round((height - h) / 2);
	if (args == '') {
		args = 'resizable=1,menubar=0,location=0,scrollbars=1,status=1,toolbar=0';
	}
	cpw = window.open(page,'cpw','width='+ w +',height='+ h +',top='+topdist+',left='+leftdist+','+ args);
	cpw.focus();
}




	onSection = Array(0);
	t = '';
	
	function clearTo (toIdx) {
		for (i = (onSection.length - 1); i >= toIdx; i = i-1) {
			if (onSection[i]) {
				if (document.getElementById('subId'+ onSection[i])) document.getElementById('subId'+ onSection[i]).style.display = 'none';
				$('navId'+ onSection[i]).firstDescendant().removeClassName('on');
				onSection[i] = false;
			}
		}
	}
	
	function mainNav (key,idx) {
		if (t) {
			clearTimeout(t);
			t = '';
		}
		if (key == onSection[idx]) {
			clearTo(idx + 1);
		} else {
			if (onSection[idx]) {
				clearTo(idx);
			}
			if (key) { 
				if (document.getElementById('subId'+ key)) {
					
					document.getElementById('subId'+ key).style.display = 'block';
				}
				$('navId'+ key).firstDescendant().addClassName('on');
			} 
			onSection[idx] = key
		}
	
	}
	
	function pauseHide () {
		t = setTimeout("mainNav('',0)",750);
	}
	
	function moveLeft (id) {

		parentObj = getElementById(id).getParent();
		
		w = $(id).getWidth();
	
		top.alert(w +':'+ getWidth(parentObj));
	
	}




	function addOnLoadEvent(func) {

	  var oldonload = window.onload;

	  if (typeof window.onload != 'function') {

		window.onload = func;

	  } else {

	//	top.alert(oldonload)
	//	top.alert(func)

		window.onload = function() {

		  if (oldonload) {
			oldonload();
		  }
		  eval (func +'()');

		}

	  }

	}


