var pageController = {
	// will store the url
	browserAddress : "",
	
	init: function(){
		// add url to browserAddress variable
		this.browserAddress = window.location.href;
		// and array with all the pages
		pages = ['/category/recent-work/', '/archive/', '/about/', '/category/news/', '/contact/' ];
		//loop through all the pages and see if we're on that page
		for(var i = 0; i < pages.length; i++){
			// sent the page string to another function
			this.seeIfItsActive(pages[i]);
		}
	},
	
	seeIfItsActive: function(stringToCompareToUrl){
		// if the url contains the page string
		if(this.browserAddress.indexOf(stringToCompareToUrl) != -1){
			
			// add active class to it
			$("#nav li a[href*='"+stringToCompareToUrl+"']").addClass('active');
				
			}
			
		}
	}
	
