// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see .
wn.provide('erpnext.navbar');
/*
\
	\
	\
\
*/
erpnext.navbar.navbar = Class.extend({
	init: function() {
		this.make();
		$('.brand').html(wn.boot.website_settings.brand_html);
		this.make_items();
		$('.dropdown-toggle').dropdown();
	},
	make: function() {
		$('header').append('');
		$('.brand').attr('href', '#!' + (wn.boot.website_settings.home_page || 'Login Page'))
	},
	make_items: function() {
		var items = wn.boot.website_menus;
		
		// parent labels
		for(var i=0;i\
					%(label)s', item))
			}
		}
		
		// child labels
		for(var i=0;i')
						.click(function() {
							return false;
						});
					$parent_li.append('');
				}
				item.route = item.url || item.custom_page;
				$parent_li.find('.dropdown-menu').append(repl('\
					%(label)s', item))
			}
		}
	}
});
// footer
erpnext.Footer = Class.extend({
	init: function() {
		$('footer').html(repl('', wn.boot.website_settings));
		this.make_items();
	},
	make_items: function() {
		var items = wn.boot.website_menus
		for(var i=0;i%(label)s', item))
			}
		}
	}
});
$(document).bind('startup', function() {
	erpnext.footer = new erpnext.Footer();
	erpnext.navbar.navbar = new erpnext.navbar.navbar();	
})