var url;


/*
 Example 1: confirm_action('block','User','Tom')
   action_name: block
   object_type: User
   object_name: Tom
 
 Example 2: confirm_action('delete','Category','Cars')
   action_name: delete
   object_type: Category
   object_name: Cars
*/
function confirm_action(action_name,object_type,object_name){
  if(action_name == "") action_name = "perform the selected operation on";
  action_object = "";
  if(object_type != ""){
    action_object = "the " + object_type;
    if(object_name != "") action_object = action_object + " ";
  }
  if(object_name != "") action_object = action_object + '"' + object_name + '"';
  if(action_object == "") action_object = "the current record";
  return confirm("Are you sure \nyou want to " + action_name + " " + action_object + "?");
}

function clickClear(thisfield, defaulttext) {
	if (thisfield.value == defaulttext) {
		thisfield.value = "";
	}
}

function clickRecall(thisfield, defaulttext) {
	if (thisfield.value == "") {
		thisfield.value = defaulttext;
	}
}

function LocationVisibility(Show,Hide,thediv,thearr){
  what = document.getElementById(thediv).style.display == 'none' ? 'block' : 'none' ;
  document.getElementById(thediv).style.display=what;
  if (what == 'none'){
	  document.getElementById('AdsLink').innerHTML = Show;
	  document.getElementById(thearr).src = url + 'images/arrow1.gif';
  }
  else{
    document.getElementById('AdsLink').innerHTML = Hide;
    document.getElementById(thearr).src = url + 'images/arrow2.gif';
  }
  return false;
}


