function checkUser(x, submitbutton, column)
{
	if (!column) { var column = 'user'; }
var xmlHttp;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    try
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    catch (e)
      {
      alert("Your browser does not support AJAX!");
      return false;
      }
    }
  }
  xmlHttp.onreadystatechange=function()
    {
    if(xmlHttp.readyState==4)
      {
      document.getElementById(x).style.borderColor=xmlHttp.responseText;
	  if(xmlHttp.responseText=="red" || document.getElementById(x).value.length == 0) {
		//document.getElementById(submitbutton).disabled=true;
	  }
	  else if(xmlHttp.responseText=="green" && document.getElementById(x).value.length > 0) {
		//document.getElementById(submitbutton).disabled=false;
	  }
      }
    }
  var url="checkusers.php?q="+document.getElementById(x).value;
  url=url+"&column=";
  url=url+column;
  
  xmlHttp.open("GET",url,true);
  xmlHttp.send(null);
  }
  
function addBookmark(title,url) {
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) {
window.external.AddFavorite( url, title);
} else if( window.opera && window.print ) {
return true;
}
}


function hide(x) {
	document.getElementById(x).style.visibility='visible';
}

function setBlank(x, current) {
	if(document.getElementById(x).value==current) {
		document.getElementById(x).value='';
	}
}

function setFilled(x, filled) {
	if(document.getElementById(x).value=='') {
		document.getElementById(x).value=filled;
	}
}

function compare(x1, x2, submitbutton) {
	if(document.getElementById(x1).value==document.getElementById(x2).value && document.getElementById(x1).value.length > 0 && document.getElementById(x2).value.length > 0) { 
		document.getElementById(x1).style.borderColor='green';
		document.getElementById(x2).style.borderColor='green';
		//document.getElementById(submitbutton).disabled=false;
	}
	else {
		document.getElementById(x1).style.borderColor='red';
		document.getElementById(x2).style.borderColor='red';
		//document.getElementById(submitbutton).disabled=true;
	}
}

function write_admin_email() {
  var email = "admin";
  var emailHost = "mysitememberships.com";

  var output = "<a href=" + "mail" + "to:" + email + "@" + emailHost+ ">" + email + "@" + emailHost + "</a>";
  return output;

}

function confirmDelete(id, site) {
	var where_to = confirm("Do you really want to DELETE the site '"+site+"'?");
	if(where_to == true) {
		window.location = "myedit.php?delete="+id;
	}
}

function refC() {
	document.getElementById('ci').src = 'captcha/animatedcaptcha_generate.php?'+Math.random();
}