//alert("JavaScripts Directory is Active!");

function dispEmlAdr(emlPrf,emlDom,emlTld,cls,disp) {
	/* Hides email address from spam spiders
		example: nobody@nowhere.com
			emlPrf = email prefix (e.g., nobody)
			emlDom = email domain (e.g., nowhere)
			emlTld = email top-level domain (e.g., com)
		cls = class for link's CSS style
		disp = text displayed for link
	*/
	var q = '"';  //quote (") character (eliminates need to escape quotes)
	var s = '/';  //slash (/) character (eliminates need to escape slashes)
	document.write("<a href=" + q + "&#109;&#97;" + "&#105;&#108;" + "&#116;&#111;&#58;");
	document.write(emlPrf + "&#64;" + emlDom + "&#46;" + emlTld);
	document.write(q + " class=" + q + cls + q + ">");
	if (disp) {
		document.write(disp);
	} else {
		document.write(emlPrf + "&#64;" + emlDom + "&#46;" + emlTld);
	}
	document.write("<" + s + "a>");
}

/*
function checkRadioBtn(id) {
	document.<formName>.<radioName>[id].checked = true;
	//insert name of form and radio buttons where indicated by angle brackets
	//(be sure to remove brackets)
}
*/


Number.prototype.toDecimals = function(n){
	n=(isNaN(n))?
		2:
		n;
	var
		nT=Math.pow(10,n);
	function pad(s){
			s=s||'.';
			return (s.length>n)?
				s:
				pad(s+'0');
	}
	return (isNaN(this))?
		this:
		(new String(
			Math.round(this*nT)/nT
		)).replace(/(\.\d*)?$/,pad);
}

//cost.toDecimals(2); //example of call to the method


function detectEnterKey(e){ //event object passed from function invocation
	var characterCode; //stores ascii character code
	if(e && e.which){ //if which property detects Netscape
		e = e;
		characterCode = e.which; //captures ascii code for Netscape
	}else{
		e = event;
		characterCode = e.keyCode; //captures ascii code for IE
	}
	if(characterCode == 13){ //ascii code for enter key
		alert("Click the \"Update\" button to modify the estimate values.");
		return false;
	}else{
		return true;
	}
}


function nullink(msg) {
	if(msg) {
		alert(msg);
	} else {
		alert("This link is not yet active.");
	}
	return false;
}


/* TOGGLES CONTENT OF A BOX (BY ID) FROM VISIBLE TO HIDDEN */
function toggleBox(boxId) {
	if(!document.getElementById) return;
	var box = document.getElementById(boxId);
	//alert(box.className);
	if(box.className == 'box_hidden') {
		box.className = 'box_visible';
	}else{
		box.className = 'box_hidden';
	}
}
