// Admin class
function Admin() {
	/* Default sectino colors */
	this.EXCHANGE_SECTION_CLR = "#28610A";
	this.TRAVEL_SECTION_CLR = "#F28F1D";
	this.RENTALS_SECTION_CLR = "#0D8690";
	this.MANAGEMENT_SECTION_CLR = "#1F95DE";
	this.ABOUTUS_SECTION_CLR = "#1E589A";
	this.MYTPI_SECTION_CLR = "#F39121";
	this.OTHER_SECTION_CLR = "#685490";
	
	// testIE7() - returns true if client browser is IE7
	this.testIE7 = function(){
		var isIE7 = false;
		
		if (document.createElement &&
			document.getElementsByTagName && document.getElementById) {
			var el = document.createElement("script"), head = document.getElementsByTagName("head")[0];
			if (el && head && head.appendChild && head.removeChild) {
				el.type = "text/javascript";
				el.id = "A";
				head.appendChild(el);
				var buggy = !!document.getElementById("a");
				head.removeChild(el);
				el = null;
				isIE7 = buggy;
			}
		}
		
		return isIE7;
	};
	
	// setupLoginPop() - sets click and mouse events for the login menu pop up
	this.setupLoginPop = function() {
		// login link click event
		if ($('.login_link').length > 0) {
			$('.login_link').click(function(e) {
				// prevent document mouseup event
				e.preventDefault();

				if ($(this).hasClass('login_link_hover')) { $(this).removeClass('login_link_hover'); }
				else { $(this).addClass('login_link_hover'); }

				$('#login_menu').toggle();
			});

			// if user clicks on login div, don't disappear
			$('#login_menu').mouseup(function() { return false; });

			/* hide all pop up menus if visible */
			$(document).mouseup(function(e) {
				if ($(e.target).parent('a.login_link').length == 0) {
					$('.pop_menu').hide();
					$('.login_link').removeClass('login_link_hover');
				}
			});
		}
	};
}
