String.prototype.trim = function() {
	a = this.replace(/^\s+/, '');
	return a.replace(/\s+$/, '');
};


function emailFocus() {
	var sEmail = document.fLogin.email.value;

	document.getElementById("email").style.fontSize="12px";
	document.getElementById("email").style.color="#000";

	if (sEmail == "Email")
	{
		document.fLogin.email.value = "";
	}
}

function emailBlur() {
	var sEmail = new String(document.fLogin.email.value);

	if (sEmail == "Email" || sEmail.trim() == "")
	{
		document.getElementById("email").style.fontSize="10px";
		document.getElementById("email").style.color="#777";
		document.fLogin.email.value = "Email";
	}

	if (sEmail == "me")
	{
		document.getElementById("header").style.height = "88px"; 
		document.getElementById("loginError").style.display = ""; 
		document.getElementById("loginBox").style.paddingTop = "5px";
	}
}

function pwdFocus() {
	var sPwd = document.fLogin.pwd.value;

	document.getElementById("pwd").style.fontSize="12px";
	document.getElementById("pwd").style.color="#000";

	document.getElementById("pwd").style.backgroundImage="none";

	if (sPwd == "Password")
	{
		document.fLogin.pwd.value = "";
	}
}

function pwdBlur() {
	var sPwd = new String(document.fLogin.pwd.value);

	if (sPwd == "Password" || sPwd.trim() == "")
	{
		document.getElementById("pwd").style.backgroundImage="url('/images/password-bg.gif')";
		/* document.getElementById("pwd").style.fontSize="10px";
		document.getElementById("pwd").style.color="#777"; */
		document.fLogin.pwd.value = ""; 
	}
}


function emailsFocus() {
	var sEmails = document.fSignUp.emails.value;

	if (sEmails == "(Please use a comma, semi-colon or line feed to separate multiple addresses.)")
	{
		document.fSignUp.emails.value = "";
	}
}

function emailsBlur() {
	var sEmails = document.fSignUp.emails.value;

	if (sEmails == "Password" || sEmails.trim() == "")
	{
		document.fSignUp.emails.value = "(Please use a comma, semi-colon or line feed to separate multiple addresses.)";
	}
}

function openMiscPopup(contentId) {
      var scrollY;
      
      if (document.all)
      {
         if (!document.documentElement.scrollTop)
            scrollY = document.body.scrollTop;
         else
            scrollY = document.documentElement.scrollTop;
      }   
      else
      {
         scrollY = window.scrollY;
      }
   
   //var yLoc = intClientY+scrollY-210;
   //var stryLoc = yLoc + "px";
   document.getElementById("miscPopupBox").style.display = ""; 
   //document.getElementById("miscPopupBox").style.top = stryLoc;
   //getEmailInfo(intLinkId);
   document.getElementById("main").style.opacity = .2;
   document.getElementById("main").style.filter = 'alpha(opacity=20)';
   return(0);
}
function closeMiscPopup() {
   document.getElementById("miscPopupBox").style.display = "none";
   document.getElementById("main").style.opacity = 1;
   document.getElementById("main").style.filter = 'alpha(opacity=100)';
}
