var UIConfig = {
	sidebarwidth: 0.25,
	windowWidth : 0,
	windowHeight : 0,
	mapHeight : 0,
	
	map: null,
	posting_list_container : null,
	posting_images_container : null,
	image_bar_outer : null,
	tag_cloud_container : null,
	tag_shelf_container : null,
	category_container : null,
	
	image_bar_outer : null,
	image_bar_container : null,
	image_bar_left : null,
	image_bar_right : null,
	page_tab_panel : null,
	
	sidepanel_outer : null,
	sidepanel_inner : null,
	
	allow_image_markers : false,
	
	popupSpec : {
		width: 790,
		height: 450,
		shadowMode: 'border'
	},
	
	init : function(){
		if (typeof UIConfigExtend != 'undefined') Object.extend(UIConfig, UIConfigExtend);
		UIConfig.postinit();
	},
	
	resized : function(){
		UIConfig.windowWidth = window.getWidth();
		UIConfig.map = $('map');
		var top = UIConfig.map.getTop();
		UIConfig.windowHeight = window.getHeight() - top;
	},
	
	postinit : function(){
		UIConfig.resized();
		
		UIConfig.sidepanel_outer = $('side');
		UIConfig.sidepanel_inner = $('sidecontent');
		
		UIConfig.tag_cloud_container = $('tagcloud');
		UIConfig.tag_shelf_container = $('tagshelf');
		UIConfig.category_container = $('categories');
		UIConfig.posting_list_container = $('listing_area');
		UIConfig.posting_images_container = $('images-container');
		
		UIConfig.image_bar_outer = $('image-bar-outer');
		UIConfig.image_bar_container = $('image-bar');
		UIConfig.image_bar_left = $('image-bar-left');
		UIConfig.image_bar_right = $('image-bar-right');
		UIConfig.page_tab_panel = $('type-tabs');
	},
	
	getTabs : function(){
		var username = '';
		if (MS.user != null) username = MS.user.username;
		
		var tabs = [
			{title: 'all', tags: [], extags: [], allowAdd : true, requireLogin: false, uimode: UI.SIDEPANEL_MODE_CATS, resetcats: true, allow_image_markers: false},
			{title: 'expert', tags: [ "level:EXPERT:ADMIN"], extags: ["level:EXPERT:ADMIN"], allowAdd : false, requireLogin: false, uimode: UI.SIDEPANEL_MODE_CATS, resetcats: true, allow_image_markers: false},
			{title: 'mymap', tags: ["mymap:"+username], extags: ["mymap:"+username], allowAdd : true, requireLogin: true, uimode: UI.SIDEPANEL_MODE_CATS, allow_image_markers: false}
		];
		
		return tabs;
	},
	
	postTabSelected : function(){	
	},
	
	getAddItemTab : function(){
		return 2;
	}, 
	
	subcats : [
		['Art and architecture','Museum','Festival','Historic site','Religious','Children','Resorts and theme parks','Performance art'],
		['Landscape','Wildlife','Gardens'],
		['Sport','Adventure','Winter sports','Journey','Mind,body,spirit'],
		['Hotels', 'Bed and breakfast', 'Rentals'],
		['Restaurant', 'Cafe', 'Nightlife', 'Shopping'],
		['Airport','Rail station','Bus terminal','Ferry terminal'],
		['Personal', 'Rants', 'Note']
	],

	categories : [
		'Culture & Entertainment' ,
		'Nature',
		'Activity',
		'Accommodation',
		'Eat, drink, shop',
		'Transportation',
		'Miscellaneous'
	],
	
	tag_categories : [
		'culture_entertainment' ,
		'nature',
		'activity',
		'accomodation',
		'eat_drink_shop',
		'infrastructure',
		'miscellaneous'
	],
	
	tag_subcats : [
		['art__architecture','museum','festival','historic_site','religious','children','resort_theme_park','performance_art','ent_other'],
		['landscape','wildlife','gardens', 'nat_other'],
		['sport','adventure','winter_sports','journey','mind_body_spirit','act_other'],
		['hotel', 'b_and_b', 'rental', 'acc_other'],
		['restaurant', 'cafe', 'nightlife', 'shopping','eds_other'],
		['airport','rail_station','bus_station','ferry_terminal'],
		['personal', 'rant', 'note']
	],
	
	getPreloadImages : function(){
		if (MS.browser != BR_IE){
			var preload = [			'/images/markers/speech-tb-left2.png',
									'/images/markers/speech-tb-mid2.png', 
									'/images/markers/speech-tb-right2.png', 
									'/images/markers/speech-tb-left-g.png',
									'/images/markers/speech-tb-right-g.png', 
									'/images/markers/speech-tb-mid-g.png'];
		} else {
			var preload = [			'/images/markers/speech-tb-left2.gif',
									'/images/markers/speech-tb-mid2.gif', 
									'/images/markers/speech-tb-right2.gif', 
									'/images/markers/speech-tb-left-g.gif',
									'/images/markers/speech-tb-right-g.gif', 
									'/images/markers/speech-tb-mid-g.gif',
									'/images/markers/city.gif',
									'/images/markers/type/airport.gif',
									'/images/markers/type/food.gif',
									'/images/markers/type/misc.gif',
									'/images/markers/type/drink.gif',
									'/images/markers/type/bed.gif',
									'/images/markers/type/shop2.gif',
									'/images/markers/type/old2.gif',
									'/images/markers/type/tree.gif',
									'/images/markers/type/man.gif',
									'/images/markers/type/book.gif',
									'/images/markers/type/face.gif',
									'/images/markers/type/car.gif',
									'/images/tabs/gray_right.gif',
									'/images/tabs/gray_left.gif'];
		}	
		return preload;
	}
}
