
/*	
	======================================================================
	
	javascript/projects.js

	======================================================================
	Copyright 2006 JAS Design Build
	======================================================================
*/


	/////////////////////////////////////////////////////////
	//
	//  global variables
	//
	/////////////////////////////////////////////////////////

 		currentCategory = '';
 		
 		currentViewByNamePage = 0;


	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  ToggleProjectCategory
	//
	/////////////////////////////////////////////////////////
	
		function ToggleProjectCategory (categoryID) {
		
			/* collapse current category, if one is selected */
			
			if (currentCategory) {
			
				CollapseProjectCategory (currentCategory);
			}
			
			/* if user clicked on current category to collapse it, no
			   category is currently selected */
			   
			if (categoryID == currentCategory) {
			
				currentCategory = '';
			}

			/* otherwise, expand new category */
			
			else {
			
				ExpandProjectCategory (categoryID);
			
				currentCategory = categoryID;
			}
		}
		

	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  CollapseProjectCategory
	//
	/////////////////////////////////////////////////////////
	
		function CollapseProjectCategory (categoryID) {
		
			projectDiv = "projectByTypeProjects_" + categoryID;
			
			categoryDiv = "projectByTypeCategory_" + categoryID;
			
			HideDiv (projectDiv);
			
			ChangeClass (categoryDiv, 'projectPageCategoryDim');
		}
 

	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  ExpandProjectCategory
	//
	/////////////////////////////////////////////////////////
	
		function ExpandProjectCategory (categoryID) {
		
			projectDiv = "projectByTypeProjects_" + categoryID;
			
			categoryDiv = "projectByTypeCategory_" + categoryID;
			
			ShowDiv (projectDiv);
			
			ChangeClass (categoryDiv, 'projectPageCategoryActive, whiteLink');
		}
 

	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  ViewByName
	//
	/////////////////////////////////////////////////////////
	
		function ViewByName (pageNum) {
		
			ShowDiv ('projectListByName');
			HideDiv ('projectListByType');
			
			ChangeClass ('pageTitle', 'projectsByName');
			
			HideDiv ('projectsByNamePage_' + currentViewByNamePage);
			ShowDiv ('projectsByNamePage_' + pageNum);
			
			currentViewByNamePage = pageNum;
		}


	/////////////////////////////////////////////////////////
	//
	//  FUNCTION:  ViewByType
	//
	/////////////////////////////////////////////////////////
	
		function ViewByType () {
		
			ShowDiv ('projectListByType');
			HideDiv ('projectListByName');

			ChangeClass ('pageTitle', 'projectsByType');
		}
		
