// Set the email host for RoundCube
function email_set_host(){
	// Get the email host from the email address and set it.
	email_address = document.email_login._user.value;
	email_address_parts = email_address.split("@");
	email_host = email_address_parts[1];
	document.email_login._host.value = email_host;
	
	return(true);
}

// Strip any http:// for SQL Buddy
function database_set_host(){
	// Get the host.
	host = document.loginform.HOST.value;
	host = host.replace("http://www.","");
	host = host.replace("http://","");
	host = host.replace("www.","");
	document.loginform.HOST.value = host;
	
	return(true);
}



// Clear the field
function clear_field(id,default_value){
	if(document.getElementById(id).value == default_value){
		document.getElementById(id).value = "";
	}
}

// Disable the submit button
function disable_submit(){
	document.getElementById("submit_url").value = "Accessing please wait...";
	document.get_control_panel.submit_url.disabled = true;
}