
function view_display(objID,item_type) {
	
	//1. dealing with divs first
	//define the correct view_area div from the parameter
	var selectedDiv = document.getElementById(item_type + "_area_" + objID);
	
	//find all divs on the page
	var all_divs = document.getElementsByTagName("div")
	
	//loop through
	for(var i=0; i < all_divs.length; i++) {

		var kill_div = all_divs[i];
      	var div_class = kill_div.className;
		
		//find all divs that are of the required  class
		if (div_class.indexOf(item_type + '_area') !=-1) {	
			
			//reset class
			kill_div.className = item_type + "_area";

		}
	}
	//append selected class to new div
	selectedDiv.className = selectedDiv.className + " selected";
	
	
	//2. now dealing with anchors
	//define the correct view_tab anchor from the parameter
	var selectedAnchor = document.getElementById(item_type + "_link_" + objID);
	
	//find all anchors on the page
	var all_anchors = document.getElementsByTagName("a")
	
	//loop through
	for(var i=0; i < all_anchors.length; i++) {

		var kill_anchor = all_anchors[i];
      	var anchor_class = kill_anchor.className;
		
		//find all anchors that are of the required  class
		if (anchor_class.indexOf(item_type + '_link') !=-1) {	
		
			if (anchor_class.indexOf('first') !=-1) {
			
				//reset class
				kill_anchor.className = item_type + "_link first"; 
			} 
				else 
			{
		
			//reset class
			kill_anchor.className = item_type + "_link";
			}
		}
		
		
	}
	//append selected class to new anchor
	selectedAnchor.className = selectedAnchor.className + " selected";
	
	//now we quickly reset the slides and slide_links if we are changing tab area
	
	if (item_type == "view") {
		
	//find all anchors on the page
	var all_anchors = document.getElementsByTagName("a")
	
	//loop through
	for(var i=0; i < all_anchors.length; i++) {

		var kill_anchor = all_anchors[i];
      	var anchor_class = kill_anchor.className;
		
		//find all anchors that are of the required  class
		if (anchor_class.indexOf('slide_link') !=-1) {	
			
			
			if (anchor_class.indexOf('first') !=-1) {
			
				//reset class
				kill_anchor.className = "slide_link first"; 
			} 
				else 
			{
			
			
			//reset class
			kill_anchor.className = "slide_link";
			
			}

		}
		
	}
	
	//find all divs on the page
	var all_divs = document.getElementsByTagName("div")
	
	//loop through
	for(var i=0; i < all_divs.length; i++) {

		var kill_div = all_divs[i];
      	var div_class = kill_div.className;
		
		//find all divs that are of the required  class
		if (div_class.indexOf('slide_area') !=-1) {	
			
			//reset class
			kill_div.className = "slide_area";

		}
	}
	
}

}








