var Navigation = function() {
	this.setup = function(nav) {
		if (Ti.Platform.osname === 'android') {
			var android = nav.android;
			var activitiy = Ti.Android.currentActivity;
			if (activitiy) {
				activitiy.onCreateOptionsMenu = function(e) {
					var menu = e.menu;
					if (android.leftButton) {
						var leftMenuItem = menu.add(android.leftButton);
						leftMenuItem.setIcon(android.leftButton.icon);
						leftMenuItem.addEventListener('click', android.leftButton.callback);
					}
					if (android.rightButton) {
						var rightMenuItem = menu.add(android.rightButton);
						rightMenuItem.setIcon(android.rightButton.icon);
						rightMenuItem.addEventListener('click', android.rightButton.callback);
					}
				};
			}
			
		}
		else {
			var win = Ti.UI.currentWindow;
			var iPhone = nav.iPhone;
			if (iPhone.leftButton) {
				var leftButton = Ti.UI.createButton(iPhone.leftButton);
				leftButton.addEventListener('click', iPhone.leftButton.callback);
				win.leftNavButton = leftButton;
			}
			if (iPhone.rightButton) {
				var rightButton = Ti.UI.createButton(iPhone.rightButton);
				rightButton.addEventListener('click', iPhone.rightButton.callback);
				win.rightNavButton = rightButton;				
			}
		}
	};
};
