function loadpage(url, div) {
	new Ajax.Request(url, {
	  method: 'post',
		onLoading: function() {
			$(div).innerHTML="<center><img src='images/loader.gif'/></center>";	
		},	  
	  onSuccess: function(transport) {
		$(div).style.display = '';
		$(div).innerHTML = transport.responseText;
	  }
	});
}

function loadform(url, div, form) {
	var pars = $(form).serialize();
	var myAjax = new Ajax.Request(url, 
	{
		method: 'post',
		parameters: pars,
		onLoading: function() {
			$(div).innerHTML="<center><img src='images/loader.gif'/></center>";	
		},
		onSuccess: function(request) {
			var response = request.responseText;
			$(div).innerHTML=response;
		}
	});
}


function clickclear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
		thisfield.style.color = "#000000"
	}
}

function clickrecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
		thisfield.style.color = "#CCC"
	}
}

function cleardiv(div) {
	$(div).style.display = "none";
}

function showdiv(div) {
	$(div).style.display = "";	
}


function appendURL(domain) {
new_url = window.location.href + "?domain=" + domain;
window.location = new_url;
}