function addComment(comment)

  {
     var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
     
     login=document.getElementById("loginhint");
     pass=document.getElementById("passhint");
     passconf=document.getElementById("passconfhint");
     email=document.getElementById("emailhint");
     pemail=document.getElementById("pemailhint");
       pass.style.display="none";
       login.style.display="none";
       passconf.style.display="none";
       email.style.display="none";
       pemail.style.display="none";
    if (comment=="login")
      {
       login.className ="addcomment";
       login.style.display="inline";
      }
    else if(comment=="password")
      {
    
    pass.style.marginTop="-.5em";
    pass.className ="addcomment";
    pass.style.display="inline";
    if (is_chrome ==true)
        
    pass.style.marginLeft="29.2em";
    else
    pass.style.marginLeft="1em";
    }
      else if(comment=="passwordconf")
      {

    passconf.className ="addcomment";
    
    
    passconf.style.display="inline";
     if (is_chrome ==true)
         {
    passconf.style.marginLeft="29.2em";
    passconf.style.marginTop="9em";
         }
    else
        {
    passconf.style.marginLeft="1em";
    passconf.style.marginTop="-.5em";
        }
     }
      else if(comment=="email")
      {

    email.className ="addcomment";
    
   
    email.style.display="inline";
     if (is_chrome ==true)
         {
      email.style.marginLeft="29.2em";
      email.style.marginTop="16em";
     }
    else
        {
    email.style.marginLeft="1em";
     email.style.marginTop=".5em";
        }
     }
       else if(comment=="pemail")
      {

    pemail.className ="addcomment";
   
    pemail.style.display="inline";

    if (is_chrome ==true)
         {
     pemail.style.marginLeft="15.8em";
      pemail.style.marginTop="23em";
     }
    else
        {
     pemail.style.marginLeft="16.2em";
     pemail.style.marginTop="2em";
        }
      }
      else if(comment==""){
           pemail.style.display="none";
           email.style.display="none";
           pass.style.display="none";
           passconf.style.display="none";
           login.style.display="none";
      }

  }

//  function checkRadio(a){
//    var radiofirst=document.getElementById("first");
//    var  radiosecond=document.getElementById("second");
//    if (a.value==radiofirst.value)
//    {
//      document.getElementById("user_type").value="rd";
  //    a.style.outline="none";
//        a.style.backgroundImage="url(/images/tick-icon.png)";
  //      a.style.backgroundPosition="5px";
 //       a.style.paddingLeft="2em";
     //   a.style.backgroundRepeat="no-repeat";
   //     a.style.backgroundColor="#f5f5f5";
 //       a.style.outline="none";
//      radiosecond.style.backgroundImage="none";
 //     radiosecond.style.paddingLeft="0.5em";

   // }
 //   else
   // {

   //   document.getElementById("user_type").value="ra"
    //  a.style.outline="none";
    //  a.style.backgroundPosition="5px"
    //  a.style.backgroundImage="url(/images/tick-icon.png)";
    //  a.style.paddingLeft="2em";
   //   a.style.backgroundRepeat="no-repeat";
   //   a.style.backgroundColor="#f5f5f5";
     // radiofirst.style.backgroundImage="none";
    //  radiofirst.style.paddingLeft="0.5em";
   // }
  //}
   $(document).ready(function()
  {

    $("#signup1").validate({
      rules: {

        "user[login]": {
          required: true,
          minlength: 5
        },
        "user[password]": {
          required: true,
          minlength: 6
        },
        "user[password_confirmation]": {
          required: true,
          minlength: 6,
          equalTo: "#user_password1"


        },
        "user[pre_email]": {
          required: true,
          email: true
        },

        "user[email]": {
          required: true,
          email: true
        },
        "user[first_name]": {
          required: true

        },
        "user[last_name]": {
          required: true

        },
        "user[terms]": {
          required: true

        }
      },
      messages: {

        "user[login]": {
          required: "<div class='js_error'>Please enter a username</div>",
          minlength: "<div class='js_error'>Your username consist min 5 characters</div>"
        },
        "user[password]": {
          required: "<div class='js_error'>Please provide a password</div><br>",
          minlength: "<div class='js_error'>Your password consist min 6 characters long</div>"
        },
        "user[password_confirmation]": {
          required: "<div class='js_error'>Please provide a password</div><br>",
          minlength: "<div class='js_error'>Your password consist min 6 characters long</div>",
          equalTo: "<div class='js_error'>Please enter the same password as above</div>"
        },

        "user[email]":{
          required: "<div class='js_error'>Please provide a  email</div>",
          email:  "<div class='js_error'>Please enter a valid email address</div>"
        },


        "user[pre_email]":{
          required: "<div class='js_error'>Please provide a Preferred email</div>",
          email:  "<div class='js_error'>Please enter a valid Preferred email address</div>"
        },

        "user[terms]": "  <font color='red'>You must accept</font>"

      }

    });

  });
  function emailCopy(f) {

    if (document.getElementById('preemail2').value == "")
    {

      document.getElementById('preemail2').value = document.getElementById('email2').value;
    }
  }
  