/*new Ajax.Request('/jasonprofile',
  {
    method:'get',
    onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      alert("Success! \n\n" + response);
    },
    onFailure: function(){ alert('Something went wrong...') }
  });
*/
/*
function check_current_email(){
	email = document.getElementById('id_user_email').value;
	new Ajax.Updater('checkemail', '/checkemail', { method: 'get', parameters: {sub_email: email} });
	//alert('ckecking email: '+email)
}

function check_current_password(){
	password = document.getElementById('id_user_password').value;
	new Ajax.Updater('checkpassword', '/checkpassword', { method: 'get', parameters: {sub_password: password} });
	//alert('checking password: '+password)
}

function check_current_name(){
	name = document.getElementById('id_user_fullname').value;
	new Ajax.Updater('checkname', '/checkname', { method: 'get', parameters: {sub_name: name} });
	//alert('checking name: '+name)
}
*/
function check_current_email(lang){
	email = document.getElementById('id_user_email').value;
	update_comment('checkemail', '<img src="/images/public/ajax-loader.gif" alt="loader" />Checking email...')
new Ajax.Request('/'+lang+'/checkemail',
  {
    method:'get', parameters: {sub_email: email},
	onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      update_comment('checkemail', response)

    },
    onFailure: function(){ //alert('Something went wrong...') 
}
  });
}

function check_current_name(lang){
	name = document.getElementById('id_user_fullname').value;
	update_comment('checkname', '<img src="/images/public/ajax-loader.gif" alt="loader" />Checking name...')
new Ajax.Request('/'+lang+'/checkname',
  {
    method:'get', parameters: {sub_name: name},
	onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      update_comment('checkname', response)

    },
    onFailure: function(){ //alert('Something went wrong...') 
}
  });
}

function check_current_password(lang){
	check_current_email();
	password = document.getElementById('id_user_password').value;
	update_comment('checkpassword', '<img src="/images/public/ajax-loader.gif" alt="loader" />Checking password...')
new Ajax.Request('/'+lang+'/checkpassword',
  {
    method:'get', parameters: {sub_password: password},
	onSuccess: function(transport){
      var response = transport.responseText || "no response text";
      update_comment('checkpassword', response)

    },
    onFailure: function(){ //alert('Something went wrong...') 
}
  });
}

function update_comment(element, response){
	comment = document.getElementById(element);
	comment.innerHTML = response;
	//alert('updating comment');
}

//alert('hello');