function toggleDIV(DIVId){	
//////////////////////////////////////////////////////////////////////////////
//
//	Method:  		ToggleDIV(DIVId) 
//	
//	Arguments:		DIVId - DIV id
//
//	Returns:  		none
//						
//	Description:  	A function that toggles the display attribute of the DIV.
//					(Shows the DIV if it is currently hidden and hides the div
//					 if currently showing)
// 	Modifications	
//	2006.06.21		Anthony
//					-created
//////////////////////////////////////////////////////////////////////////////	

   var _div_element; 	   

	/*check the element exists and can be accessed*/
   if(document.getElementById && document.getElementById(DIVId)){   
   
	  /*get hold of the element*/
	  _div_element = document.getElementById(DIVId);  
	   
	  // if the DIV is hidden the show it 
	  if(_div_element.style.display!="none"){   
		   _div_element.style.display="none";       
	   }else{
		  // hide the div 
		   _div_element.style.display="block";     
	   }
		  
	}
}

function showDIV(DIVId){		
//////////////////////////////////////////////////////////////////////////////
//
//	Method:  		showDIV(DIVId) 
//	
//	Arguments:		DIVId - DIV id
//
//	Returns:  		none
//						
//	Description:  	A function that shows a DIV based on the 
//					passed in DIV id
//
// 	Modifications	
//	2006.06.21		Anthony
//					-created
//////////////////////////////////////////////////////////////////////////////	
	var  _div_element; 

	/*check the element exists and can be accessed*/
	if(document.getElementById && document.getElementById(DIVId)){   
	   /*get hold of the element*/
	   _div_element = document.getElementById(DIVId);   		   
	   
	   //show the div
	   _div_element.style.display="block";       
		  
	}		
}

function hideDIV(DIVId){		
//////////////////////////////////////////////////////////////////////////////
//
//	Method:  		hideDIV(DIVId) 
//	
//	Arguments:		DIVId - DIV id
//
//	Returns:  		none
//						
//	Description:  	A function that hides a DIV based on the
//					passed in DIV id
//
// 	Modifications	
//	2006.06.21		Anthony
//					-created
//////////////////////////////////////////////////////////////////////////////	
		
	var  _div_element; 

	/*check the element exists and can be accessed*/
	if(document.getElementById && document.getElementById(DIVId)){   
	   /*get hold of the element*/
	   _div_element = document.getElementById(DIVId);   		   
	   
	   //hide div
	   _div_element.style.display="none";       
		  
	}		
}


function showDIVs(asDIVId, arrRegDIVIds){		
//////////////////////////////////////////////////////////////////////////////
//
//	Method:  		showDIVs(asDIVId, arrRegisteredDIVIds) 
//	
//	Arguments:		asDIVId - a single DIV id to make visible
//					arrRegDIVIds - array of Registerd DIV ids 
//
//	Returns:  		none
//						
//	Description:  	A function that will loop through the passed in 
//					registered array of DIV ids and if it is the passed
//					in single DIV id(1st function argyument) then the 
//					DIV will be made visible else the DIV will be 
//					made invisible.

// 	Modifications	
//	2006.06.21		Anthony
//					-created
//
// 	Examples of argument values passed in: 	
//		asDIVId = 'header';
//		arrRegDIVIds = ['','header', 'footer','bodyblock','outer','workspace','detail'];		
//
//  Below is an example of the declaration and assignment of DIV Ids to 
//  a global JS variable on the JSP/html page called arrRegisteredDIVIds
//  that will be passed into the showDIVs function://
//	var arrRegisteredDIVIds = ['','header', 'footer','bodyblock','outer','workspace','detail'];		
//  
//	Example calling this function with the javascript arrRegisteredDIVIds variable:
//	showDIVs ('header', arrRegisteredDIVIds); //example of calling this function

//////////////////////////////////////////////////////////////////////////////		

	var  _div_element; 
	var  _divId;

	if (arrRegDIVIds ==null )   {
		alert('arrRegisteredDIVIds is declared but no DIVs were assigned to the array.');
		
	}else{	
		
		// loop through the show DIV ids array 
		for (var i = 0; i < arrRegDIVIds.length; i++) { 
		
			_divId =arrRegDIVIds[i];
				 
//			alert('LOOP '+ asDIVId + '=' + _divId);					
		
				/*check the element exists and can be accessed*/
		   if(document.getElementById && document.getElementById(_divId)){   
			
			  /*get hold of the element*/
			   _div_element = document.getElementById(_divId);  		
			
			   //check if this the DIV you want to show
			   if(asDIVId == _divId){     			
				   //SHOW the div
				   _div_element.style.display="block";      					  
				}else{				
				   //HIDE the div
				   _div_element.style.display="none";      					  
				}
			}		
		}	
	}		

}