
  String.prototype.trim = function() { return this.replace(/^\s+|\s+$/, ''); };   
  function CheckFieldOnFocus(FildID,FildValue)
   {
     if(document.getElementById(FildID).value.trim() == FildValue)
      {
        document.getElementById(FildID).value = "";
      }
   }     
  function CheckFieldOnChanges(FildID,FildValue)
   {
     if(document.getElementById(FildID).value.trim() == "")
      {
        document.getElementById(FildID).value = FildValue;
      }
   }   
    // we will add our javascript code here
    $(document).ready(function()
     {
       $("#ajax-contact-form").submit(function(){
       var str = $(this).serialize();
       $.ajax(
        {
          type: "POST",
          url: "CheckUser.php",
          data: str,
          success: function(msg)
           {
             $("#note").ajaxComplete(function(event, request, settings){
             if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
              {
                //result = '<div class="notification_ok">Your message has been sent. Thank you!</div>';
                $("#fields").hide();
                parent.window.location = "registration.php";
              }
             else
              {
                result = msg;
              }
             $(this).html(result);
             });
           }
        });
       return false;
     });
     });
                              
/* BEGIN : Check All Checkbox Function        */
function CheckAllRecord()
 {
   var i;
   if(document.form_name.checkall.checked == true)
    {
      for (i=0; i < document.form_name.checkitem.length;i++)
       {
         document.form_name.checkitem[i].checked = true;
         document.form_name.checkitem[i].parentNode.parentNode.className ="table_text_tr_selected";
       }
    }
   else
    {
      for (i=0; i < document.form_name.checkitem.length;i++)
       {
         document.form_name.checkitem[i].checked = false;
         document.form_name.checkitem[i].parentNode.parentNode.className ="table_text_tr";
       }
    }
   if(i == 0)
    {
      if(document.form_name.checkall.checked == true)
       {
         document.form_name.checkitem.checked = true;
         document.form_name.checkitem.parentNode.parentNode.className ="table_text_tr_selected";
       }
      else
       {
         document.form_name.checkitem.checked = false;
         document.form_name.checkitem.parentNode.parentNode.className ="table_text_tr";
       }
    }
 }
/* END   : Check All Checkbox Function        */
     
/* BEGIN : Check Checkbox Function        */
function CheckIndividual(chk_obj)
 {
   var i, state=0;
   if(chk_obj.checked == true)
    {
      chk_obj.parentNode.parentNode.className ="table_text_tr_selected";
    }
   else
    {
      chk_obj.parentNode.parentNode.className ="table_text_tr";
    } 
   for (i=0; i < document.form_name.checkitem.length; i++)
    {
      if(document.form_name.checkitem[i].checked == false)
       {
         state=1;
         break;
       }
    }
   if(i == 0 && chk_obj.checked == false)
    { 
      state=1;
    }
   if(state == 1)
    {     
      document.form_name.checkall.checked = false;
    }
   else
    { 
      document.form_name.checkall.checked = true;
    }
 }  
/* END   : Check Checkbox Function        */
     
/* BEGIN : Check Checkbox on TD Onclick Function        */
function CheckIndividualByTd(td_obj)
 {
    //alert(td_obj.parentNode.firstChild.nodeType );
 }    
/* END   : Check Checkbox on TD Onclick Function        */


