// This clears the textbox value if the default value is set
function focus_textbox(id, text_value) {
	if (id.value == text_value) id.value = '';	
}

// This resets the text box value if the value is blank
function blur_textbox(id, text_value) {
	if (id.value == '') id.value = text_value;
}

function focus_password(id) {
	if (id.value == 'password') {
		id.value = '';
		id.type = 'password';
	}	
}

function blur_password(id, text_value) {
	if (id.value == '') {
		id.value = text_value;
		id.type = 'text';
	}
}

function loader(return_id) {
	document.getElementById(return_id).innerHTML = "<img src='images/loader.gif' />";
}

function append_div(id){
	var div_tag = document.createElement("div");
	div_tag.id = "user_"+id;
	document.getElementById('csma_multiple').appendChild(div_tag);
	document.getElementById('csma_select').innerHTML = '';
	document.getElementById('csma_select').style.display = 'none';
	document.getElementById('csma_friend').value = '';
	get_data('classes/messaging/messaging_ajax.php?action=lookup&id='+id,'user_'+id);
} 

function remove_element(who) {
	 if(typeof who== 'string') who=document.getElementById(who);
	 if(who && who.parentNode)who.parentNode.removeChild(who);
}


function menu(menu_id){
	var element = document.getElementById(menu_id);
	if(element.style.display == 'none') element.style.display = 'block';
	else element.style.display = 'none';
	element.blur();
	return false;
}