function confirmDeleteAction() {

 // end testing
 var okay= confirm('Are you sure you want to perform this DELETION.  No Undo!!!');
  if (okay != true) {
    return(false);
  }
}

function clearText(field){

    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;

}


$(document).ready(function() {

	jQuery.ajax( {
		type: "POST",
		url: "search.php?action=get",
		data: "",
		success: function(msg){
			//alert(msg);
			if (msg == "Show results") {
				jQuery('.hideThis').toggle("quick");
			} 
		}
	});


});


// this function takes care of the search toggle when the page is up
function removeTxt(id) {

	jQuery('.'+id).toggle("slow");
	var txt = $('.toggle').attr("value");
	if (txt == "Hide results") {
		var newLabel = "Show results";
	} else {
		var newLabel = "Hide results";
	}
	$('.toggle').attr("value", newLabel);
	storeToggle(newLabel);


}

// sets the toggle value in the session
function storeToggle(value) {
	
	jQuery.ajax( {
		type: "POST",
		url: "search.php?action=set&srchButton1=" +value,
		data: "",
		success: function(msg){
			if (msg == 1) {
				alert("Failure: " + msg);
			} 
		}

	});	
	
}

function bongo() { // test stuff

	jQuery.ajax( {
		type: "POST",
		url: "tab_notify.php",
		data: "",
		success: function(msg){
			document.title = msg + " " + baseName;
		}

	});

	jQuery.ajax( {

		type: "POST",
		url: "visitor_delete.php",
		data: "name=" + id + "&action=" + action + "&isDream=1",
		success: function(msg){
			if (msg == "failure") {
				alert("Der opstod en fejl. Sikre dig at du er logget ind på din profil. Prøv herefter igen.");
			} 
		}

	});



}


