function $(id)
{
 return document.getElementById(id);
}

function appearForm(){
  var eFormContainer=document.getElementById("emailForm");
  eFormContainer.style.display = "inline";

}

function showcover(){

var coverObj=document.getElementById("cover");
//offset=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
//coverObj.style.top=offset+'px';
coverObj.style.display = "";
coverObj.style.height=document.documentElement.clientHeight;
//$('loginpopup').style.top=100+offset+'px';

}
 
function show(){
for(var i=0;i<arguments.length;i++)
  {
  var e= $(arguments[i]);
  if(e)
    e.style.display="";

  }
}

function hide(){
  for(var i=0;i<arguments.length;i++)
    {
    var e= $(arguments[i]);
    if(e)
      e.style.display="none";
    }
  }

function startMail(){
  show('emailForm');
}


function validateEmailForm(){
  var emailAddressFilter=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/;
  var sName=document.mailForm.senderName;
  var sEmail=document.mailForm.sender;
  var rEmail=document.mailForm.recipients;
  var errorFlag=true;
  var mSpan=$('senderNameErrorMessage');
  var mSpan1 = $("emailErrorMessage");
  var mSpan2 = $("rEmailErrorMessage");
  mSpan.innerHTML="";
  mSpan1.innerHTML="";
  mSpan2.innerHTML="";
  sName.style.border="1px solid #A7A6AA";
  sEmail.style.border="1px solid #A7A6AA";
  rEmail.style.border="1px solid #A7A6AA";
  if(sName.value=="")
    {
       sName.focus();

       mSpan.innerHTML="<br/>You must enter your name";
       mSpan.className="formValidationErrorMessage";
       sName.style.border='2px solid red';
       errorFlag=false;
    }
  if ( sEmail.value == ""  )
    {
       //alert( "You must specify your email address!" );
       sEmail.focus();

       mSpan1.innerHTML="<br/>You must enter your email address";
       mSpan1.className="formValidationErrorMessage";
       sEmail.style.border='2px solid red';
       errorFlag=false ;
    }

 else if ( !(emailAddressFilter.test(sEmail.value)) )
   {
       sEmail.focus();

       mSpan1.innerHTML="<br/>You must enter a valid email address";
       mSpan1.className="formValidationErrorMessage";
       sEmail.style.border='2px solid red';
       errorFlag=false ;
   }
  if ( rEmail.value == ""  )
    {
       //alert( "You must specify your email address!" );
       rEmail.focus();

       mSpan2.innerHTML="<br/>You must enter your email address";
       mSpan2.className="formValidationErrorMessage";
       rEmail.style.border='2px solid red';
       errorFlag=false ;
    }

 else if ( !(emailAddressFilter.test(rEmail.value)) )
   {
       rEmail.focus();
       mSpan2.innerHTML="<br/>You must enter a valid email address";
       mSpan2.className="formValidationErrorMessage";
       rEmail.style.border='2px solid red';
       errorFlag=false ;
   }
  return errorFlag;
}