  function VoteUser( Rating, UserID )
  {
          var handler = null;
          var posts            = new Array();

          posts[ 'r' ]        = Rating;
	  posts[ 'u' ]        = UserID;
		  
          if ( Rating != '' && UserID != '' )
          {

                  do_request_function = function ()
                  {
		if ( typeof handler.xmlhandler.responseText != undefined && handler.readystate_ready_and_ok( ) )
                          {

                                  $Div = document.getElementById( 'divRate' );
								  
                                  if ( $Div )
                                  {

                                          $Div.innerHTML = handler.xmlhandler.responseText;

                                  }
                          }
                  }

                  handler = new XMLHttp_request();

                  handler.process( url + '/ajax/members/profile?r='+ Math.random() +'&v=VoteUser', 'POST', handler.format_for_post(posts) );
                  handler.onreadystatechange( do_request_function );

          }
  }
  
  function UserExists( UserName )
  {
          var handler = null;
          var posts            = new Array();

           posts[ 'u' ]        = UserName;

          if ( UserName != '' )
          {

                  do_request_function = function ()
                  {

		if ( typeof handler.xmlhandler.responseText != undefined && handler.readystate_ready_and_ok( ) )
                          {

                                  $Div = document.getElementById( 'aUsername' );

                                  if ( $Div )
                                  {

                                          if ( handler.xmlhandler.responseText == 0 )
                                          {

                                                  $Div.innerHTML = "<img src=../images/icons/icon_delete.gif>";

                                          }

                                          else
                                          {

                                                  $Div.innerHTML = "<img src=../images/icons/icon_accept.gif>";

                                          }

                                  }

                          }

                  }

                  handler = new XMLHttp_request();

                  handler.process( url + '/ajax/members/signin?v=UserExists', 'POST', handler.format_for_post(posts) );
                  handler.onreadystatechange( do_request_function );

          }

  }

  function CorrectPass( PassA, PassB )
  {

          if ( PassA != '' && PassB != '' )
          {

                  if ( PassA != PassB )
                  {

                              document.getElementById( 'aPassword_1' ).innerHTML = "<img src=../images/icons/icon_delete.gif>";
                              document.getElementById( 'aPassword_2' ).innerHTML = "<img src=../images/icons/icon_delete.gif>";

                  }

                  else
                  {

                          document.getElementById( 'aPassword_1' ).innerHTML = "<img src=../images/icons/icon_accept.gif>";
                          document.getElementById( 'aPassword_2' ).innerHTML = "<img src=../images/icons/icon_accept.gif>";

                  }

          }

  }


  function CheckMail( Email )
  {

          if ( Email != '' )
          {

                  var Evalid = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+(,\s?([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+)*$/;

                  if ( ! Evalid.test ( Email ) )
                  {

                          document.getElementById( 'aMail' ).innerHTML = "<img src=../images/icons/icon_delete.gif>";

                  }

                  else
                  {

                          document.getElementById( 'aMail' ).innerHTML = "<img src=../images/icons/icon_accept.gif>";

                  }

          }

  }


  function toggleAvatar( A, B, C )
  {

          toggleDiv( 'div_this', A );
          toggleDiv( 'div_load', B );
          toggleDiv( 'div_dele', C );

  }

  function togglePhoto( URL, Width, Height, Title, ElementID, PhotoID )
  {

          /*
           Set the new image
           */
		  document.getElementById( 'showPhoto' ).src         = URL;
		  document.getElementById( 'showPhoto' ).width       = Width;
		  document.getElementById( 'showPhoto' ).height      = Height;
		  document.getElementById( 'showPhoto' ).title       = Title;


          var handler = null;

          /*
            Set POST variable's
          */

          var posts            = new Array();

          /*
            POST'S
          */

          posts[ 'p' ]        = PhotoID;

          if ( PhotoID != '' )
          {

                  do_request_function = function ()
                  {

                          $Div = document.getElementById( 'comments' );
						  
						  if ( typeof handler.xmlhandler.responseText != undefined && handler.readystate_ready_and_ok( ) )
						  {
							  
                                  if ( $Div )
                                  {

                                          $Div.innerHTML = handler.xmlhandler.responseText;

                                  }
								  
						  }
						  else
						  {
							      
                                  if ( $Div )
                                  {

                                          /*$Div.innerHTML = '<div class="vak"><h2>Core System : Loading..</h2><div class="container"><ul>De comments worden geladen.. even geduld a.u.b.</ul><br class="clear" /></div></div>';*/

                                  }
								  
                          }

                  }

                  handler = new XMLHttp_request();

                  handler.process( url + '/ajax/members/comments', 'POST', handler.format_for_post(posts) );
                  handler.onreadystatechange( do_request_function );

          }

  }

  function postComment( PhotoID, Message )
  {
	  
          var handler = null;

          /*
            Set POST variable's
          */

          var posts            = new Array();

          /*
            POST'S
          */

          posts[ 'p' ]        = PhotoID;
          posts[ 'm' ]        = Message;


          do_request_function = function ()
          {

                  $Div = document.getElementById( 'commentpost' );
				  
                  if( ! handler.readystate_ready_and_ok( ) )
                  {

                          if ( $Div )
                          {
							  
                                  /*$Div.innerHTML = '<div class="vak"><h2>Core System : Loading...</h2><div class="container"><ul>Loading..</ul><br class="clear" /></div></div>';*/

                          }

                  }
                  else
                  {

                          if ( $Div )
                          {

                                  $Div.innerHTML = handler.xmlhandler.responseText;

                          }

                  }

          }

          handler = new XMLHttp_request();

          handler.process( url + '/ajax/members/comments/post', 'POST', handler.format_for_post(posts) );
          handler.onreadystatechange( do_request_function );

  }
  
  function ratePhoto( PhotoID, Rating )
  {

          var handler = null;

          /*
            Set POST variable's
          */

          var posts            = new Array();

          /*
            POST'S
          */

          posts[ 'p' ]        = PhotoID;
          posts[ 'r' ]        = Rating;
		  
          do_request_function = function ()
          {

                  $Div = document.getElementById( 'votepost' );

                  if( ! handler.readystate_ready_and_ok( ) )
                  {

                          if ( $Div )
                          {

                                  /*$Div.innerHTML = '<div class="vak"><h2>Core System : Loading..</h2><div class="container"><ul>De comments worden geladen.. even geduld a.u.b.</ul><br class="clear" /></div></div>';*/

                          }

                  }
                  else
                  {

                          if ( $Div )
                          {

                                  $Div.innerHTML = handler.xmlhandler.responseText;

                          }
                  }
          }

          handler = new XMLHttp_request();

          handler.process( url + '/ajax/members/comments/vote', 'POST', handler.format_for_post(posts) );
          handler.onreadystatechange( do_request_function );

  }
  
  function toggleChecked( ElementID )
  {

          document.getElementById( ElementID ).checked = !document.getElementById( ElementID ).checked;

  }

  function toggleCheckAll( Type, ElementID )
  {

          for( var i = 0; i < ElementID.elements.length; i++ )
          {

                  ElementID.elements[i].checked = Type;

          }
  }