
var current_id;
var current_plus;
var current_minus;

function flip_location(id, id_plus, id_minus) {

	if (document.getElementById(id).style.display == "block")
		hide_location(id, id_plus, id_minus);
	else {
		hide_location(current_id, current_plus, current_minus);
		show_location(id, id_plus, id_minus);
	}


}

function hide_location(id, id_plus, id_minus) {

	if (id == null)
		return;

	$('#' + id).hide("slow"); 
	document.getElementById(id_plus).style.display = "block";
	document.getElementById(id_minus).style.display = "none";
}

function show_location(id, id_plus, id_minus) {

	$('#' + id).show("slow"); 
	document.getElementById(id_plus).style.display = "none";
	document.getElementById(id_minus).style.display = "block";
	
	current_id = id;
	current_plus = id_plus;
	current_minus = id_minus;

}


 function locations_getElementsByClass(node,searchClass,tag) {  
     var classElements = new Array();  
	 if ( node == null )  
	     node = document;  
	 if ( tag == null )  
	     tag = '*';  
     var els = node.getElementsByTagName(tag); // use "*" for all elements  
     var elsLen = els.length;  
     var pattern = new RegExp("\\b"+searchClass+"\\b");  
     for (kk = 0, rr = 0; kk < elsLen; kk++) {  
	  if ( pattern.test(els[kk].className) ) {  
	  classElements[rr] = els[kk];  
	  rr++;  
	  }  
     }  
     return classElements;  
   }  

