/*
function checkjoin()
{
 if (!document.joins.ujname.value)
  {
   alert("Enter your name");
   document.joins.ujname.focus();
   return false;
  }
 if (!document.joins.uemail.value)
  {
   alert("Enter your email address");
   document.joins.uemail.focus();
   return false;
  }
 return true;
}

function checkvalidcode()
 {
   if (!document.userreg.email.value)
    {
     alert("Enter email address");
     document.userreg.email.focus();
     return false;
    }
   if (!document.userreg.friendkey.value)
    {
     alert("Enter friendship key");
	 document.userreg.friendkey.focus();
     return false;
    }
   if (!document.userreg.validatecode.value)
    {
     alert("Enter Validation Code");
     document.userreg.validatecode.focus();
     return false;
    }
   return true;
 }

function gofriend(friendid)
{
 urls="contactfriendsprofile.asp?friend=" + friendid 
 window.open(urls,'contactfriend','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=no,width=400,height=400');
 return false;
}
function Buzz(friendid)
{
 urls="buzzfriends.asp?friend=" + friendid 
 window.open(urls,'Buzzfriend','statusbar=no,menubar=no,toolbar=no,scrollbars=yes,resizable=no,width=400,height=400');
 return false;
}

function chkRte_pwd()
{
 if (!document.login.uemails.value)
  {
   alert ("Email address please");
   document.login.uemails.focus();
   return false;
  }
 return true;
}
function chkRte_ans()
{
 if (!document.login.s_answer.value)
  {
   alert ("Enter your answer");
   document.login.s_answer.focus();
   return false;
  }
 return true;
}
*/
function CheckLoginForgottenPassword(formname)
{
 var emailAddress;
 emailAddress = formname.emailAddress.value;
 if (!formname.loginName.value)
  {
   alert("Enter your Login name");
   formname.loginName.focus();
   return false;
  }
 if (!formname.emailAddress.value)
  {
   alert("Enter your email address");
   formname.emailAddress.focus();
   return false;
  }
 var validator, valid = false;
//call syntax validator, specifying that the TLD is required
validator = new EmailSyntaxValidator(emailAddress, true);
//determine validity
valid = validator.IsValid;
//cleanup
validator = null;
 if (valid)
  return true;
 else
  alert("Email adress is Invalid")
  return false;
}


function CheckForgottenPasswordAnswer(formname)
{
 var Answers;
 Answers = formname.Answers.value;
 if (!Answers)
  {
   alert("Enter your Secret Answer");
   formname.Answers.focus();
   return false;
  }
 return true;
}


function CheckNewForgottenPassword(formname)
{
 var newpassword,confirmpassword,newlength
 newpassword=formname.newpassword.value;
 confirmpassword=formname.confirmpassword.value;
 newlength=newpassword.length;
 if (!newpassword)
  {
   alert("Enter your new password");
   formname.newpassword.focus();
   return false;
  }
 if (!confirmpassword) 
  {
   alert("Confirm your new password");
   formname.confirmpassword.focus();
   return false;
  }
 if (newpassword != confirmpassword)
  { 
   alert("Passwords mismatch.");
   formname.newpassword.focus();
   return false;
  }
 if (newlength < 8)
  {
   var s;
   s=window.confirm("Password length is too small. Minimum security for passwords from hackers is 8 characters.\nPlease ensure that your password is not having characters like \";(semi colon).\"' Can I continue")
   if (s)
    return true;
   else
	return false;
  }
 else
  {
   var s;
   s=window.confirm("Please ensure that your password is not having characters like \";(semi colon).\"' Can I continue")
   if (s)
    return true;
   else
	return false;
  }

 return true;
}

function checkLogin(formname)
{
 if (!formname.uname.value)
  {
   alert ("Login name please");
   formname.uname.focus();
   return false;
  }
 if (!formname.upass.value)
  {
   alert("Password please");
   formname.upass.focus();
   return false;
  }
 return true;
}

function ChecKUserDetails(formname)
{
 if (!formname.memberName.value)
  {
   alert ("Enter your name");
   formname.memberName.focus();
   return false;
  }
 if (!formname.userName.value)
  {
   alert("Enter username");
   formname.userName.focus();
   return false;
  }
 if (!formname.userEmail.value)
  {
   alert("Enter your email address");
   formname.userEmail.focus();
   return false;
  }
 if (!formname.userPassword.value)
  {
   alert("Enter your password. Choose a minimum password length as 8 characters.\n This provides you a moderate security. Besure that you are not using character ;(Semi-colon)");
   formname.userPassword.focus();
   return false;
  }
 if (!formname.confirmPassword.value)
  {
   alert("Confirm your password");
   formname.confirmPassword.focus();
   return false;
  }
 if (formname.confirmPassword.value != formname.userPassword.value)
  {
   alert("Password mismatch");
   formname.userPassword.focus();
   return false;
  }
 if (!formname.Answers.value)
  {
   alert("Enter your secret answer");
   formname.Answers.focus();
   return false;
  }
 var validator, valid = false;
 var emailAddress=formname.userEmail.value
//call syntax validator, specifying that the TLD is required
validator = new EmailSyntaxValidator(emailAddress, true);
//determine validity
valid = validator.IsValid;
//cleanup
validator = null;
 if (!valid)
  {
   alert("Email adress is Invalid")
   formname.userEmail.focus();
   return false;
  }
 if (!formname.readpolicy.checked)
  {
   alert("Confirm the terms and conditions");
   return false;
  }
}


function ChecKUserDetailsDetailed(formname)
{
 if (!formname.ProfileHeadline.value)
  {
   alert ("Enter your Profile Title");
   formname.ProfileHeadline.focus();
   return false;
  }
 if (!formname.Description.value)
  {
   alert("Tell about you");
   formname.Description.focus();
   return false;
  }
 if (!formname.Moreaboutyou.value)
  {
   alert("Tell more about you like style, appearance etc.");
   formname.Moreaboutyou.focus();
   return false;
  }
 if (!formname.aboutfriend.value)
  {
   alert("Tell about your friend. You can tell like what kind of friends you are looking for");
   formname.aboutfriend.focus();
   return false;
  }
 var str_desc=formname.Description.value
 str_desc_len=str_desc.length
 if (str_desc_len >400)
  {
   alert("Maximum length is 400 characters. Please split the desctiption");
   formname.Description.focus();
   return false;
  }
 str_desc=formname.Moreaboutyou.value
 str_desc_len=str_desc.length
 if (str_desc_len >400)
  {
   alert("Maximum length is 400 characters. Please limit the more about your appearance to 400 characters");
   formname.Moreaboutyou.focus();
   return false;
  }
 str_desc=formname.aboutfriend.value
 str_desc_len=str_desc.length
 if (str_desc_len >400)
  {
   alert("Maximum length is 400 characters. Please limit the more about your friend to 400 characters");
   formname.aboutfriend.focus();
   return false;
  }
}

function checkMsgDetails(formname)
{
 if (!formname.subject.value)
  {
   alert ("Enter message subject");
   formname.subject.focus();
   return false;
  }
 if (!formname.message.value)
  {
   alert("Enter Email body");
   formname.message.focus();
   return false;
  }
 var str_desc=formname.subject.value
 str_desc_len=str_desc.length
 if (str_desc_len >50)
  {
   alert("Maximum length is 50 characters. Please Reduce your subject size");
   formname.subject.focus();
   return false;
  }
 str_desc=formname.message.value
 str_desc_len=str_desc.length
 if (str_desc_len >250)
  {
   alert("Maximum length is 250 characters. Please limit the email to 250 characters");
   formname.message.focus();
   return false;
  }
  return true;
}

function checkSearchUserName(formname)
{
 if (!formname.s_username.value)
  {
   alert("Enter username you need to search");
   formname.s_username.focus();
   return false;
  }
 return true;
}

function checkReplyMessage(formname)
{
 if (!formname.subject.value)
  {
   alert ("Enter message subject");
   formname.subject.focus();
   return false;
  }
 if (!formname.message.value)
  {
   alert("Enter Email body");
   formname.message.focus();
   return false;
  }
 var str_desc=formname.subject.value
 str_desc_len=str_desc.length
 if (str_desc_len >50)
  {
   alert("Maximum length is 50 characters. Please Reduce your subject size");
   formname.subject.focus();
   return false;
  }
 str_desc=formname.message.value
 str_desc_len=str_desc.length
 if (str_desc_len >250)
  {
   alert("Maximum length is 250 characters. Please limit the email to 250 characters");
   formname.message.focus();
   return false;
  }
  return true;
}

function CheckLoginForgottenUserName(formname)
{
 var emailAddress;
 emailAddress = formname.emailAddress.value;
 if (!formname.emailAddress.value)
  {
   alert("Enter your email address");
   formname.emailAddress.focus();
   return false;
  }
 var validator, valid = false;
//call syntax validator, specifying that the TLD is required
validator = new EmailSyntaxValidator(emailAddress, true);
//determine validity
valid = validator.IsValid;
//cleanup
validator = null;
 if (valid)
  return true;
 else
  alert("Email adress is Invalid")
  return false;
}

function referAFriend(formname)
{
 if (!formname.yourname.value)
  {
   alert ("Enter your name");
   formname.yourname.focus();
   return false;
  }
 if (!formname.youremail.value)
  {
   alert("Enter your email address");
   formname.youremail.focus();
   return false;
  }
 if (!formname.friendsname.value)
  {
   alert("Enter your friends name");
   formname.friendsname.focus();
   return false;
  }
 if (!formname.friendsemail.value)
  {
   alert("Enter your friends email");
   formname.friendsemail.focus();
   return false;
  }
 
 var validator, valid = false;
 var emailAddress=formname.youremail.value
//call syntax validator, specifying that the TLD is required
validator = new EmailSyntaxValidator(emailAddress, true);
//determine validity
valid = validator.IsValid;
//cleanup
validator = null;
 if (!valid)
  {
   alert("Your email adress is Invalid")
   formname.youremail.focus();
   return false;
  }
 emailAddress=formname.friendsemail.value
//call syntax validator, specifying that the TLD is required
validator = new EmailSyntaxValidator(emailAddress, true);
//determine validity
valid = validator.IsValid;
//cleanup
validator = null;
 if (!valid)
  {
   alert("Your friends email adress is Invalid")
   formname.friendsemail.focus();
   return false;
  }
}
