function markLocation() {
	var filename = location.pathname.substr(location.pathname.lastIndexOf('/')+1,location.pathname.length);
	var theLinks = document.getElementById('mainMenu').getElementsByTagName('a');
	
	for (var x = 0; x <= (theLinks.length-1); x++)
	{
		if ((theLinks[x].href.indexOf(filename) > 1) && (theLinks[x].href.indexOf('#') == -1)) {
			theLinks[x].parentNode.className = 'here';
		}

		if ((location.pathname == '/') && (theLinks[x].href.indexOf('index.asp') > 1)) {
			theLinks[x].parentNode.className = 'here';
		}
	}
	
}

/* function to add an onload event */
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') 
  {
    window.onload = func;
  } else 
    {
       window.onload = function() 
    {
      oldonload();
      func();
    }
  }
}	

function displayWord() {
	words = ['<strong>Bissel</strong> - A small amount.',
			'<strong>Bubeleh</strong> - Darling, sweetheart - a term of affection.',
			'<strong>Bubkis</strong> - Zero, nothing.',
			'<strong>Tchatchkes</strong> - Small things, knicknacks.',
			'<strong>Fahklempt</strong> - Emotionally choked-up.',
			'<strong>Feh</strong> - No good! Not unlike "fuhgedaboutit".',
			'<strong>Hamish</strong> - warm, friendly, down to earth.',
			'<strong>Klutz</strong> - a clumsy person.',
			'<strong>Kopf</strong> - Head.',
			'<strong>Kvell</strong> - To be very proud of and happy for someone (usually a parent to a child).',
			'<strong>Kvetch</strong> - To complain, in an annoying, whiny way.',
			'<strong>Mazel Tov</strong> - Congratulations!',
			'<strong>Mensch</strong> - An admirable person.',
			'<strong>Mishugas</strong> - Craziness.',
			'<strong>Meshugeneh</strong> - A funny, crazy person.',
			'<strong>Mishpocha</strong> - Family.',
			'<strong>Mitzvah</strong> - A blessing.',
			'<strong>Nachas</strong> - Great joy.',
			'<strong>Plotz</strong> - To burst from emotions.',
			'<strong>Shaineh</strong> - Beautiful – a Shaineh maidel is a beautiful girl.',
			'<strong>Shlemiel</strong> - A stupid, clumsy person.',
			'<strong>Shlep</strong> - To drag or carry, often something heavy or unwieldy.',
			'<strong>Shpilkes</strong> - Pins and needles, nervousness, worries.',
			'<strong>Simchas</strong> - Joyous occasions, like the birth of a grandchild.',
			'<strong>Tsuris</strong> - Aggravation, trouble, worries.',
			'<strong>Tuchis</strong> - One\'s behind, as in what one sits on.  Also "tushie".',
			'<strong>Ungepatched</strong> - Mixed up.',
			'<strong>Mazel Tov</strong> - Congratulations!',
			'<strong>Mitzvah</strong> - A blessing.',
			'<strong>Feh</strong> - No good! Not unlike "fuhgedaboutit"',
			'<strong>Tchatchkes</strong> - Small things, knicknacks.'];
	
	var d=new Date();
	
	$('#wordOfDayContent').html('<p>' + words[d.getDate()-1] + '</p>');
}

function setupMask() {
	theObject = document.getElementById('centerMask');
	theObject.style.filter = 'alpha(opacity:"75")';
	theObject.style.KHTMLOpacity = .75;
	theObject.style.MozOpacity = .75;
	theObject.style.opacity = .75;
}

function showMask() {
	$('#centerMaskContent').height((document.getElementById('centerContent').scrollHeight)-26);	
}

function checkEmailAddr(formId) 
{
	theForm = document.getElementById(formId);
	theEmail = document.getElementById('email');
	
	illegal = /[^\w._\-]/;
	email = theForm.email.value;
	
	if (email.length<6 || email.indexOf("@")==-1 || email.indexOf('.')==-1) { email=""; }
	else 
	{
		At = email.indexOf("@");
		Period = email.lastIndexOf('.');
		DNS1 = email.substring(0,At);
		if (DNS1.length<1 || DNS1.match(illegal)!=null) email="";
		DNS2 = email.substring(At+1,Period);
		if (DNS2.length<1 || DNS2.match(illegal)!=null) email="";
		DNS3 = email.substring(Period+1,email.length);
		if (DNS3.length<2 || DNS3.match(illegal)!=null) email="";
	}
	
	if (email.length==0) 
	{
		alert("The email address you have entered is invalid. Please re-enter a valid email address.\n");
		theEmail.focus();
		return false;
	}
	
	return true;
}