function jchange(o) {
var fold_image = new Array();
fold_image[0] = "/pics/openarrow.gif";
fold_image[1] = "/pics/closedarrow.gif";

if(document.getElementById(o).style.display=='none') {
document.getElementById(o).style.display='block';
 if(document.getElementById('nfolding')) {
document.getElementById('nfolding').src=fold_image[0];
  }
 } else {
document.getElementById(o).style.display='none';
   if(document.getElementById('nfolding')) {
document.getElementById('nfolding').src=fold_image[1];
   }
   }
}
function renderEmail(email1,email2,email3)
{
    var fullemail = email1 + '@' + email2 + '.' + email3;
    document.write(fullemail);
}
   function sendemail(email1,email2,email3,subject)
{
parent.location = 'mailto:' + email1 + '@' + email2 + '.' + email3 + '?subject=' + subject;
}
  // Validates empty strings
   function ClientValidate(source, arguments)
   {
      if (arguments.Value == '')
        arguments.IsValid = false;
      else
        arguments.IsValid = true;
   }
   
   // Validates e-mail addresses
   function CheckEmail(source,arguments)
   {
       var reg = new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
       
       if (reg.test(arguments.Value) == true)
       {
        arguments.IsValid = true;
       }else{
        arguments.IsValid = false;
       }
   }
   
   // Validates contact us drop down
   function CheckDropDown(source,arguments)
   {
       if (arguments.Value == '-')
         arguments.IsValid = false;
       else
         arguments.IsValid = true;
   }
   
   // Validates text box length
   function CheckLength(source,arguments)
   {
       if (arguments.Value.length > source.MaximumLength)
       {
        arguments.IsValid = false;
       }else{
        arguments.IsValid = true;
       }
   }
          
   function CheckContent(source,arguments)
   {
       var reg = new RegExp("[^\\w\\s.\"@',&/?-]");
       
       if (reg.test(arguments.Value) == true)
       {
        arguments.IsValid = false;
       }else{
        arguments.IsValid = true;
       }
   }
   
   function CheckString(source,arguments)
   {
       var reg = new RegExp("[^\\w\\s.\",'-]");
       
       if (reg.test(arguments.Value) == true)
       {
        arguments.IsValid = false;
       }else{
        arguments.IsValid = true;
       }
   }
   function CheckTelephone(source,arguments)
   {
       var reg = new RegExp("^\\d*$");
       
       if (reg.test(arguments.Value) == true)
       {
        arguments.IsValid = false;
       }else{
        arguments.IsValid = true;
       }
   }
   function CheckPasswordString(source,arguments)
   {
       var reg = new RegExp("^\w*[!?@#$%^&*]*$");
       
       if (reg.test(arguments.Value) == true)
       {
        arguments.IsValid = false;
       }else{
        arguments.IsValid = true;
       }
   }
   function CheckPasswordLength(source,arguments)
   {
      if (arguments.Value.length >= '8')
       {
        arguments.IsValid = true;
       }else{
        arguments.IsValid = false;
       }
   }
   function TitleRadioButton(source,args)
    {   
        if(document.getElementById("rdbMrs").checked || document.getElementById("rbbMrs").checked)
        {
            args.IsValid = true;
        }
        else
        {
            args.IsValid = false;
        }
        
    }
