
// JavaScript Document

function selectmenu(N) {
	var L;
    switch (N) {
        case  1 : L = "default.asp"; break;
        case  2 : L = "livinginmillstoneridge.asp"; break;
        case  3 : L = "townofmatthews.asp"; break;
        case  4 : L = "news.asp"; break;
        case  5 : L = "meettheboard.asp"; break;
        case  6 : L = "documentandforms.asp"; break;
        case  7 : L = "resources.asp"; break;

        case  8 : L = "contact.asp"; break;
        case  9 : L = "subscribe.asp"; break;
        case 10 : L = "spanish.asp"; break;

        case 11 : L = "http://www.hawthornemgmt.com/"; break;
        case 12 : L = "http://www.ryanhomes.com/"; break;
		
		
        case 13 : L = "_admin"; break;		
        case 14 : L = "privacypolicy.asp"; break;		
        case 15 : L = "http://www.carlosmason.com/v2/?page=contact.asp"; break;		
		
		case 16 : L = "http://millstoneridge.org/v2/"; break;
		case 17 : L = "http://millstoneridge.org/v2/_admin/"; break;

		case 18 : L = "photogallery.asp"; break;
    }
	document.location = L;
}

function hiddenloginbox() {
	document.getElementById("loginBox").style.visibility = "hidden";
}

function moveloginbox() {
	var W = document.all?document.body.clientWidth:window.innerWidth;
	var H = document.all?document.body.clientHeight:window.innerHeight;
	if (H > 480) { H = 480; }
	var L = ((W / 2) - 180) + "px";
	var T = ((H / 2) - 100) + "px";
	document.getElementById("loginBox").style.top = T;
	document.getElementById("loginBox").style.marginLeft = L;
}

function showloginbox() {
	document.getElementById("loginBox").style.visibility = "visible";
	if (document.getElementById("loginForm").loginName.value.length > 0) {
		document.getElementById("loginForm").loginPassword.focus();
	}
	else
		document.getElementById("loginForm").loginName.focus();	
	moveloginbox();
}

var myMessage = "oops!";
document.onmousedown = rtClickCheck;
function rtClickCheck(keyp)
{
  if (navigator.appName == "Netscape" && keyp.which == 3) {
    alert(myMessage);
    return false;
  }

  if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) {
    alert(myMessage);
    return false;
  }
}

function checkMessageLength(F, L) {
		A = L - F.value.length - 1;
		if (A < 0) { 
			A = 0;
			F.style.color = "#FF0000";
		}
		else
			F.style.color = "#000000";
		B = document.getElementById("textLength");
		B.innerHTML = A + " chars available";
}

function checkemail(str) {
	var filter=/^.+@.+\..{2,3}$/;
	if (str !== "admin") {
	if (!filter.test(str))
		alert(str + " email address is incorrect");
	}
}
