Merge branch 'master' of github.com:webnotes/erpnext into handlerupdate
diff --git a/build.json b/build.json
index 499d594..67dcfba 100644
--- a/build.json
+++ b/build.json
@@ -3,14 +3,15 @@
 		"lib/js/core.min.js": [
 			"lib/js/wn/class.js",
 			"lib/js/wn/provide.js",
-			"lib/js/wn/xmlhttp.js",
 			"lib/js/wn/versions.js",
 			"lib/js/wn/assets.js",
 			"lib/js/wn/require.js",
 			"lib/js/wn/dom.js",
+			"lib/js/wn/model.js",
 			"lib/js/wn/page.js",
 			"lib/js/wn/misc/user.js",
 			"lib/js/lib/json2.js",
+			"lib/js/wn/request.js",
 			"lib/js/core.js"
 		]
 	},
@@ -57,10 +58,11 @@
 			"lib/css/legacy/grid.css",
 			"lib/css/legacy/listing.css",
 			"lib/css/legacy/report.css",
-			"lib/css/legacy/autosuggest.css",
 			"lib/css/legacy/dialog.css",
 			"lib/css/legacy/tabs.css",
 			"lib/css/legacy/sidebar.css",
+			"lib/css/Aristo/aristo.selected.css",
+			"lib/css/ui/list.css",
 			"lib/css/bootstrap/headings.css",
 			"lib/css/bootstrap/buttons.css",
 			"lib/css/bootstrap/navbar.css",
@@ -91,11 +93,9 @@
 			"lib/js/wn/ui/listing.js",
 			"lib/js/legacy/widgets/layout.js",
 			"lib/js/legacy/webpage/page_header.js",
-			"lib/js/legacy/widgets/select.js",
 			"lib/js/legacy/webpage/history.js",
 			"lib/js/legacy/webpage/search.js",
 			"lib/js/legacy/webpage/spinner.js",
-			"lib/js/legacy/webpage/freeze_page.js",
 			"lib/js/legacy/webpage/error_console.js",
 			"lib/js/legacy/webpage/loaders.js",
 			"lib/js/legacy/webpage/uploader.js",
@@ -115,8 +115,10 @@
 	{
 		"js/all-app.js": [
 			"lib/js/lib/history/history.min.js:concat",
-			"lib/js/legacy/jquery/jquery-ui.min.js:concat",
-			"lib/js/legacy/tiny_mce_33/jquery.tinymce.js:concat",
+			"lib/js/lib/jquery/jquery.ui.core.js:concat",
+			"lib/js/lib/jquery/jquery.ui.datepicker.js:concat",
+			"lib/js/lib/jquery/jquery.ui.autocomplete.js:concat",
+			"lib/js/lib/tiny_mce_33/jquery.tinymce.js:concat",
 			"lib/js/lib/bootstrap.min.js:concat",
 			"lib/js/lib/sprintf.js",
 			"lib/js/core.min.js:concat",
@@ -132,17 +134,14 @@
 			"lib/js/wn/ui/dialog.js",
 			"lib/js/legacy/widgets/dialog.js",
 			"lib/js/legacy/widgets/listing.js",
-			"lib/js/wn/ui/listing.js",
 			"lib/js/legacy/widgets/layout.js",
 			"lib/js/legacy/widgets/tabbedpage.js",
 			"lib/js/legacy/webpage/page_header.js",
-			"lib/js/legacy/widgets/select.js",
 			"lib/js/legacy/widgets/tags.js",
 			"lib/js/legacy/widgets/export_query.js",
 			"lib/js/legacy/webpage/history.js",
 			"lib/js/legacy/webpage/search.js",
 			"lib/js/legacy/webpage/spinner.js",
-			"lib/js/legacy/webpage/freeze_page.js",
 			"lib/js/legacy/webpage/error_console.js",
 			"lib/js/legacy/webpage/loaders.js",
 			"lib/js/legacy/webpage/uploader.js",
diff --git a/css/all-app.css b/css/all-app.css
index 0dea8b7..496f93a 100644
--- a/css/all-app.css
+++ b/css/all-app.css
@@ -1,7 +1,8 @@
 
 /*
  *	lib/css/legacy/body.css
- */html { 
+ */
+html { 
 	margin: 0px;
 	padding: 0px;
 }
@@ -25,12 +26,15 @@
 }
 
 select, input, textarea { 
-	border: 1px solid #AAA; 
+	border: 1px solid #ccc; 
 	-moz-border-radius: 4px;
 	-webkit-border-radius: 4px;
 	font-size: 13px;
 	padding: 4px;
-	color: #222;
+	color: #444;
+	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 textarea { 
@@ -243,6 +247,7 @@
 /*
  *	lib/css/legacy/messages.css
  */
+
 /* FLOATING MESSAGE */
 
 .btn-img { cursor: pointer; }
@@ -291,9 +296,29 @@
 	text-align: center;
 	font-size: 14px;
 }
+
 /*
  *	lib/css/legacy/forms.css
- *//* FORMS */
+ */
+/* FORMS */
+
+div.form-section-head {
+	margin: 11px 0px 3px 0px;
+	border-top: 1px solid #ccc;
+	padding-top: 11px;
+}
+
+div.form-layout-row:first-child .form-section-head {
+	border-top: 0px solid #ccc !important;	
+}
+
+div.form-section-head h3 {
+	line-height: 20px;
+}
+
+div.form-section-head hr {
+	margin: 9px 0px;
+}
 
 
 div.frm_print_wrapper {
@@ -438,9 +463,13 @@
 
 
 .field_description, .help {
-	margin: 3px 0px 11px 0px;
+	margin: 3px 0px;
+	font-size: 11px;
 	color: #888;
-	font-style: italic;
+}
+
+.help ol {
+	padding-left: 19px;
 }
 
 .field_description_top {
@@ -514,10 +543,12 @@
 	font-size: 10px;
 	color: #777;
 }
+
 /*
  *	lib/css/legacy/grid.css
  */
 
+
 /* Grid */
 
 
@@ -638,9 +669,11 @@
 }
 
 .gridDivSelected option { border: 0px; }
+
 /*
  *	lib/css/legacy/listing.css
- *//* listing 2.0 */
+ */
+/* listing 2.0 */
 
 div.listing-more {
 	margin: 7px 0px 17px 0px;
@@ -695,11 +728,50 @@
 }
 
 
+/* stats */
+
+div.stat-grid {
+	border: 2px solid #bbb;
+	background-color: white;
+	margin-bottom: 19px;
+	border-radius: 5px;
+	-moz-border-radius: 5px;
+	-webkit-border-radius: 5px;
+	overflow: hidden;
+}
+
+div.stat-label {
+	position: relative;
+	padding: 3px;
+	text-align: center;
+}
+div.stat-label, div.stat-label a {
+	z-index: 5;
+}
+
+div.stat-item {
+	position: relative;
+	border-bottom: 1px solid #ddd;
+}
+div.stat-item:last-child {
+	border-bottom: 0px solid #ddd;	
+}
+
+div.stat-bar {
+	position: absolute;
+	left: 0px;
+	background-color: #def;
+	height: 100%;
+	z-index: 0;
+}
+
+
 
 
 /*
  *	lib/css/legacy/report.css
  */
+
 /* Reports */
 
 div.report_grid_area {
@@ -878,103 +950,11 @@
 	width: 33%;
 	padding: 2px;
 }
-/*
- *	lib/css/legacy/autosuggest.css
- *//* 
-================================================
-autosuggest, inquisitor style
-================================================
-*/
-
-div.autosuggest
-{
-	position: absolute; 
-	margin-top: 3px; 
-	border: 1px solid #222;
-}
-
-div.autosuggest ul
-{
-	list-style: none;
-	margin: 0px;
-	padding: 2px;
-	overflow: hidden;
-	background-color: #FFF;
-}
-
-div.autosuggest ul li
-{
-	color: #444;
-	padding: 0;
-	margin: 0;
-	text-align: left;
-}
-
-div.autosuggest ul li a
-{
-	color: #444;
-	display: block;
-	text-decoration: none;
-	position: relative;
-	padding: 0;
-	width: 100%;
-}
-div.autosuggest ul li a:hover
-{
-
-}
-div.autosuggest ul li.as_highlight a:hover
-{
-	background-color: #45A;
-	color: #FFF;
-}
-
-div.autosuggest ul li a span
-{
-	display: block;
-	padding: 3px 6px;
-	color: #444;
-	border-bottom:1px solid #DDD;
-}
-
-div.autosuggest ul li a span small
-{
-	display: block;
-	font-weight: normal;
-	color: #444;
-}
-
-div.autosuggest ul li.as_highlight a span small
-{
-	color: #FFF;
-}
-
-div.autosuggest ul li.as_highlight a span {
-	color: #FFF;	
-}
-
-div.autosuggest ul li.as_highlight a
-{
-	color: #FFF;
-	background-color: #45A;
-	cursor: pointer;
-}
-
-div.autosuggest ul li.as_warning
-{
-	font-weight: bold;
-	text-align: center;
-}
-
-div.autosuggest ul em
-{
-	font-style: normal;
-	font-weight: bold;
-}
 
 /*
  *	lib/css/legacy/dialog.css
- *//***** Dialogs *******/
+ */
+/***** Dialogs *******/
 
 div.dialog_wrapper {
 	position: absolute;
@@ -1052,9 +1032,11 @@
 	font-size: 12px;
 }
 
+
 /*
  *	lib/css/legacy/tabs.css
  */
+
 /******* TABS ********/
 
 div.box_label_wrapper {
@@ -1108,9 +1090,11 @@
 ul.box_tabs li.box_tab_selected a {
 	color: #fff;
 }
+
 /*
  *	lib/css/legacy/sidebar.css
- */div.psidebar {
+ */
+div.psidebar {
 }
 
 div.psidebar div.head {
@@ -1143,9 +1127,577 @@
 	font-size: 11px;
 	color: #666;
 }
+
+/*
+ *	lib/css/Aristo/aristo.selected.css
+ */
+/*
+ * jQuery UI CSS Framework 1.8.7
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
+.ui-helper-clearfix { display: inline-block; }
+/* required comment for clearfix to work in Opera \*/
+* html .ui-helper-clearfix { height:1%; }
+.ui-helper-clearfix { display:block; }
+/* end clearfix */
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+
+/*
+ * jQuery UI CSS Framework 1.8.7
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ctl=themeroller
+ */
+
+
+/* Component containers
+----------------------------------*/
+.ui-widget { font-family: Arial,sans-serif; font-size: 1.1em; }
+.ui-widget .ui-widget { font-size: 1em; }
+.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial,sans-serif; font-size: 1em; }
+.ui-widget-content { border: 1px solid #B6B6B6; background: #ffffff; color: #4F4F4F; }
+.ui-widget-content a { color: #4F4F4F; }
+.ui-widget-header { border: 1px solid #B6B6B6; color: #4F4F4F; font-weight: bold; }
+.ui-widget-header {
+	background: #ededed url(../lib/css/Aristo/images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
+		background: -moz-linear-gradient(top, #ededed 0%, #c4c4c4 100%); /* FF3.6+ */
+		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(100%,#c4c4c4)); /* Chrome,Safari4+ */
+		background: -webkit-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Chrome10+,Safari5.1+ */
+		background: -o-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Opera11.10+ */
+		background: -ms-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* IE10+ */
+		background: linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* W3C */
+}
+.ui-widget-header a { color: #4F4F4F; }
+
+/* Interaction states
+----------------------------------*/
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B6B6B6; font-weight: normal; color: #4F4F4F; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { 
+	background: #ededed url(../lib/css/Aristo/images/bg_fallback.png) 0 0 repeat-x; /* Old browsers */
+		background: -moz-linear-gradient(top, #ededed 0%, #c4c4c4 100%); /* FF3.6+ */
+		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ededed), color-stop(100%,#c4c4c4)); /* Chrome,Safari4+ */
+		background: -webkit-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Chrome10+,Safari5.1+ */
+		background: -o-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* Opera11.10+ */
+		background: -ms-linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* IE10+ */
+		background: linear-gradient(top, #ededed 0%,#c4c4c4 100%); /* W3C */
+	-webkit-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
+	-moz-box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
+	box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
+}
+.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #4F4F4F; text-decoration: none; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #9D9D9D; font-weight: normal; color: #313131; }
+.ui-state-hover a, .ui-state-hover a:hover { color: #313131; text-decoration: none; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { 
+	outline: none;
+	color: #1c4257; border: 1px solid #7096ab;
+	background: #ededed url(../lib/css/Aristo/images/bg_fallback.png) 0 -50px repeat-x; /* Old browsers */
+		background: -moz-linear-gradient(top, #b9e0f5 0%, #92bdd6 100%); /* FF3.6+ */
+		background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b9e0f5), color-stop(100%,#92bdd6)); /* Chrome,Safari4+ */
+		background: -webkit-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Chrome10+,Safari5.1+ */
+		background: -o-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* Opera11.10+ */
+		background: -ms-linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* IE10+ */
+		background: linear-gradient(top, #b9e0f5 0%,#92bdd6 100%); /* W3C */
+	-webkit-box-shadow: none;
+	-moz-box-shadow: none;
+	box-shadow: none;
+}
+.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #313131; text-decoration: none; }
+.ui-widget :active { outline: none; }
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  { border: 1px solid #d2dbf4; background: #f4f8fd; color: #0d2054; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
+.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error { border: 1px solid #e2d0d0; background: #fcf0f0; color: #280b0b; -moz-border-radius: 0 !important; -webkit-border-radius: 0 !important; border-radius: 0 !important; }
+.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
+.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
+.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(../lib/css/Aristo/images/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(../lib/css/Aristo/images/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(../lib/css/Aristo/images/ui-icons_222222_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(../lib/css/Aristo/images/ui-icons_454545_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(../lib/css/Aristo/images/ui-icons_454545_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(../lib/css/Aristo/images/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(../lib/css/Aristo/images/ui-icons_454545_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon { background: url(../lib/css/Aristo/images/icon_sprite.png) -16px 0 no-repeat !important; }
+.ui-state-highlight .ui-icon, .ui-state-error .ui-icon { margin-top: -1px; }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background: url(../lib/css/Aristo/images/icon_sprite.png) 0 0 no-repeat !important; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-tl { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; }
+.ui-corner-tr { -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
+.ui-corner-bl { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
+.ui-corner-br { -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
+.ui-corner-top { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; }
+.ui-corner-bottom { -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
+.ui-corner-right {  -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 3px; border-top-right-radius: 3px; -moz-border-radius-bottomright: 3px; -webkit-border-bottom-right-radius: 3px; border-bottom-right-radius: 3px; }
+.ui-corner-left { -moz-border-radius-topleft: 3px; -webkit-border-top-left-radius: 3px; border-top-left-radius: 3px; -moz-border-radius-bottomleft: 3px; -webkit-border-bottom-left-radius: 3px; border-bottom-left-radius: 3px; }
+.ui-corner-all { -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; }
+
+/* Overlays */
+.ui-widget-overlay { background: #262b33; opacity: .70;filter:Alpha(Opacity=70); }
+.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #000000; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
+
+/*
+ * jQuery UI Autocomplete 1.8.7
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete {
+	position: absolute; cursor: default; z-index: 3;
+		-moz-border-radius: 0; 
+		-webkit-border-radius: 0;
+		border-radius: 0;
+			-moz-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
+			-webkit-box-shadow: 0 1px 5px rgba(0,0,0,0.3);
+			box-shadow: 0 1px 5px rgba(0,0,0,0.3);
+}	
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.7
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+	list-style:none;
+	padding: 2px;
+	margin: 0;
+	display:block;
+	float: left;
+}
+.ui-menu .ui-menu {
+	margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+	margin:0;
+	padding: 0;
+	zoom: 1;
+	float: left;
+	clear: left;
+	width: 100%;
+}
+.ui-menu .ui-menu-item a {
+	text-decoration:none;
+	display:block;
+	padding:.2em .4em;
+	line-height:1.5;
+	zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+	font-weight: normal;
+	margin: -1px;
+	background: #5f83b9;
+	color: #FFFFFF;
+	text-shadow: 0px 1px 1px #234386;
+	border-color: #466086;
+		-moz-border-radius: 0; 
+		-webkit-border-radius: 0;
+		border-radius: 0;
+}
+
+/*
+ * jQuery UI Datepicker 1.8.7
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: 0; display: none; border-color: #DDDDDD; }
+.ui-datepicker {
+	-moz-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
+	-webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.5);
+	box-shadow: 0 4px 8px rgba(0,0,0,0.5);
+}
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.35em 0; border: none; border-bottom: 1px solid #B6B6B6; -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 6px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { border: 1px none; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev span { background-position: 0px -32px !important; }
+.ui-datepicker .ui-datepicker-next span { background-position: -16px -32px !important; }
+.ui-datepicker .ui-datepicker-prev-hover span { background-position: 0px -48px !important; }
+.ui-datepicker .ui-datepicker-next-hover span { background-position: -16px -48px !important; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; background: url(../lib/css/Aristo/images/icon_sprite.png) no-repeat; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; font-size: 12px; text-shadow: 0 1px 0 rgba(255,255,255,0.6); }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
+.ui-datepicker select.ui-datepicker-month, 
+.ui-datepicker select.ui-datepicker-year { width: 49%;}
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
+.ui-datepicker td { border: 0; padding: 1px; }
+.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
+.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+.ui-datepicker table .ui-state-highlight { border-color: #5F83B9; }
+.ui-datepicker table .ui-state-hover { background: #5F83B9; color: #FFF; font-weight: bold; text-shadow: 0 1px 1px #234386; -webkit-box-shadow: 0 0px 0 rgba(255,255,255,0.6) inset; -moz-box-shadow: 0 0px 0 rgba(255,255,255,0.6) inset; box-shadow: 0 0px 0 rgba(255,255,255,0.6) inset; border-color: #5F83B9; }
+.ui-datepicker-calendar .ui-state-default { background: transparent; border-color: #FFF; }
+.ui-datepicker-calendar .ui-state-active { background: #5F83B9; border-color: #5F83B9; color: #FFF; font-weight: bold; text-shadow: 0 1px 1px #234386; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
+.ui-datepicker-cover {
+    display: none; /*sorry for IE5*/
+    display/**/: block; /*sorry for IE5*/
+    position: absolute; /*must have*/
+    z-index: -1; /*must have*/
+    filter: mask(); /*must have*/
+    top: -4px; /*must have*/
+    left: -4px; /*must have*/
+    width: 200px; /*must have*/
+    height: 200px; /*must have*/
+}
+
+
+
+/*
+ *	lib/css/ui/list.css
+ */
+.hide {
+	display: none;
+}
+
+.list-filters {
+	margin: 7px 0px;
+}
+
+.wnlist .img-load {
+	display: none;
+	float: left;
+	margin-left: 11px;
+	margin-top: 8px;
+}
+
+div.list-row {
+	border-bottom: 1px solid #eee;
+	padding: 3px 0px;
+}
+div.list-row:hover {
+	background-color: #eef
+}
+
+div.paging-button {
+	text-align: center;
+	padding: 11px 0px;
+}
+
+div.show_filters {
+	display: none;
+}
+
+div.filter_list {
+	padding: 13px;
+}
+
+div.show_filters.well {
+	margin-top: 11px;
+	margin-bottom: 11px;
+}
+
+div.filter_list .run_btn {
+	text-align: right;
+}
+
+div.filter_list .add_filter {
+	margin: 3px 0px;
+}
+
+div.list_filter {
+	margin: 7px 0px;
+}
+
+div.list_filter input, div.list_filter select {
+	width: 130px;
+	margin-right: 7px;
+}
+
+span.bar-outer {
+	display: inline-block;
+	margin: 0px 7px;
+	margin-top: 3px;
+	background-color: #fff;
+	border: 1px solid #aaa;
+	height: 10px;
+}
+
+span.bar-inner {
+	display: inline-block;
+	background-color: #bdf;
+	height: 100%;
+	margin-bottom: 2px;
+}
+span.bar-complete {
+	background-color: green;
+}
+
+
 /*
  *	lib/css/bootstrap/headings.css
- *//* heading from bootstrap */
+ */
+/* heading from bootstrap */
 
 h1,
 h2,
@@ -1206,9 +1758,11 @@
   color: #999999;
   text-transform: uppercase;
 }
+
 /*
  *	lib/css/bootstrap/buttons.css
- */.close {
+ */
+.close {
   float: right;
   font-size: 20px;
   font-weight: bold;
@@ -1591,9 +2145,11 @@
 .btn-small .caret {
   margin-top: 4px;
 }
+
 /*
  *	lib/css/bootstrap/navbar.css
- */.nav {
+ */
+.nav {
   margin-left: 0;
   margin-bottom: 18px;
   list-style: none;
@@ -2059,9 +2615,11 @@
 	padding: 0px 20px;
 }
 
+
 /*
  *	lib/css/bootstrap/dropdown.css
- */.dropdown {
+ */
+.dropdown {
   position: relative;
 }
 .dropdown-toggle {
@@ -2161,9 +2719,11 @@
 .dropdown.open .dropdown-menu {
   display: block;
 }
+
 /*
  *	lib/css/bootstrap/tooltip.css
- */.tooltip {
+ */
+.tooltip {
   position: absolute;
   z-index: 1020;
   display: block;
@@ -2329,9 +2889,11 @@
 .popover-content p, .popover-content ul, .popover-content ol {
   margin-bottom: 0;
 }
+
 /*
  *	lib/css/bootstrap/label.css
- */.label {
+ */
+.label {
   padding: 2px 4px 3px;
   font-size: 11.049999999999999px;
   font-weight: bold;
@@ -2370,9 +2932,11 @@
 .label-info:hover {
   background-color: #2d6987;
 }
+
 /*
  *	lib/css/bootstrap/icons.css
- */[class^="icon-"], [class*=" icon-"] {
+ */
+[class^="icon-"], [class*=" icon-"] {
   display: inline-block;
   width: 14px;
   height: 14px;
@@ -2749,9 +3313,11 @@
 .icon-resize-horizontal {
   background-position: -456px -118px;
 }
+
 /*
  *	erpnext/startup/startup.css
- */h1, h2, h3, h4, h5 {
+ */
+h1, h2, h3, h4, h5 {
 	font-family: Tahoma, Arial, Verdana, sans-serif;
 	font-weight: bold;
 }
@@ -2835,3 +3401,4 @@
 	min-width: 160px !important;
 	max-width: 260px !important;
 }
+
diff --git a/css/all-web.css b/css/all-web.css
index 36d9cda..5843385 100644
--- a/css/all-web.css
+++ b/css/all-web.css
@@ -1,7 +1,8 @@
 
 /*
  *	lib/css/legacy/body.css
- */html { 
+ */
+html { 
 	margin: 0px;
 	padding: 0px;
 }
@@ -25,12 +26,15 @@
 }
 
 select, input, textarea { 
-	border: 1px solid #AAA; 
+	border: 1px solid #ccc; 
 	-moz-border-radius: 4px;
 	-webkit-border-radius: 4px;
 	font-size: 13px;
 	padding: 4px;
-	color: #222;
+	color: #444;
+	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
+	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 }
 
 textarea { 
@@ -243,6 +247,7 @@
 /*
  *	lib/css/legacy/messages.css
  */
+
 /* FLOATING MESSAGE */
 
 .btn-img { cursor: pointer; }
@@ -291,9 +296,11 @@
 	text-align: center;
 	font-size: 14px;
 }
+
 /*
  *	lib/css/legacy/dialog.css
- *//***** Dialogs *******/
+ */
+/***** Dialogs *******/
 
 div.dialog_wrapper {
 	position: absolute;
@@ -371,9 +378,11 @@
 	font-size: 12px;
 }
 
+
 /*
  *	lib/css/bootstrap/headings.css
- *//* heading from bootstrap */
+ */
+/* heading from bootstrap */
 
 h1,
 h2,
@@ -434,9 +443,11 @@
   color: #999999;
   text-transform: uppercase;
 }
+
 /*
  *	lib/css/bootstrap/buttons.css
- */.close {
+ */
+.close {
   float: right;
   font-size: 20px;
   font-weight: bold;
@@ -819,9 +830,11 @@
 .btn-small .caret {
   margin-top: 4px;
 }
+
 /*
  *	lib/css/bootstrap/navbar.css
- */.nav {
+ */
+.nav {
   margin-left: 0;
   margin-bottom: 18px;
   list-style: none;
@@ -1287,9 +1300,11 @@
 	padding: 0px 20px;
 }
 
+
 /*
  *	lib/css/bootstrap/dropdown.css
- */.dropdown {
+ */
+.dropdown {
   position: relative;
 }
 .dropdown-toggle {
@@ -1389,9 +1404,11 @@
 .dropdown.open .dropdown-menu {
   display: block;
 }
+
 /*
  *	lib/css/bootstrap/tooltip.css
- */.tooltip {
+ */
+.tooltip {
   position: absolute;
   z-index: 1020;
   display: block;
@@ -1557,9 +1574,11 @@
 .popover-content p, .popover-content ul, .popover-content ol {
   margin-bottom: 0;
 }
+
 /*
  *	erpnext/startup/startup.css
- */h1, h2, h3, h4, h5 {
+ */
+h1, h2, h3, h4, h5 {
 	font-family: Tahoma, Arial, Verdana, sans-serif;
 	font-weight: bold;
 }
@@ -1644,9 +1663,11 @@
 	max-width: 260px !important;
 }
 
+
 /*
  *	erpnext/website/css/website.css
- */.layout_wrapper {
+ */
+.layout_wrapper {
 	padding: 20px;
 }
 
@@ -1757,4 +1778,4 @@
 
 .web-footer-menu ul li:last-child {
 	border-right: 0px solid #777 !important;
-}
\ No newline at end of file
+}
diff --git a/erpnext/accounts/doctype/journal_voucher/listview.js b/erpnext/accounts/doctype/journal_voucher/listview.js
new file mode 100644
index 0000000..03c87f8
--- /dev/null
+++ b/erpnext/accounts/doctype/journal_voucher/listview.js
@@ -0,0 +1,13 @@
+wn.doclistviews['Journal Voucher'] = wn.pages.ListView.extend({
+	init: function(doctype) {
+		this._super(doctype);
+		this.fields = this.fields.concat([
+			'`tabJournal Voucher`.voucher_type'
+		]);
+		this.stats = this.stats.concat(['voucher_type']);
+	},
+	render: function(row, data) {
+		this._super(row, data);
+		this.$main.html(data.voucher_type);
+	}
+});
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
index 99bd24c..bdb4e41 100644
--- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
+++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
@@ -17,8 +17,8 @@
 cur_frm.cscript.tname = "PV Detail";
 cur_frm.cscript.fname = "entries";
 cur_frm.cscript.other_fname = "purchase_tax_details";
-$import(Purchase Other Charges)
-$import(Purchase Common)
+wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
 
 // On Load
 // --------
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
index 7b3c6ef..6db3b52 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
@@ -22,9 +22,10 @@
 // print heading
 cur_frm.pformat.print_heading = 'Invoice';
 
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 // On Load
 // -------
@@ -486,7 +487,6 @@
 	}		
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Sales Invoice',
diff --git a/erpnext/buying/doctype/indent/indent.js b/erpnext/buying/doctype/indent/indent.js
index 570e06c..1940e5a 100644
--- a/erpnext/buying/doctype/indent/indent.js
+++ b/erpnext/buying/doctype/indent/indent.js
@@ -17,8 +17,8 @@
 cur_frm.cscript.tname = "Indent Detail";
 cur_frm.cscript.fname = "indent_details";
 
-$import(Purchase Common)
-$import(SMS Control)
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
 cur_frm.cscript.indent_doctype_label =	get_doctype_label('Indent');
 	
 //========================== On Load =================================================
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 7af1204..3588a52 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -17,9 +17,11 @@
 cur_frm.cscript.tname = "PO Detail";
 cur_frm.cscript.fname = "po_details";
 cur_frm.cscript.other_fname = "purchase_tax_details";
-$import(Purchase Common)
-$import(Purchase Other Charges)
-$import(SMS Control)
+
+wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 //========================== On Load =================================================
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
@@ -270,7 +272,6 @@
 	return out;
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Purchase Order',
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index 41889af..2ac62f2 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-$import(Contact Control)
+wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
 
 cur_frm.cscript.onload = function(doc,dt,dn){
 
@@ -54,7 +54,7 @@
 
 cur_frm.cscript.make_address = function() {
 	if(!cur_frm.address_list) {
-		cur_frm.address_list = new wn.widgets.Listing({
+		cur_frm.address_list = new wn.ui.Listing({
 			parent: cur_frm.fields_dict['Address HTML'].wrapper,
 			page_length: 2,
 			new_doctype: "Address",
@@ -96,7 +96,7 @@
 
 cur_frm.cscript.make_contact = function() {
 	if(!cur_frm.contact_list) {
-		cur_frm.contact_list = new wn.widgets.Listing({
+		cur_frm.contact_list = new wn.ui.Listing({
 			parent: cur_frm.fields_dict['Contact HTML'].wrapper,
 			page_length: 2,
 			new_doctype: "Contact",
diff --git a/erpnext/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js
index 62604b7..83f018d 100644
--- a/erpnext/home/page/activity/activity.js
+++ b/erpnext/home/page/activity/activity.js
@@ -1,5 +1,5 @@
 wn.pages['activity'].onload = function(wrapper) {
-	var list = new wn.widgets.Listing({
+	var list = new wn.ui.Listing({
 		method: 'home.page.activity.activity.get_feed',
 		parent: $('#activity-list'),
 		render_row: function(row, data) {
diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js
index 1d01ee9..072af25 100644
--- a/erpnext/home/page/dashboard/dashboard.js
+++ b/erpnext/home/page/dashboard/dashboard.js
@@ -16,12 +16,12 @@
 
 pscript.onload_dashboard = function() {
 	// load jqplot
-	wn.require('lib/css/jqplot.css');
-	wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
-	wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.barRenderer.js'); 
-	wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.canvasAxisTickRenderer.min.js');
-	wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.canvasTextRenderer.min.js');
-	wn.require('lib/js/legacy/jquery/jqplot-plugins/jqplot.categoryAxisRenderer.min.js');
+	wn.require('lib/css/lib/jqplot.css');
+	wn.require('lib/js/lib/jqplot/jquery.jqplot.min.js');
+	wn.require('lib/js/lib/jqplot/jqplot-plugins/jqplot.barRenderer.js'); 
+	wn.require('lib/js/lib/jqplot/jqplot-plugins/jqplot.canvasAxisTickRenderer.min.js');
+	wn.require('lib/js/lib/jqplot/jqplot-plugins/jqplot.canvasTextRenderer.min.js');
+	wn.require('lib/js/lib/jqplot/jqplot-plugins/jqplot.categoryAxisRenderer.min.js');
 
 
 	pscript.dashboard_settings = {
diff --git a/erpnext/home/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js
index b2825f3..084ff0c 100644
--- a/erpnext/home/page/event_updates/event_updates.js
+++ b/erpnext/home/page/event_updates/event_updates.js
@@ -470,7 +470,7 @@
 	var me = this;
 	this.list_area = $a(this.wrapper,'div')
 	
-	this.list = new wn.widgets.Listing({
+	this.list = new wn.ui.Listing({
 		parent: this.list_area,
 		query: repl('select \
 			distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.modified_by, \
diff --git a/erpnext/home/page/my_company/my_company.js b/erpnext/home/page/my_company/my_company.js
index 8217cc7..7b198df 100644
--- a/erpnext/home/page/my_company/my_company.js
+++ b/erpnext/home/page/my_company/my_company.js
@@ -179,7 +179,7 @@
 	var me = this;
 	this.lst_area = $a(this.list_wrapper, 'div');
 
-	this.lst = new wn.widgets.Listing({
+	this.lst = new wn.ui.Listing({
 		parent: this.lst_area,
 		as_dict: 1,
 		get_query: function() {
@@ -692,7 +692,7 @@
 			this.my_messages_box = $a(this.lst_area, 'div', 'my-company-conversation-head', {marginBottom:'7px'}, 'Messages by everyone to me<br>To send a message, click on the user on the left')
 		}
 		
-		this.lst = new wn.widgets.Listing({
+		this.lst = new wn.ui.Listing({
 			parent: this.lst_area,
 			as_dict: 1,
 			no_result_message: (user==uid 
diff --git a/erpnext/hr/doctype/expense_voucher/expense_voucher.js b/erpnext/hr/doctype/expense_voucher/expense_voucher.js
index 2e03567..2363dbd 100644
--- a/erpnext/hr/doctype/expense_voucher/expense_voucher.js
+++ b/erpnext/hr/doctype/expense_voucher/expense_voucher.js
@@ -100,7 +100,7 @@
   cur_frm.cscript.calculate_total(doc,cdt,cdn);
 }
 
-$import(Notification Control);
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 cur_frm.cscript['Approve'] = function(doc,cdt,cdn){
 
@@ -244,7 +244,6 @@
   });
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Expense Voucher',
diff --git a/erpnext/knowledge_base/page/question_view/question_view.js b/erpnext/knowledge_base/page/question_view/question_view.js
index 5783471..a193f16 100644
--- a/erpnext/knowledge_base/page/question_view/question_view.js
+++ b/erpnext/knowledge_base/page/question_view/question_view.js
@@ -131,7 +131,7 @@
 	
 	this.make_list = function() {
 	
-		this.list = new wn.widgets.Listing({
+		this.list = new wn.ui.Listing({
 			parent: me.parent,
 			as_dict: 1,
 			no_result_message: 'No answers yet, be the first one to answer!',
@@ -185,4 +185,4 @@
 }
 
 
-$import(knowledge_base/page/kb_common/kb_common.js);
\ No newline at end of file
+wn.require('erpnext/knowledge_base/page/kb_common/kb_common.js');
\ No newline at end of file
diff --git a/erpnext/knowledge_base/page/questions/questions.js b/erpnext/knowledge_base/page/questions/questions.js
index 7261cd8..6b0ca25 100644
--- a/erpnext/knowledge_base/page/questions/questions.js
+++ b/erpnext/knowledge_base/page/questions/questions.js
@@ -107,7 +107,7 @@
 		this.list_area = $a(w, 'div', '', {marginRight:'13px'})
 		this.no_result = $a(w, 'div','help_box',{display:'none'},'No questions asked yet! Be the first one to ask')
 
-		this.list = new wn.widgets.Listing({
+		this.list = new wn.ui.Listing({
 			parent: this.list_area,
 			no_results_message: 'No questions found. Ask a new question!',
 			as_dict: 1,
@@ -215,4 +215,4 @@
 	this.make()
 }
 
-$import(knowledge_base/page/kb_common/kb_common.js);
\ No newline at end of file
+wn.require('erpnext/knowledge_base/page/kb_common/kb_common.js');
\ No newline at end of file
diff --git a/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py b/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
index 8fee8c5..9f0a5c0 100644
--- a/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
+++ b/erpnext/patches/before_jan_2012/Discount_purchase_cycle.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('accounts', 'doctype', 'pv_detail')
 	reload_doc('buying', 'doctype', 'po_detail')
diff --git a/erpnext/patches/before_jan_2012/accounts_default_form.py b/erpnext/patches/before_jan_2012/accounts_default_form.py
index 282ebf5..eb8f586 100644
--- a/erpnext/patches/before_jan_2012/accounts_default_form.py
+++ b/erpnext/patches/before_jan_2012/accounts_default_form.py
@@ -16,7 +16,7 @@
 
 def execute():
         import webnotes
-        from webnotes.modules.module_manager import reload_doc
+        from webnotes.modules import reload_doc
         reload_doc('setup', 'doctype', 'company')
         reload_doc('setup', 'doctype', 'manage_account')
  
diff --git a/erpnext/patches/before_jan_2012/auto_indent.py b/erpnext/patches/before_jan_2012/auto_indent.py
index 7373c39..a472d80 100644
--- a/erpnext/patches/before_jan_2012/auto_indent.py
+++ b/erpnext/patches/before_jan_2012/auto_indent.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('setup', 'doctype', 'manage_account')
 	reload_doc('stock', 'doctype', 'item')
 	webnotes.conn.sql("delete from `tabDocField` where fieldname='minimum_inventory_level' and parent='item'")
diff --git a/erpnext/patches/before_jan_2012/c_form_patch.py b/erpnext/patches/before_jan_2012/c_form_patch.py
index 8c00891..307dabc 100644
--- a/erpnext/patches/before_jan_2012/c_form_patch.py
+++ b/erpnext/patches/before_jan_2012/c_form_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('accounts', 'doctype', 'receivable_voucher')
 	reload_doc('accounts', 'doctype', 'c_form')
diff --git a/erpnext/patches/before_jan_2012/deploy_email_digest.py b/erpnext/patches/before_jan_2012/deploy_email_digest.py
index 5adeb97..8474b64 100644
--- a/erpnext/patches/before_jan_2012/deploy_email_digest.py
+++ b/erpnext/patches/before_jan_2012/deploy_email_digest.py
@@ -21,7 +21,7 @@
 		* Reload email_digest doctype
 		* Create default email digest
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	# Minor fix in print_format doctype
 	#reload_doc('core', 'doctype', 'print_format')
diff --git a/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py b/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py
index bab119e..83f2143 100644
--- a/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py
+++ b/erpnext/patches/before_jan_2012/employeewise_balance_leave_report.py
@@ -22,7 +22,7 @@
 """
 def execute():
 	from webnotes.model.doc import Document
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report')
 	d = Document('Search Criteria', 'employeewise_balance_leave_report')
 	d.criteria_name = 'Employee Leave Balance Report'
diff --git a/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py b/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py
index aab64a0..a9dcd75 100644
--- a/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py
+++ b/erpnext/patches/before_jan_2012/erpnext_structure_cleanup.py
@@ -19,7 +19,7 @@
 
 import webnotes
 from webnotes.model import delete_doc
-from webnotes.modules.module_manager import reload_doc
+from webnotes.modules import reload_doc
 from webnotes.modules.export_module import export_to_files
 sql = webnotes.conn.sql
 
diff --git a/erpnext/patches/before_jan_2012/install_print_formats.py b/erpnext/patches/before_jan_2012/install_print_formats.py
index 3a18aae..ab0067c 100644
--- a/erpnext/patches/before_jan_2012/install_print_formats.py
+++ b/erpnext/patches/before_jan_2012/install_print_formats.py
@@ -68,7 +68,7 @@
 	"""
 		Install print formats
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'print_format')
 	
 	#copy_doctype_to_pfs()
diff --git a/erpnext/patches/before_jan_2012/lcw_patch.py b/erpnext/patches/before_jan_2012/lcw_patch.py
index b274069..27e9a56 100644
--- a/erpnext/patches/before_jan_2012/lcw_patch.py
+++ b/erpnext/patches/before_jan_2012/lcw_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	
 	reload_doc('stock', 'doctype', 'landed_cost_wizard')
diff --git a/erpnext/patches/before_jan_2012/packing_slip.py b/erpnext/patches/before_jan_2012/packing_slip.py
index 23c34d9d..7fe2d5d 100644
--- a/erpnext/patches/before_jan_2012/packing_slip.py
+++ b/erpnext/patches/before_jan_2012/packing_slip.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'doctype', 'delivery_note_detail')
 	reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
 	
diff --git a/erpnext/patches/before_jan_2012/price_list_patch.py b/erpnext/patches/before_jan_2012/price_list_patch.py
index ce2ff4a..6cd3f9b 100644
--- a/erpnext/patches/before_jan_2012/price_list_patch.py
+++ b/erpnext/patches/before_jan_2012/price_list_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('accounts', 'doctype', 'receivable_voucher')
 	reload_doc('stock', 'doctype', 'delivery_note')
diff --git a/erpnext/patches/before_jan_2012/project_patch.py b/erpnext/patches/before_jan_2012/project_patch.py
index f4b0ea6..df0e1e9 100644
--- a/erpnext/patches/before_jan_2012/project_patch.py
+++ b/erpnext/patches/before_jan_2012/project_patch.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	sql = webnotes.conn.sql
 	
 	# Reload item table
diff --git a/erpnext/patches/before_jan_2012/reload_address.py b/erpnext/patches/before_jan_2012/reload_address.py
index 3ef80d8..ae68f6f 100644
--- a/erpnext/patches/before_jan_2012/reload_address.py
+++ b/erpnext/patches/before_jan_2012/reload_address.py
@@ -16,6 +16,6 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('utilities', 'doctype', 'address')
diff --git a/erpnext/patches/before_jan_2012/reload_bom.py b/erpnext/patches/before_jan_2012/reload_bom.py
index f925bc6..cbacce1 100644
--- a/erpnext/patches/before_jan_2012/reload_bom.py
+++ b/erpnext/patches/before_jan_2012/reload_bom.py
@@ -16,6 +16,6 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('production', 'doctype', 'bill_of_materials')
diff --git a/erpnext/patches/before_jan_2012/reload_doclayer.py b/erpnext/patches/before_jan_2012/reload_doclayer.py
index 4ab077e..2c6e23e 100644
--- a/erpnext/patches/before_jan_2012/reload_doclayer.py
+++ b/erpnext/patches/before_jan_2012/reload_doclayer.py
@@ -18,7 +18,7 @@
 	Reload DocLayer, DocLayerField and Print Format doctypes
 """
 def execute():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'print_format')
 	reload_doc('core', 'doctype', 'doclayer')
 	reload_doc('core', 'doctype', 'doclayerfield')
diff --git a/erpnext/patches/before_jan_2012/reload_email_digest.py b/erpnext/patches/before_jan_2012/reload_email_digest.py
index 13a2614..15cbfc3 100644
--- a/erpnext/patches/before_jan_2012/reload_email_digest.py
+++ b/erpnext/patches/before_jan_2012/reload_email_digest.py
@@ -15,5 +15,5 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 def execute():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('Setup', 'DocType', 'Email Digest')
diff --git a/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py b/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py
index b60d3d4..53183cb 100644
--- a/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py
+++ b/erpnext/patches/before_jan_2012/reload_employeewise_balance_leave_report.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('hr', 'search_criteria', 'employeewise_balance_leave_report')
diff --git a/erpnext/patches/before_jan_2012/reload_flat_bom.py b/erpnext/patches/before_jan_2012/reload_flat_bom.py
index a46ad5e..020bd7e 100644
--- a/erpnext/patches/before_jan_2012/reload_flat_bom.py
+++ b/erpnext/patches/before_jan_2012/reload_flat_bom.py
@@ -16,7 +16,7 @@
 
 def execute():
 	from webnotes.modules import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('production', 'doctype', 'flat_bom_detail')
 	reload_doc('production', 'doctype', 'bom_material')
diff --git a/erpnext/patches/before_jan_2012/reload_gl_mapper.py b/erpnext/patches/before_jan_2012/reload_gl_mapper.py
index 27f2c58..c43ab67 100644
--- a/erpnext/patches/before_jan_2012/reload_gl_mapper.py
+++ b/erpnext/patches/before_jan_2012/reload_gl_mapper.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	# reload jv gl mapper
 	reload_doc('accounts', 'GL Mapper', 'Journal Voucher')
diff --git a/erpnext/patches/before_jan_2012/reload_lc_wizard.py b/erpnext/patches/before_jan_2012/reload_lc_wizard.py
index 7645419..e3df031 100644
--- a/erpnext/patches/before_jan_2012/reload_lc_wizard.py
+++ b/erpnext/patches/before_jan_2012/reload_lc_wizard.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model import delete_doc
 
 	delete_doc('DocType', 'Landed Cost Wizard')
diff --git a/erpnext/patches/before_jan_2012/reload_print_format.py b/erpnext/patches/before_jan_2012/reload_print_format.py
index 37b83a6..9948beb 100644
--- a/erpnext/patches/before_jan_2012/reload_print_format.py
+++ b/erpnext/patches/before_jan_2012/reload_print_format.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model.doc import addchild
 	from webnotes.model.code import get_obj
 	reload_doc('stock', 'Print Format', 'Delivery Note Packing List Wise')
diff --git a/erpnext/patches/before_jan_2012/reload_project_task.py b/erpnext/patches/before_jan_2012/reload_project_task.py
index 14d39fd..f174603 100644
--- a/erpnext/patches/before_jan_2012/reload_project_task.py
+++ b/erpnext/patches/before_jan_2012/reload_project_task.py
@@ -18,6 +18,6 @@
 	Reload Task Doctype of Project Module
 """
 def execute():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('Projects', 'DocType', 'Ticket')
 
diff --git a/erpnext/patches/before_jan_2012/reload_reco.py b/erpnext/patches/before_jan_2012/reload_reco.py
index 9335992..782fc7f 100644
--- a/erpnext/patches/before_jan_2012/reload_reco.py
+++ b/erpnext/patches/before_jan_2012/reload_reco.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	reload_doc('stock', 'doctype', 'stock_reconciliation')
 	webnotes.conn.sql("delete from `tabDocField` where (label in ('Validate Data', 'Attachment HTML', 'Attachment') or fieldname in ('next_step', 'company', 'fiscal_year', 'amendment_date')) and parent = 'Stock Reconciliation'")
diff --git a/erpnext/patches/before_jan_2012/reload_rv.py b/erpnext/patches/before_jan_2012/reload_rv.py
index f41db49..4365563 100644
--- a/erpnext/patches/before_jan_2012/reload_rv.py
+++ b/erpnext/patches/before_jan_2012/reload_rv.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model.code import get_obj
 
 	reload_doc('accounts', 'doctype', 'receivable_voucher')
diff --git a/erpnext/patches/before_jan_2012/reload_support_ticket.py b/erpnext/patches/before_jan_2012/reload_support_ticket.py
index 803754f..f889687 100644
--- a/erpnext/patches/before_jan_2012/reload_support_ticket.py
+++ b/erpnext/patches/before_jan_2012/reload_support_ticket.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('Support', 'DocType', 'Support Ticket')
 	from webnotes.model.code import get_obj
 	get_obj('DocType', 'Support Ticket').validate()
diff --git a/erpnext/patches/before_jan_2012/sal_man_patch.py b/erpnext/patches/before_jan_2012/sal_man_patch.py
index b8f5301..626d2e3 100644
--- a/erpnext/patches/before_jan_2012/sal_man_patch.py
+++ b/erpnext/patches/before_jan_2012/sal_man_patch.py
@@ -17,7 +17,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	sql = webnotes.conn.sql
 
 	reload_doc('hr', 'doctype', 'salary_manager')
diff --git a/erpnext/patches/before_jan_2012/task_email_notification.py b/erpnext/patches/before_jan_2012/task_email_notification.py
index 8d1a078..9f7669a 100644
--- a/erpnext/patches/before_jan_2012/task_email_notification.py
+++ b/erpnext/patches/before_jan_2012/task_email_notification.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('projects', 'doctype', 'ticket')
diff --git a/erpnext/patches/jan_mar_2012/allocated_to_profile.py b/erpnext/patches/jan_mar_2012/allocated_to_profile.py
index 32c7a2c..ef0ee97 100644
--- a/erpnext/patches/jan_mar_2012/allocated_to_profile.py
+++ b/erpnext/patches/jan_mar_2012/allocated_to_profile.py
@@ -32,5 +32,5 @@
 		AND label='Make Maintenance Visit'
 	""")
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('support', 'doctype', 'customer_issue')
diff --git a/erpnext/patches/jan_mar_2012/apps/todo_item.py b/erpnext/patches/jan_mar_2012/apps/todo_item.py
index 6eec6fd..bbef232 100644
--- a/erpnext/patches/jan_mar_2012/apps/todo_item.py
+++ b/erpnext/patches/jan_mar_2012/apps/todo_item.py
@@ -18,5 +18,5 @@
 	"""
 		* Reload ToDo Item
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('utilities', 'doctype', 'todo_item')
diff --git a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
index 4671143..32a2125 100644
--- a/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
+++ b/erpnext/patches/jan_mar_2012/customer_address_contact_patch.py
@@ -26,7 +26,7 @@
 	patch_primary_address()
 
 def reload_sc():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('selling', 'search_criteria', 'customer_address_contact')
 	reload_doc('selling', 'Module Def', 'Selling')
 
diff --git a/erpnext/patches/jan_mar_2012/deploy_packing_slip.py b/erpnext/patches/jan_mar_2012/deploy_packing_slip.py
index 7a28ef8..653ff58 100644
--- a/erpnext/patches/jan_mar_2012/deploy_packing_slip.py
+++ b/erpnext/patches/jan_mar_2012/deploy_packing_slip.py
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import webnotes
-from webnotes.modules.module_manager import reload_doc
+from webnotes.modules import reload_doc
 
 def execute():
 	delete_fields_dn_detail()
diff --git a/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py b/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py
index a6f7a7c..0b6f405 100644
--- a/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py
+++ b/erpnext/patches/jan_mar_2012/doclabel_in_doclayer.py
@@ -24,5 +24,5 @@
 		UPDATE `tabDocField` SET options=NULL
 		WHERE parent='DocLayer' AND fieldname='doc_type'
 	""")
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'doclayer')
diff --git a/erpnext/patches/jan_mar_2012/dt_map_fix.py b/erpnext/patches/jan_mar_2012/dt_map_fix.py
index f669009..37732df 100644
--- a/erpnext/patches/jan_mar_2012/dt_map_fix.py
+++ b/erpnext/patches/jan_mar_2012/dt_map_fix.py
@@ -1,6 +1,6 @@
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	webnotes.conn.sql("delete from `tabField Mapper Detail` where from_field = 'transaction_date' and parent in ('Sales Order-Delivery Note', 'Purchase Order-Purchase Receipt')")
 
 	reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note')
diff --git a/erpnext/patches/jan_mar_2012/email_settings_reload.py b/erpnext/patches/jan_mar_2012/email_settings_reload.py
index ec6f05d..85c683e 100644
--- a/erpnext/patches/jan_mar_2012/email_settings_reload.py
+++ b/erpnext/patches/jan_mar_2012/email_settings_reload.py
@@ -25,5 +25,5 @@
 		WHERE parent = 'Email Settings' AND fieldname = 'mail_port'
 	""")
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('setup', 'doctype', 'email_settings')
diff --git a/erpnext/patches/jan_mar_2012/jan_production_patches.py b/erpnext/patches/jan_mar_2012/jan_production_patches.py
index d57fb9e..479cecb 100644
--- a/erpnext/patches/jan_mar_2012/jan_production_patches.py
+++ b/erpnext/patches/jan_mar_2012/jan_production_patches.py
@@ -20,7 +20,7 @@
 		Patch includes:
 		* Reload of Stock Entry Detail
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	reload_doc('stock', 'doctype', 'stock_entry_detail')
 	reload_doc('stock', 'doctype', 'item_supplier')
diff --git a/erpnext/patches/jan_mar_2012/label_cleanup.py b/erpnext/patches/jan_mar_2012/label_cleanup.py
index b40f36f..f158495 100644
--- a/erpnext/patches/jan_mar_2012/label_cleanup.py
+++ b/erpnext/patches/jan_mar_2012/label_cleanup.py
@@ -1,7 +1,7 @@
 def execute():
 	import webnotes
 	from webnotes.model import delete_doc
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	dt = {
 		'selling':	['quotation', 'sales_order', 'quotation_detail', 'sales_order_detail'], 
diff --git a/erpnext/patches/jan_mar_2012/pending_patches.py b/erpnext/patches/jan_mar_2012/pending_patches.py
index 351200f..821a411 100644
--- a/erpnext/patches/jan_mar_2012/pending_patches.py
+++ b/erpnext/patches/jan_mar_2012/pending_patches.py
@@ -17,7 +17,7 @@
 def execute():
 	import webnotes
 	from webnotes.model.code import get_obj
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	sql = webnotes.conn.sql
 
 	reload_doc('hr', 'doctype', 'appraisal')
diff --git a/erpnext/patches/jan_mar_2012/production_cleanup.py b/erpnext/patches/jan_mar_2012/production_cleanup.py
index d0a5879..e715f27 100644
--- a/erpnext/patches/jan_mar_2012/production_cleanup.py
+++ b/erpnext/patches/jan_mar_2012/production_cleanup.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	from webnotes.model import delete_doc
 	sql = webnotes.conn.sql
 	
diff --git a/erpnext/patches/jan_mar_2012/reload_doctype.py b/erpnext/patches/jan_mar_2012/reload_doctype.py
index 51241b8..957864b 100644
--- a/erpnext/patches/jan_mar_2012/reload_doctype.py
+++ b/erpnext/patches/jan_mar_2012/reload_doctype.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core', 'doctype', 'doctype')
diff --git a/erpnext/patches/jan_mar_2012/reload_item.py b/erpnext/patches/jan_mar_2012/reload_item.py
index c45b818..e42b50b 100644
--- a/erpnext/patches/jan_mar_2012/reload_item.py
+++ b/erpnext/patches/jan_mar_2012/reload_item.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'doctype', 'item')
 
 	webnotes.conn.sql("update `tabItem` set re_order_qty = min_order_qty")
diff --git a/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py b/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py
index 4ed252b..5866429 100644
--- a/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py
+++ b/erpnext/patches/jan_mar_2012/reload_po_pr_mapper.py
@@ -16,5 +16,5 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt')
diff --git a/erpnext/patches/jan_mar_2012/reload_table.py b/erpnext/patches/jan_mar_2012/reload_table.py
index 481b46f..28a597b 100644
--- a/erpnext/patches/jan_mar_2012/reload_table.py
+++ b/erpnext/patches/jan_mar_2012/reload_table.py
@@ -1,6 +1,6 @@
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('selling', 'doctype', 'quotation_detail')
 	reload_doc('selling', 'doctype', 'sales_order_detail')
 	reload_doc('stock', 'doctype', 'delivery_note_detail')
diff --git a/erpnext/patches/jan_mar_2012/remove_get_tds_button.py b/erpnext/patches/jan_mar_2012/remove_get_tds_button.py
index fe804c0..8549e0d 100644
--- a/erpnext/patches/jan_mar_2012/remove_get_tds_button.py
+++ b/erpnext/patches/jan_mar_2012/remove_get_tds_button.py
@@ -26,5 +26,5 @@
 		AND fieldtype='Button'
 	""")
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('accounts', 'doctype', 'journal_voucher')
diff --git a/erpnext/patches/jan_mar_2012/rename_doctype_indent.py b/erpnext/patches/jan_mar_2012/rename_doctype_indent.py
index 01aeebf..4e026f7 100644
--- a/erpnext/patches/jan_mar_2012/rename_doctype_indent.py
+++ b/erpnext/patches/jan_mar_2012/rename_doctype_indent.py
@@ -47,7 +47,7 @@
 		* purchase_order
 		* po_detail
 	"""
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('buying', 'doctype', 'indent')
 	reload_doc('buying', 'doctype', 'purchase_order')
 	reload_doc('buying', 'doctype', 'po_detail')
diff --git a/erpnext/patches/jan_mar_2012/serial_no_add_opt.py b/erpnext/patches/jan_mar_2012/serial_no_add_opt.py
index 947c28d..ec45c27 100644
--- a/erpnext/patches/jan_mar_2012/serial_no_add_opt.py
+++ b/erpnext/patches/jan_mar_2012/serial_no_add_opt.py
@@ -30,5 +30,5 @@
 			webnotes.conn.commit()
 			webnotes.conn.begin()
 
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('stock', 'doctype', 'serial_no')
diff --git a/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py b/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
index e4078aa..d155107 100644
--- a/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
+++ b/erpnext/patches/jan_mar_2012/stable_branch_shift_09_01_12.py
@@ -15,7 +15,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import webnotes
-from webnotes.modules.module_manager import reload_doc
+from webnotes.modules import reload_doc
 	
 def execute():
 	"""
diff --git a/erpnext/patches/jan_mar_2012/website/domain_list.py b/erpnext/patches/jan_mar_2012/website/domain_list.py
index 25f50e2..26824a4 100644
--- a/erpnext/patches/jan_mar_2012/website/domain_list.py
+++ b/erpnext/patches/jan_mar_2012/website/domain_list.py
@@ -16,7 +16,7 @@
 
 def execute():
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('website', 'doctype', 'website_settings')
 
 	res = webnotes.conn.sql("""\
diff --git a/erpnext/patches/old_patches/customer_address.py b/erpnext/patches/old_patches/customer_address.py
index 44568ce..4757c02 100644
--- a/erpnext/patches/old_patches/customer_address.py
+++ b/erpnext/patches/old_patches/customer_address.py
@@ -21,7 +21,7 @@
 from webnotes import msgprint, errprint
 
 def make_address():
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('utilities','doctype','address')
 	
 	from webnotes.model.db_schema import updatedb
@@ -128,7 +128,7 @@
 #		export_to_files(record_list=[['DocType',dt]])
 
 def reload_doc_files():
-	from webnotes.modules.module_manager import reload_doc	
+	from webnotes.modules import reload_doc	
 	reload_doc('utilities', 'doctype', 'contact')
 	reload_doc('selling', 'doctype', 'customer')
 	reload_doc('support', 'doctype', 'customer_issue')
@@ -149,7 +149,7 @@
 	reload_doc('buying', 'doctype', 'supplier')
 	
 def reload_mapper_files():
-	from webnotes.modules.module_manager import reload_doc	
+	from webnotes.modules import reload_doc	
 	reload_doc('Mapper', 'DocType Mapper', 'Customer Issue-Maintenance Visit')
 	reload_doc('Mapper', 'DocType Mapper', 'Delivery Note-Installation Note')
 	reload_doc('Mapper', 'DocType Mapper', 'Delivery Note-Receivable Voucher')
diff --git a/erpnext/patches/old_patches/doctype_permission_patch.py b/erpnext/patches/old_patches/doctype_permission_patch.py
index 0953864..b23277a 100644
--- a/erpnext/patches/old_patches/doctype_permission_patch.py
+++ b/erpnext/patches/old_patches/doctype_permission_patch.py
@@ -21,7 +21,7 @@
 	# remove descriptions
 	webnotes.conn.sql("update tabDocType set description=null")
 		
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('core','doctype','custom_script')
 	reload_doc('core','doctype','custom_field')
 	reload_doc('core','doctype','property_setter')
diff --git a/erpnext/patches/old_patches/feed_patch.py b/erpnext/patches/old_patches/feed_patch.py
index 1edac88..d1fa147 100644
--- a/erpnext/patches/old_patches/feed_patch.py
+++ b/erpnext/patches/old_patches/feed_patch.py
@@ -110,7 +110,7 @@
 def support_patch():
 	# relaod support and other doctypes
 	
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	
 	webnotes.model.delete_doc('DocType','Support Ticket')
 	reload_doc('setup','doctype','support_email_settings')
diff --git a/erpnext/patches/old_patches/patch_1.py b/erpnext/patches/old_patches/patch_1.py
index 4176bf5..9e9cb6f 100644
--- a/erpnext/patches/old_patches/patch_1.py
+++ b/erpnext/patches/old_patches/patch_1.py
@@ -781,12 +781,12 @@
 	except: pass
 
 	# import
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('event_updates','doctype','feed')
 elif patch_no==185:
 	sql("delete from tabDocTrigger where method = 'webnotes.widgets.follow.on_docsave'")
 elif patch_no==186:
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('event_updates','doctype','feed')
 elif patch_no == 187:
 	sql("update tabDocType set autoname = '' where name = 'QA Inspection Report'")
@@ -807,7 +807,7 @@
 	sql("delete from `tabModule Def Item` where parent = 'SRM' and doc_name = 'Landed Cost Wizard' and display_name = 'Landed Cost Wizard'")
 	import_from_files(record_list = [['stock', 'Module Def', 'Material Management']])
 elif patch_no == 195:
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 	reload_doc('setup','doctype','manage_account')
 elif patch_no == 196:
 	sql("update `tabModule Def` set module_page = null where name = 'Material Management'")
diff --git a/erpnext/patches/patch.py b/erpnext/patches/patch.py
index 744b102..5b9f7a0 100644
--- a/erpnext/patches/patch.py
+++ b/erpnext/patches/patch.py
@@ -24,7 +24,7 @@
 def execute(patch_no):
 	return
 	import webnotes
-	from webnotes.modules.module_manager import reload_doc
+	from webnotes.modules import reload_doc
 
 	from webnotes.model.code import get_obj
 	sql = webnotes.conn.sql
@@ -377,7 +377,7 @@
 	elif patch_no == 370:
 		sql("update `tabDocField` set `hidden` = 0 where fieldname = 'group_or_ledger' and parent = 'Cost Center'")
 	elif patch_no == 371:
-		from webnotes.modules.module_manager import reload_doc
+		from webnotes.modules import reload_doc
 
 		reload_doc('setup', 'doctype','features_setup')
 		flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
@@ -393,7 +393,7 @@
 
 		get_obj('Features Setup', 'Features Setup').doc.save()
 	elif patch_no == 372:
-		from webnotes.modules.module_manager import reload_doc
+		from webnotes.modules import reload_doc
 
 		reload_doc('setup', 'doctype','features_setup')
 		flds = ['page_break', 'projects', 'packing_details', 'discounts', 'brands', 'item_batch_nos', 'after_sales_installations', 'item_searial_nos', 'item_group_in_details', 'exports', 'imports', 'item_advanced', 'sales_extras', 'more_info', 'quality', 'manufacturing', 'pos', 'item_serial_nos']
diff --git a/erpnext/projects/Module Def/Projects/Projects.txt b/erpnext/projects/Module Def/Projects/Projects.txt
deleted file mode 100644
index f8cf6f7..0000000
--- a/erpnext/projects/Module Def/Projects/Projects.txt
+++ /dev/null
@@ -1,141 +0,0 @@
-[
-	{
-		'_last_update': '1300959287',
-		'creation': '2010-11-30 17:31:44',
-		'disabled': 'No',
-		'docstatus': 0,
-		'doctype': u'Module Def',
-		'doctype_list': None,
-		'file_list': 'undefined,undefined',
-		'idx': None,
-		'is_hidden': 'No',
-		'last_updated_date': '2011-03-10 15:57:47',
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'module_desc': '<div id="projects_div"></div>',
-		'module_icon': 'puzzle.png',
-		'module_label': 'Projects',
-		'module_name': 'Projects',
-		'module_page': None,
-		'module_seq': 2,
-		'name': 'Projects',
-		'owner': 'Administrator',
-		'parent': None,
-		'parentfield': None,
-		'parenttype': None,
-		'trash_reason': None,
-		'widget_code': None
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 17:31:44',
-		'description': None,
-		'display_name': 'Project',
-		'doc_name': 'Project',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 1,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00099',
-		'owner': 'Administrator',
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': None,
-		'description': None,
-		'display_name': 'Task',
-		'doc_name': 'Ticket',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 2,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00285',
-		'owner': None,
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': None,
-		'description': None,
-		'display_name': 'Gantt Chart',
-		'doc_name': 'Projects',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 3,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00286',
-		'owner': None,
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': None,
-		'description': None,
-		'display_name': 'Timesheet',
-		'doc_name': 'Timesheet',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 4,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDI00287',
-		'owner': None,
-		'parent': 'Projects',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'creation': '2010-11-30 17:31:44',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 1,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDR00012',
-		'owner': 'Administrator',
-		'parent': 'Projects',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Projects User'
-	},
-	{
-		'creation': '2010-11-30 17:31:44',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 2,
-		'modified': '2011-03-24 15:07:53',
-		'modified_by': 'Administrator',
-		'name': 'MDR00013',
-		'owner': 'Administrator',
-		'parent': 'Projects',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'System Manager'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/help.md b/erpnext/projects/doctype/project/help.md
new file mode 100644
index 0000000..0043f04
--- /dev/null
+++ b/erpnext/projects/doctype/project/help.md
@@ -0,0 +1,5 @@
+You can use projects to:
+
+1. Track budgets (Purchase Orders, Invoices).
+2. Track material consumption.
+3. Create and assign tasks (and view them on a Gantt Chart).
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt
index 3d57e12..936fd7d 100644
--- a/erpnext/projects/doctype/project/project.txt
+++ b/erpnext/projects/doctype/project/project.txt
@@ -5,47 +5,51 @@
 	{
 		'creation': '2010-08-08 17:09:14',
 		'docstatus': 0,
-		'modified': '2011-01-05 15:24:43',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
+		'modified': '2012-03-12 16:07:48',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
-		'_last_update': '1305714062',
+		'_last_update': u'1331542508',
+		'allow_attach': 1,
 		'allow_trash': 1,
-		'autoname': 'field:project_name',
-		'colour': 'White:FFF',
+		'autoname': u'field:project_name',
+		'colour': u'White:FFF',
+		'default_print_format': u'Standard',
 		'doctype': 'DocType',
-		'document_type': 'Master',
-		'module': 'Projects',
+		'document_type': u'Master',
+		'max_attachments': 4,
+		'module': u'Projects',
 		'name': '__common__',
-		'search_fields': 'customer, status, priority, is_active',
-		'section_style': 'Tabbed',
-		'server_code_error': ' ',
-		'subject': ' ',
-		'tag_fields': 'status',
-		'version': 32
+		'search_fields': u'customer, status, priority, is_active',
+		'section_style': u'Tabbed',
+		'server_code_error': u' ',
+		'show_in_menu': 0,
+		'subject': u' ',
+		'tag_fields': u'status',
+		'version': 38
 	},
 
 	# These values are common for all DocField
 	{
-		'doctype': 'DocField',
+		'doctype': u'DocField',
 		'name': '__common__',
-		'parent': 'Project',
-		'parentfield': 'fields',
-		'parenttype': 'DocType'
+		'parent': u'Project',
+		'parentfield': u'fields',
+		'parenttype': u'DocType'
 	},
 
 	# These values are common for all DocPerm
 	{
 		'cancel': 1,
 		'create': 1,
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'name': '__common__',
-		'parent': 'Project',
-		'parentfield': 'permissions',
-		'parenttype': 'DocType',
+		'parent': u'Project',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
 		'permlevel': 0,
 		'read': 1,
 		'write': 1
@@ -54,45 +58,58 @@
 	# DocType, Project
 	{
 		'doctype': 'DocType',
-		'name': 'Project'
+		'name': u'Project'
 	},
 
 	# DocPerm
 	{
-		'doctype': 'DocPerm',
-		'idx': 1,
-		'role': 'All'
+		'doctype': u'DocPerm',
+		'role': u'All'
 	},
 
 	# DocPerm
 	{
-		'doctype': 'DocPerm',
-		'idx': 2,
-		'role': 'Projects User'
+		'doctype': u'DocPerm',
+		'role': u'Projects User'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Helps you keep track of your projects and links to Tasks. You can tag a task to a project to track its progress',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 1,
-		'label': 'Basic Info',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'description': u'Helps you keep track of your projects and links to Tasks. You can tag a task to a project to track its progress',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Basic Info',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'description': 'Project will get saved and will be searchable with project name given',
-		'doctype': 'DocField',
-		'fieldname': 'project_name',
-		'fieldtype': 'Data',
-		'idx': 2,
-		'label': 'Project Name',
-		'oldfieldname': 'project_name',
-		'oldfieldtype': 'Data',
+		'description': u'Project will get saved and will be searchable with project name given',
+		'doctype': u'DocField',
+		'fieldname': u'project_name',
+		'fieldtype': u'Data',
+		'label': u'Project Name',
+		'oldfieldname': u'project_name',
+		'oldfieldtype': u'Data',
+		'permlevel': 0,
+		'reqd': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'default': u'Open',
+		'doctype': u'DocField',
+		'fieldname': u'status',
+		'fieldtype': u'Select',
+		'in_filter': 1,
+		'label': u'Status',
+		'no_copy': 1,
+		'oldfieldname': u'status',
+		'oldfieldtype': u'Select',
+		'options': u'Open\nCompleted\nCancelled',
 		'permlevel': 0,
 		'reqd': 1,
 		'search_index': 1
@@ -100,385 +117,357 @@
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'default': 'Open',
-		'doctype': 'DocField',
-		'fieldname': 'status',
-		'fieldtype': 'Select',
-		'idx': 3,
+		'doctype': u'DocField',
+		'fieldname': u'is_active',
+		'fieldtype': u'Select',
+		'label': u'Is Active',
+		'oldfieldname': u'is_active',
+		'oldfieldtype': u'Select',
+		'options': u'Yes\nNo',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'priority',
+		'fieldtype': u'Select',
+		'label': u'Priority',
+		'oldfieldname': u'priority',
+		'oldfieldtype': u'Select',
+		'options': u'Medium\nLow\nHigh',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'project_type',
+		'fieldtype': u'Data',
+		'label': u'Project Type',
+		'oldfieldname': u'project_type',
+		'oldfieldtype': u'Data',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'project_start_date',
+		'fieldtype': u'Date',
 		'in_filter': 1,
-		'label': 'Status',
-		'oldfieldname': 'status',
-		'oldfieldtype': 'Select',
-		'options': 'Open\nCompleted\nCancelled',
-		'permlevel': 0,
-		'reqd': 1,
-		'search_index': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'is_active',
-		'fieldtype': 'Select',
-		'idx': 4,
-		'label': 'Is Active',
-		'oldfieldname': 'is_active',
-		'oldfieldtype': 'Select',
-		'options': 'Yes\nNo',
+		'label': u'Project Start Date',
+		'oldfieldname': u'project_start_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'priority',
-		'fieldtype': 'Select',
-		'idx': 5,
-		'label': 'Priority',
-		'oldfieldname': 'priority',
-		'oldfieldtype': 'Select',
-		'options': 'Medium\nLow\nHigh',
+		'doctype': u'DocField',
+		'fieldname': u'completion_date',
+		'fieldtype': u'Date',
+		'label': u'Completion Date',
+		'oldfieldname': u'completion_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'project_value',
-		'fieldtype': 'Currency',
-		'idx': 6,
-		'label': 'Project Value',
-		'oldfieldname': 'project_value',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'reqd': 1,
-		'trigger': 'Client'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'gross_margin_value',
-		'fieldtype': 'Currency',
-		'idx': 7,
-		'label': 'Gross Margin Value',
-		'oldfieldname': 'gross_margin_value',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'reqd': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'per_gross_margin',
-		'fieldtype': 'Currency',
-		'idx': 8,
-		'label': 'Gross Margin %',
-		'oldfieldname': 'per_gross_margin',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'reqd': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'est_material_cost',
-		'fieldtype': 'Currency',
-		'idx': 9,
-		'label': 'Estimated Material Cost',
-		'oldfieldname': 'est_material_cost',
-		'oldfieldtype': 'Currency',
-		'permlevel': 0,
-		'trigger': 'Client'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'project_type',
-		'fieldtype': 'Data',
-		'idx': 10,
-		'label': 'Project Type',
-		'oldfieldname': 'project_type',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'act_completion_date',
+		'fieldtype': u'Date',
+		'label': u'Actual Completion Date',
+		'oldfieldname': u'act_completion_date',
+		'oldfieldtype': u'Date',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'project_start_date',
-		'fieldtype': 'Date',
-		'idx': 11,
-		'in_filter': 1,
-		'label': 'Project Start Date',
-		'oldfieldname': 'project_start_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'completion_date',
-		'fieldtype': 'Date',
-		'idx': 12,
-		'label': 'Completion Date',
-		'oldfieldname': 'completion_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'act_completion_date',
-		'fieldtype': 'Date',
-		'idx': 13,
-		'label': 'Actual Completion Date',
-		'oldfieldname': 'act_completion_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'amended_from',
-		'fieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'amemdment_date',
+		'fieldtype': u'Date',
 		'hidden': 1,
-		'idx': 14,
-		'label': 'Amended From',
+		'label': u'Amemdment Date',
 		'no_copy': 1,
-		'oldfieldname': 'amended_from',
-		'oldfieldtype': 'Data',
+		'oldfieldname': u'amemdment_date',
+		'oldfieldtype': u'Date',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'amended_from',
+		'fieldtype': u'Data',
+		'hidden': 1,
+		'label': u'Amended From',
+		'no_copy': 1,
+		'oldfieldname': u'amended_from',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
 		'print_hide': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'amemdment_date',
-		'fieldtype': 'Date',
-		'hidden': 1,
-		'idx': 15,
-		'label': 'Amemdment Date',
-		'no_copy': 1,
-		'oldfieldname': 'amemdment_date',
-		'oldfieldtype': 'Date',
-		'permlevel': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 16,
-		'label': 'Project Details',
-		'oldfieldtype': 'Section Break',
-		'options': 'Simple',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Details',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Column Break',
-		'idx': 17,
-		'oldfieldtype': 'Column Break',
+		'doctype': u'DocField',
+		'fieldname': u'notes',
+		'fieldtype': u'Text Editor',
+		'label': u'Notes',
+		'oldfieldname': u'notes',
+		'oldfieldtype': u'Text Editor',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Financials',
+		'oldfieldtype': u'Section Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'project_value',
+		'fieldtype': u'Currency',
+		'label': u'Project Value',
+		'oldfieldname': u'project_value',
+		'oldfieldtype': u'Currency',
 		'permlevel': 0,
-		'width': '50%'
+		'reqd': 0,
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 18,
-		'oldfieldtype': 'Section Break',
-		'options': 'Simple',
+		'doctype': u'DocField',
+		'fieldname': u'est_material_cost',
+		'fieldtype': u'Currency',
+		'label': u'Estimated Material Cost',
+		'oldfieldname': u'est_material_cost',
+		'oldfieldtype': u'Currency',
+		'permlevel': 0,
+		'trigger': u'Client'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'notes',
-		'fieldtype': 'Text Editor',
-		'idx': 19,
-		'label': 'Notes',
-		'oldfieldname': 'notes',
-		'oldfieldtype': 'Text Editor',
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'per_gross_margin',
+		'fieldtype': u'Currency',
+		'label': u'Gross Margin %',
+		'oldfieldname': u'per_gross_margin',
+		'oldfieldtype': u'Currency',
+		'permlevel': 0,
+		'reqd': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'gross_margin_value',
+		'fieldtype': u'Currency',
+		'label': u'Gross Margin Value',
+		'oldfieldname': u'gross_margin_value',
+		'oldfieldtype': u'Currency',
+		'permlevel': 0,
+		'reqd': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Customer Details',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 20,
-		'label': 'Customer Details',
-		'oldfieldtype': 'Section Break',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'colour': 'White:FFF',
-		'description': 'Select name of Customer to whom project belongs',
-		'doctype': 'DocField',
-		'fieldname': 'customer',
-		'fieldtype': 'Link',
-		'idx': 21,
+		'colour': u'White:FFF',
+		'description': u'Select name of Customer to whom project belongs',
+		'doctype': u'DocField',
+		'fieldname': u'customer',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Customer',
-		'oldfieldname': 'customer',
-		'oldfieldtype': 'Link',
-		'options': 'Customer',
+		'label': u'Customer',
+		'oldfieldname': u'customer',
+		'oldfieldtype': u'Link',
+		'options': u'Customer',
 		'permlevel': 0,
 		'print_hide': 1,
 		'reqd': 0,
 		'search_index': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_name',
-		'fieldtype': 'Data',
-		'idx': 22,
+		'doctype': u'DocField',
+		'fieldname': u'customer_name',
+		'fieldtype': u'Data',
 		'in_filter': 1,
-		'label': 'Customer Name',
-		'oldfieldname': 'customer_name',
-		'oldfieldtype': 'Data',
+		'label': u'Customer Name',
+		'oldfieldname': u'customer_name',
+		'oldfieldtype': u'Data',
 		'permlevel': 1,
-		'search_index': 0
+		'search_index': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_address',
-		'fieldtype': 'Small Text',
-		'idx': 23,
-		'label': 'Customer Address',
-		'oldfieldname': 'customer_address',
-		'oldfieldtype': 'Small Text',
+		'doctype': u'DocField',
+		'fieldname': u'customer_address',
+		'fieldtype': u'Small Text',
+		'label': u'Customer Address',
+		'oldfieldname': u'customer_address',
+		'oldfieldtype': u'Small Text',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'contact_person',
-		'fieldtype': 'Link',
-		'idx': 24,
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'contact_person',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Contact Person',
-		'oldfieldname': 'contact_person',
-		'oldfieldtype': 'Link',
+		'label': u'Contact Person',
+		'oldfieldname': u'contact_person',
+		'oldfieldtype': u'Link',
 		'permlevel': 0,
 		'reqd': 0,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'doctype': 'DocField',
-		'fieldname': 'territory',
-		'fieldtype': 'Link',
-		'idx': 25,
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'territory',
+		'fieldtype': u'Link',
 		'in_filter': 1,
-		'label': 'Territory',
-		'oldfieldname': 'territory',
-		'oldfieldtype': 'Link',
-		'options': 'Territory',
+		'label': u'Territory',
+		'oldfieldname': u'territory',
+		'oldfieldtype': u'Link',
+		'options': u'Territory',
 		'permlevel': 0,
 		'reqd': 0,
-		'search_index': 0,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'contact_no',
-		'fieldtype': 'Data',
-		'idx': 26,
-		'label': 'Contact No',
-		'oldfieldname': 'contact_no',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'contact_no',
+		'fieldtype': u'Data',
+		'label': u'Contact No',
+		'oldfieldname': u'contact_no',
+		'oldfieldtype': u'Data',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'email_id',
-		'fieldtype': 'Data',
-		'idx': 27,
-		'label': 'Email Id',
-		'oldfieldname': 'email_id',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'email_id',
+		'fieldtype': u'Data',
+		'label': u'Email Id',
+		'oldfieldname': u'email_id',
+		'oldfieldtype': u'Data',
 		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'customer_group',
-		'fieldtype': 'Link',
-		'idx': 28,
-		'label': 'Customer Group',
-		'oldfieldname': 'customer_group',
-		'oldfieldtype': 'Link',
-		'options': 'Customer Group',
-		'permlevel': 1,
-		'search_index': 0
+		'doctype': u'DocField',
+		'fieldname': u'customer_group',
+		'fieldtype': u'Link',
+		'label': u'Customer Group',
+		'oldfieldname': u'customer_group',
+		'oldfieldtype': u'Link',
+		'options': u'Customer Group',
+		'permlevel': 1
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Important dates and commitments in your project life cycle',
-		'doctype': 'DocField',
-		'fieldtype': 'Section Break',
-		'idx': 29,
-		'label': 'Milestones',
-		'oldfieldtype': 'Section Break',
+		'colour': u'White:FFF',
+		'description': u'Important dates and commitments in your project life cycle',
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'label': u'Milestones',
+		'oldfieldtype': u'Section Break',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'project_milestones',
-		'fieldtype': 'Table',
-		'idx': 30,
-		'label': 'Project Milestones',
-		'oldfieldname': 'project_milestones',
-		'oldfieldtype': 'Table',
-		'options': 'Project Milestone',
+		'doctype': u'DocField',
+		'fieldname': u'project_milestones',
+		'fieldtype': u'Table',
+		'label': u'Project Milestones',
+		'oldfieldname': u'project_milestones',
+		'oldfieldtype': u'Table',
+		'options': u'Project Milestone',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'trash_reason',
-		'fieldtype': 'Small Text',
+		'doctype': u'DocField',
+		'fieldname': u'trash_reason',
+		'fieldtype': u'Small Text',
 		'hidden': 1,
-		'idx': 31,
-		'label': 'Trash Reason',
-		'oldfieldname': 'trash_reason',
-		'oldfieldtype': 'Small Text',
+		'label': u'Trash Reason',
+		'oldfieldname': u'trash_reason',
+		'oldfieldtype': u'Small Text',
+		'permlevel': 0,
+		'print_hide': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'file_list',
+		'fieldtype': u'Small Text',
+		'hidden': 1,
+		'label': u'File List',
+		'no_copy': 1,
 		'permlevel': 0,
 		'print_hide': 1
 	}
diff --git a/erpnext/projects/doctype/project_activity/project_activity.js b/erpnext/projects/doctype/project_activity/project_activity.js
index ed2b1df..02a6dbf 100644
--- a/erpnext/projects/doctype/project_activity/project_activity.js
+++ b/erpnext/projects/doctype/project_activity/project_activity.js
@@ -55,7 +55,7 @@
       if (ci==0){ 
         var d1 = $a(cell,'div');
         var img = $a(cell,'img','',{width:'40px'});
-        set_user_img(img,d[ri][0])
+        img.src = wn.user_info(d[ri][0]).image;
         var d2 = $a(cell,'div');
         d2.innerHTML =  d[ri][0] + ' on: ' + date.str_to_user(d[ri][1]);
       }
diff --git a/erpnext/selling/Module Def/Selling/Selling.txt b/erpnext/selling/Module Def/Selling/Selling.txt
deleted file mode 100644
index 42c8449..0000000
--- a/erpnext/selling/Module Def/Selling/Selling.txt
+++ /dev/null
@@ -1,335 +0,0 @@
-# Module Def, Selling
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2011-07-01 17:39:08',
-		'docstatus': 0,
-		'modified': '2012-01-23 18:25:58',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'name': '__common__',
-		'parent': 'Selling',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def'
-	},
-
-	# These values are common for all Module Def Item
-	{
-		'doctype': 'Module Def Item',
-		'name': '__common__',
-		'parent': 'Selling',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-
-	# These values are common for all Module Def
-	{
-		'disabled': 'No',
-		'doctype': u'Module Def',
-		'doctype_list': 'Print Format, Sales Order\nPrint Format, Quotation Format\nPrint Format, Delivery Note Format',
-		'file_list': 'crm.gif,FileData/00208',
-		'is_hidden': 'No',
-		'module_desc': 'Manage you sales team, with your leads, customers, quotes, orders etc.',
-		'module_icon': 'Selling.gif',
-		'module_label': 'Selling',
-		'module_name': 'Selling',
-		'module_seq': 3,
-		'name': '__common__'
-	},
-
-	# Module Def, Selling
-	{
-		'doctype': u'Module Def',
-		'name': 'Selling'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Database of potential customers you need to keep in touch with',
-		'display_name': 'Lead',
-		'doc_name': 'Lead',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'status\nlead_owner\nlead_name\ncontact_no\ncontact_by\ncontact_date\nexpected_month'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Your Customer Database',
-		'display_name': 'Customer',
-		'doc_name': 'Customer',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'customer_group\ncountry'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Specific requirements from a Lead / Customer',
-		'display_name': 'Enquiry',
-		'doc_name': 'Enquiry',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'status\ntransaction_date\ncustomer\ncontact_person\ncost_center\ncompany'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Offers you have made to your customers',
-		'display_name': 'Quotation',
-		'doc_name': 'Quotation',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'status\ntransaction_date\ncustomer\ncontact_person\ncost_center\ngrand_total\ncompany'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Database of confirmed Sale Orders from your Customers',
-		'display_name': 'Sales Order',
-		'doc_name': 'Sales Order',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'status\ntransaction_date\ncustomer\ncost_center\ngrand_total\nper_delivered\nper_billed\ncompany'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Dashboard',
-		'doc_name': 'Sales Dashboard',
-		'doc_type': 'Pages',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'doc_name': 'Reports',
-		'doc_type': 'Separator',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'doc_name': 'Reports',
-		'doc_type': 'Separator',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Gross Profit',
-		'doc_name': 'Delivery Note Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Territory, Item Group wise GP',
-		'doc_name': 'Delivery Note',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Itemwise Sales Details',
-		'doc_name': 'Sales Order Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Itemwise Delivery Details',
-		'doc_name': 'Delivery Note Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Personwise Transaction Summary',
-		'doc_name': 'Sales Person',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Total Target Variance Report',
-		'doc_name': 'Target Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Persons Target Variance (Item Group wise)',
-		'doc_name': 'Target Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Territories Target Variance (Item Group wise)',
-		'doc_name': 'Target Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Order Pending Items',
-		'doc_name': 'Sales Order Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Orderwise Booking & Delivery Summary',
-		'doc_name': 'Sales Order Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Orderwise Pending Qty To Deliver',
-		'doc_name': 'Sales Order Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Sales Orderwise Pending Amount To Bill',
-		'doc_name': 'Sales Order Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Delivered Items to be Install',
-		'doc_name': 'Delivery Note Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Itemwise Price List',
-		'doc_name': 'Ref Rate Detail',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Follow-up Report',
-		'doc_name': 'Follow up',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Ledger details of your debtors',
-		'display_name': "Debtor's Ledger",
-		'doc_name': 'GL Entry',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Report displaying Customer, Primary Address Details & Primary Contact Details',
-		'display_name': 'Customer Address Contact',
-		'doc_name': 'Customer',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Customer Category',
-		'display_name': 'Customer Group',
-		'doc_name': 'Customer Group',
-		'doc_type': 'Setup Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'id\ndescription'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Sales person details',
-		'display_name': 'Sales Person',
-		'doc_name': 'Sales Person',
-		'doc_type': 'Setup Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'id\nterritory\ndepartment\nmobile_no\nemail_id'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Item master',
-		'display_name': 'Item',
-		'doc_name': 'Item',
-		'doc_type': 'Setup Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'name\nitem_group\ndescription'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Sales partner details',
-		'display_name': 'Sales Partner',
-		'doc_name': 'Sales Partner',
-		'doc_type': 'Setup Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'id\npartner_type\nmobile\nemail\nterritory'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Business campaigns',
-		'display_name': 'Campaign',
-		'doc_name': 'Campaign',
-		'doc_type': 'Setup Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'id\ncampaign_name\ndescription'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Administrator'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Sales Manager'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Sales User'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Sales Master Manager'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 89b95fa..d678077 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-$import(Contact Control)
+wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
 
 /* ********************************* onload ********************************************* */
 
@@ -68,7 +68,7 @@
 
 cur_frm.cscript.make_address = function() {
 	if(!cur_frm.address_list) {
-		cur_frm.address_list = new wn.widgets.Listing({
+		cur_frm.address_list = new wn.ui.Listing({
 			parent: cur_frm.fields_dict['Address HTML'].wrapper,
 			page_length: 2,
 			new_doctype: "Address",
@@ -110,7 +110,7 @@
 
 cur_frm.cscript.make_contact = function() {
 	if(!cur_frm.contact_list) {
-		cur_frm.contact_list = new wn.widgets.Listing({
+		cur_frm.contact_list = new wn.ui.Listing({
 			parent: cur_frm.fields_dict['Contact HTML'].wrapper,
 			page_length: 2,
 			new_doctype: "Contact",
diff --git a/erpnext/selling/doctype/enquiry/enquiry.js b/erpnext/selling/doctype/enquiry/enquiry.js
index c3f0a0b..bf2628f 100644
--- a/erpnext/selling/doctype/enquiry/enquiry.js
+++ b/erpnext/selling/doctype/enquiry/enquiry.js
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-$import(SMS Control)
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
 
 cur_frm.cscript.refresh = function(doc, cdt, cdn){
 
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index 7255636..a32acf7 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -16,7 +16,7 @@
 
 // Module CRM
 
-$import(SMS Control)
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
 
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
   if(user =='Guest'){
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 910f54e..12d6d1e 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -21,9 +21,10 @@
 cur_frm.cscript.sales_team_fname = "sales_team";
 
 // =====================================================================================
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 // ONLOAD
 // ===================================================================================
@@ -102,12 +103,19 @@
 			cur_frm.refresh();
 	}
 
-	if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 'get_default_customer_address', '', callback);
-	if(doc.customer) unhide_field(['customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']);
+	if(doc.customer) $c_obj(make_doclist(doc.doctype, doc.name), 
+		'get_default_customer_address', '', callback);
+	if(doc.customer) unhide_field(['customer_address','contact_person','customer_name',
+		'address_display','contact_display','contact_mobile','contact_email','territory',
+		'customer_group']);
 }
 
 cur_frm.cscript.customer_address = cur_frm.cscript.contact_person = function(doc,dt,dn) {
-	if(doc.customer) get_server_fields('get_customer_address', JSON.stringify({customer: doc.customer, address: doc.customer_address, contact: doc.contact_person}),'', doc, dt, dn, 1);
+	if(doc.customer) get_server_fields('get_customer_address', JSON.stringify({
+		customer: doc.customer, 
+		address: doc.customer_address, 
+		contact: doc.contact_person
+	}),'', doc, dt, dn, 1);
 }
 
 cur_frm.fields_dict.customer_address.on_new = function(dn) {
@@ -321,7 +329,6 @@
 		return repl("SELECT name, item_name, description FROM tabItem WHERE `tabItem`.%(key)s LIKE '%s' %(cond)s ORDER BY tabItem.item_code DESC LIMIT 50", {cond:cond});
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Quotation',
diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js
index cad8ec1..192875c 100644
--- a/erpnext/selling/doctype/sales_common/sales_common.js
+++ b/erpnext/selling/doctype/sales_common/sales_common.js
@@ -18,7 +18,7 @@
 // ------
 // cur_frm.cscript.tname - Details table name
 // cur_frm.cscript.fname - Details fieldname
-// cur_frm.cscript.other_fname - Other Charges fieldname
+// cur_frm.cscript.other_fname - wn.require('erpnext/setup/doctype/other_charges/other_charges.js'); fieldname
 // cur_frm.cscript.sales_team_fname - Sales Team fieldname
 
 // ============== Load Default Taxes ===================
@@ -100,14 +100,14 @@
 		'grand_total':	'Grand Total', 'rounded_total': 'Rounded Total', 'in_words': 'In Words'}
 	par_cols_export = {'grand_total_export': 'Grand Total', 'rounded_total_export':	'Rounded Total', 'in_words_export':	'In Words'};
 
-	for (d in par_cols_base) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
-	for (d in par_cols_export) cur_frm.fields_dict[d].label_area.innerHTML = par_cols_export[d]+' (' + doc.currency + ')';
-	cur_frm.fields_dict['conversion_rate'].label_area.innerHTML = "Conversion Rate (" + doc.currency +' -> '+ base_curr + ')';
-	cur_frm.fields_dict['plc_conversion_rate'].label_area.innerHTML = 'Price List Currency Conversion Rate (' + doc.price_list_currency +' -> '+ base_curr + ')';
+	for (d in par_cols_base) cur_frm.fields_dict[d].label_span.innerHTML = par_cols_base[d]+' (' + base_curr + ')';
+	for (d in par_cols_export) cur_frm.fields_dict[d].label_span.innerHTML = par_cols_export[d]+' (' + doc.currency + ')';
+	cur_frm.fields_dict['conversion_rate'].label_span.innerHTML = "Conversion Rate (" + doc.currency +' -> '+ base_curr + ')';
+	cur_frm.fields_dict['plc_conversion_rate'].label_span.innerHTML = 'Price List Currency Conversion Rate (' + doc.price_list_currency +' -> '+ base_curr + ')';
 
 	if (doc.doctype == 'Receivable Voucher') {
-		cur_frm.fields_dict['total_advance'].label_area.innerHTML = 'Total Advance (' + base_curr + ')';
-		cur_frm.fields_dict['outstanding_amount'].label_area.innerHTML = 'Outstanding Amount (' + base_curr + ')';
+		cur_frm.fields_dict['total_advance'].label_span.innerHTML = 'Total Advance (' + base_curr + ')';
+		cur_frm.fields_dict['outstanding_amount'].label_span.innerHTML = 'Outstanding Amount (' + base_curr + ')';
 	}
 }
 
@@ -212,13 +212,16 @@
 cur_frm.cscript.conversion_rate = cur_frm.cscript.currency;
 cur_frm.cscript.plc_conversion_rate = cur_frm.cscript.currency;
 
-cur_frm.cscript.company = function(doc, dt, dn) {
+cur_frm.cscript.company = function(doc, cdt, cdn) {
 	wn.call({
 		method: 'selling.doctype.sales_common.sales_common.get_comp_base_currency',
 		args: {company:doc.company},
 		callback: function(r, rt) {
-			var doc = locals[dt][dn];
-			set_multiple(doc.doctype, doc.name, {currency:r.message, price_list_currency:r.message});
+			var doc = locals[cdt][cdn];
+			set_multiple(doc.doctype, doc.name, {
+				currency:r.message, 
+				price_list_currency:r.message
+			});
 			cur_frm.cscript.currency(doc, cdt, cdn);
 		}
 	});
@@ -249,9 +252,20 @@
 // ******************** ITEM CODE ******************************** 
 cur_frm.fields_dict[cur_frm.cscript.fname].grid.get_field("item_code").get_query = function(doc, cdt, cdn) {
 	if (doc.order_type == 'Maintenance')
-		return 'SELECT tabItem.name,tabItem.item_name,tabItem.description FROM tabItem WHERE tabItem.is_service_item="Yes" AND tabItem.docstatus != 2 AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") AND tabItem.%(key)s LIKE "%s" LIMIT 50';
+		return 'SELECT tabItem.name,tabItem.item_name,tabItem.description \
+			FROM tabItem WHERE tabItem.is_service_item="Yes" \
+			AND tabItem.docstatus != 2 \
+			AND (ifnull(`tabItem`.`end_of_life`,"") = "" \
+				OR `tabItem`.`end_of_life` > NOW() \
+				OR `tabItem`.`end_of_life`="0000-00-00") \
+			AND tabItem.%(key)s LIKE "%s" LIMIT 50';
 	else 
-		return 'SELECT tabItem.name,tabItem.item_name,tabItem.description FROM tabItem WHERE tabItem.is_sales_item="Yes" AND tabItem.docstatus != 2 AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") AND tabItem.%(key)s LIKE "%s" LIMIT 50';
+		return 'SELECT tabItem.name,tabItem.item_name,tabItem.description FROM tabItem \
+			WHERE tabItem.is_sales_item="Yes" AND tabItem.docstatus != 2 \
+			AND (ifnull(`tabItem`.`end_of_life`,"") = "" \
+				OR `tabItem`.`end_of_life` > NOW() \
+				OR `tabItem`.`end_of_life`="0000-00-00") \
+			AND tabItem.%(key)s LIKE "%s" LIMIT 50';
 }
 
 
@@ -267,8 +281,14 @@
 			var callback = function(r, rt){
 				cur_frm.cscript.recalc(doc, 1);
 			}
-			var args = {'item_code':d.item_code, 'income_account':d.income_account, 'cost_center': d.cost_center, 'warehouse': d.warehouse};
-			get_server_fields('get_item_details',JSON.stringify(args), fname,doc,cdt,cdn,1,callback);
+			var args = {
+				'item_code':d.item_code, 
+				'income_account':d.income_account, 
+				'cost_center': d.cost_center, 
+				'warehouse': d.warehouse
+			};
+			get_server_fields('get_item_details',JSON.stringify(args), 
+				fname,doc,cdt,cdn,1,callback);
 		}
 	}
 	if(cur_frm.cscript.custom_item_code){
@@ -358,8 +378,14 @@
 	var sales_team = cur_frm.cscript.sales_team_fname;
 	var other_fname	= cur_frm.cscript.other_fname;
 	
-	if(!flt(doc.conversion_rate)) { doc.conversion_rate = 1; refresh_field('conversion_rate'); }
-	if(!flt(doc.plc_conversion_rate)) { doc.plc_conversion_rate = 1; refresh_field('plc_conversion_rate'); }
+	if(!flt(doc.conversion_rate)) { 
+		doc.conversion_rate = 1; 
+		refresh_field('conversion_rate'); 
+	}
+	if(!flt(doc.plc_conversion_rate)) { 
+		doc.plc_conversion_rate = 1; 
+		refresh_field('plc_conversion_rate'); 
+	}
 
 	if(n > 0) cur_frm.cscript.update_fname_table(doc , tname , fname , n, other_fname); // updates all values in table (i.e. amount, export amount, net total etc.)
 	
@@ -378,7 +404,7 @@
 		}
 		cur_frm.cscript.calc_other_charges(doc , tname , fname , other_fname); // calculate other charges
 	}
-	cur_frm.cscript.calc_doc_values(doc, cdt, cdn, tname, fname, other_fname); // calculates total amounts
+	cur_frm.cscript.calc_doc_values(doc, null, null, tname, fname, other_fname); // calculates total amounts
 
 	// ******************* calculate allocated amount of sales person ************************
 	cl = getchildren('Sales Team', doc.name, sales_team);
diff --git a/erpnext/selling/doctype/sales_order/listview.js b/erpnext/selling/doctype/sales_order/listview.js
new file mode 100644
index 0000000..e5d574f
--- /dev/null
+++ b/erpnext/selling/doctype/sales_order/listview.js
@@ -0,0 +1,48 @@
+// render
+wn.doclistviews['Sales Order'] = wn.pages.ListView.extend({
+	init: function(doctype) {
+		this._super(doctype)
+		this.fields = this.fields.concat([
+			"`tabSales Order`.customer_name", 
+			"ifnull(`tabSales Order`.per_delivered,0) as per_delivered", 
+			"ifnull(`tabSales Order`.per_billed,0) as per_billed",
+			"`tabSales Order`.currency", 
+			"ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export"
+		]);
+	},
+	render: function(row, data, listobj) {
+		
+		// bar color for billed
+		data.bar_class_delivered = ''; data.bar_class_billed = '';
+		if(data.per_delivered == 100) data.bar_class_delivered = 'bar-complete';
+		if(data.per_billed == 100) data.bar_class_billed = 'bar-complete';
+		
+		// lock for docstatus
+		data.icon = '';
+		data.item_color = 'grey';
+		if(data.docstatus==0) {
+			data.customer_name = '[Draft] ' + data.customer_name;
+		} else if(data.docstatus==1) {
+			data.icon = ' <i class="icon-lock" title="Submitted"></i>';
+			data.item_color = 'blue';
+		} else if(data.docstatus==2) {
+			data.icon = ' <i class="icon-remove" title="Cancelled"></i>';
+			data.item_color = 'red';
+		}
+		
+		this._super(row, data);
+		this.$main.html(repl('<span style="color:%(item_color)s">%(customer_name)s</span>\
+		<span class="bar-outer" style="width: 30px; float: right" \
+			title="%(per_delivered)s% Delivered">\
+			<span class="bar-inner %(bar_class_delivered)s" \
+				style="width: %(per_delivered)s%;"></span>\
+		</span>\
+		<span class="bar-outer" style="width: 30px; float: right" \
+			title="%(per_billed)s% Billed">\
+			<span class="bar-inner %(bar_class_billed)s" \
+				style="width: %(per_billed)s%;"></span>\
+		</span>\
+		<span style="color:#444; float: right;">%(currency)s %(grand_total_export)s</span>\
+		', data))
+	}
+});
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 3e0d783..9a877c6 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -22,9 +22,10 @@
 cur_frm.cscript.sales_team_fname = "sales_team";
 
 
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 
 // ONLOAD
@@ -355,7 +356,6 @@
 	return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s"	ORDER BY	`tabTerritory`.`name` ASC LIMIT 50';
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Sales Order',
diff --git a/erpnext/selling/page/sales_dashboard/sales_dashboard.js b/erpnext/selling/page/sales_dashboard/sales_dashboard.js
index 1af5cb4..e89c7fb 100644
--- a/erpnext/selling/page/sales_dashboard/sales_dashboard.js
+++ b/erpnext/selling/page/sales_dashboard/sales_dashboard.js
@@ -22,8 +22,8 @@
   $dh(pscript.mnt_div1);
   //pscript.dx_axis = [];
 
-	wn.require('lib/css/jqpot.css');
-	wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
+	wn.require('lib/css/lib/jqplot.css');
+	wn.require('lib/js/lib/jqplot/jquery.jqplot.min.js');
 	pscript.all_onchnge();
 }
 //=======================================================================
diff --git a/erpnext/setup/Module Def/Setup/Setup.txt b/erpnext/setup/Module Def/Setup/Setup.txt
deleted file mode 100644
index 5a0dcf7..0000000
--- a/erpnext/setup/Module Def/Setup/Setup.txt
+++ /dev/null
@@ -1,652 +0,0 @@
-[
-	{
-		'_last_update': None,
-		'creation': '2010-11-30 22:43:08',
-		'disabled': 'No',
-		'docstatus': 0,
-		'doctype': 'Module Def',
-		'doctype_list': None,
-		'file_list': None,
-		'idx': None,
-		'is_hidden': 'No',
-		'last_updated_date': '2011-03-21 12:13:39',
-		'modified': '2010-09-25 00:00:00',
-		'modified_by': 'Administrator',
-		'module_desc': None,
-		'module_icon': 'wired.png',
-		'module_label': 'Setup',
-		'module_name': 'Setup',
-		'module_page': 'Setup',
-		'module_seq': 1,
-		'name': 'Setup',
-		'owner': 'Administrator',
-		'parent': None,
-		'parentfield': None,
-		'parenttype': None,
-		'trash_reason': None,
-		'widget_code': None
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'All important setup items in one place',
-		'display_name': 'Setup Wizard',
-		'doc_name': 'Setup Wizard',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'lightbulb.gif',
-		'idx': 1,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00221',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Personalize settings like company banner, date format, print format header etc.',
-		'display_name': 'Personalize',
-		'doc_name': 'Personalize Page',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'star.gif',
-		'idx': 2,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00222',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Enable / Disable users. Set user roles.',
-		'display_name': 'Manage Users',
-		'doc_name': 'Manage Users',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'group.gif',
-		'idx': 3,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00223',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Set global default values and account settings',
-		'display_name': 'Setup Defaults',
-		'doc_name': 'Manage Account',
-		'doc_type': 'Single DocType',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'folder.gif',
-		'idx': 4,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00224',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'General Masters',
-		'display_name': 'Setup Masters',
-		'doc_name': 'Setup Masters',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'wrench.gif',
-		'idx': 5,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00225',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': None,
-		'display_name': 'Sales Browser',
-		'doc_name': 'Sales Browser',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 6,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00226',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': None,
-		'doc_name': None,
-		'doc_type': 'Separator',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 7,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003107',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': "Import data like Customers, Items etc in 'CSV' format",
-		'display_name': 'Import Data',
-		'doc_name': 'Import Data',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'disk.gif',
-		'idx': 8,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00228',
-		'owner': 'nabin@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Set series prefix for transactions',
-		'display_name': 'Setup Series',
-		'doc_name': 'Naming Series',
-		'doc_type': 'Single DocType',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': 'paperclip.gif',
-		'idx': 9,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00229',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Set approval rights for transactions based on grand total and discount.',
-		'display_name': 'Authorization Rule',
-		'doc_name': 'Authorization Rule',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': 'transaction\nbased_on\nmaster_name\nsystem_user\nsystem_role\napproving_role\napproving_user\nvalue',
-		'hide': None,
-		'icon': 'accept.gif',
-		'idx': 10,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00230',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Add fields in transactions, masters...',
-		'display_name': 'Custom Field',
-		'doc_name': 'Custom Field',
-		'doc_type': 'Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': 'dt\nlabel\nfieldtype\noptions',
-		'hide': None,
-		'icon': 'paperclip.gif',
-		'idx': 11,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00231',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2010-11-30 22:43:08',
-		'description': 'Contains records that you have trashed.',
-		'display_name': 'Trash',
-		'doc_name': 'Trash',
-		'doc_type': 'Pages',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 12,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': 'MDI00232',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Price List',
-		'doc_name': 'Price List',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 13,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003108',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Warehouse Type',
-		'doc_name': 'Warehouse Type',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 14,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003109',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Warehouse',
-		'doc_name': 'Warehouse',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 15,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003110',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'UOM',
-		'doc_name': 'UOM',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 16,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003111',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Term',
-		'doc_name': 'Term',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 17,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003112',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Taxes and Charges',
-		'doc_name': 'Other Charges',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 18,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003113',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Business Letter Type',
-		'doc_name': 'Business Letter Type',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 19,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003114',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Business Letter Template',
-		'doc_name': 'Business Letter Template',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 20,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003115',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'click_function': None,
-		'creation': '2011-03-24 15:04:47',
-		'description': None,
-		'display_name': 'Mode of Payment',
-		'doc_name': 'Mode of Payment',
-		'doc_type': 'Setup Forms',
-		'docstatus': 0,
-		'doctype': 'Module Def Item',
-		'fields': None,
-		'hide': None,
-		'icon': None,
-		'idx': 21,
-		'modified': '2011-03-24 15:04:47',
-		'modified_by': 'Administrator',
-		'name': '000003116',
-		'owner': 'harshada@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 1,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00042',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Administrator'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 2,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00043',
-		'owner': 'Administrator',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'System Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 3,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00044',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Sales User'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 4,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00045',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Sales Master Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 5,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00046',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Sales Master Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 6,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00047',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Purchase User'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 7,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00048',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Purchase Master Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 8,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00049',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Purchase Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 9,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00050',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Material User'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 10,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00051',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Material Master Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 11,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00052',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Material Manager'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 12,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00053',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Accounts User'
-	},
-	{
-		'creation': '2010-11-30 22:43:08',
-		'docstatus': 0,
-		'doctype': 'Module Def Role',
-		'idx': 13,
-		'modified': '2010-11-30 22:43:08',
-		'modified_by': 'Administrator',
-		'name': 'MDR00054',
-		'owner': 'saumil@webnotestech.com',
-		'parent': 'Setup',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def',
-		'role': 'Accounts Manager'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/setup/Role/System Manager/System Manager.txt b/erpnext/setup/Role/System Manager/System Manager.txt
deleted file mode 100644
index 0918bc4..0000000
--- a/erpnext/setup/Role/System Manager/System Manager.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Role, System Manager
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2010-08-08 17:08:51',
-		'docstatus': 0,
-		'modified': '2009-07-07 17:00:24',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all Role
-	{
-		'doctype': 'Role',
-		'module': 'Setup',
-		'name': '__common__',
-		'role_name': 'System Manager'
-	},
-
-	# Role, System Manager
-	{
-		'doctype': 'Role',
-		'name': 'System Manager'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/setup/__init__.py b/erpnext/setup/__init__.py
index e69de29..dad1873 100644
--- a/erpnext/setup/__init__.py
+++ b/erpnext/setup/__init__.py
@@ -0,0 +1,3 @@
+install_docs = [
+	{'doctype':'Role', 'name': 'System Manager'}
+]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js
index 1194756..0c315f6 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.js
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.js
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-$import(Contact Control)
+wn.require('erpnext/setup/doctype/contact_control/contact_control.js');
 
 cur_frm.cscript.onload = function(doc,dt,dn){
 	// history doctypes and scripts
@@ -48,7 +48,7 @@
 
 cur_frm.cscript.make_address = function() {
 	if(!cur_frm.address_list) {
-		cur_frm.address_list = new wn.widgets.Listing({
+		cur_frm.address_list = new wn.ui.Listing({
 			parent: cur_frm.fields_dict['Address HTML'].wrapper,
 			page_length: 2,
 			new_doctype: "Address",
@@ -80,7 +80,7 @@
 
 cur_frm.cscript.make_contact = function() {
 	if(!cur_frm.contact_list) {
-		cur_frm.contact_list = new wn.widgets.Listing({
+		cur_frm.contact_list = new wn.ui.Listing({
 			parent: cur_frm.fields_dict['Contact HTML'].wrapper,
 			page_length: 2,
 			new_doctype: "Contact",
diff --git a/erpnext/setup/page/import_data/import_data.js b/erpnext/setup/page/import_data/import_data.js
index aeb7dad..734c16d 100644
--- a/erpnext/setup/page/import_data/import_data.js
+++ b/erpnext/setup/page/import_data/import_data.js
@@ -47,7 +47,7 @@
 								
 								dt.onclick = function(){ 
 									var ovr = $('input[name="overwrite"]:checked').length;
-										window.location = outUrl + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
+										window.location = wn.request.url + '?cmd=get_template&dt=' + this.nm + (ovr ? '&overwrite=1' : '');
 								}
 							}
 						}	
diff --git a/erpnext/setup/page/modules_setup/modules_setup.js b/erpnext/setup/page/modules_setup/modules_setup.js
index af7522f..c7f80fc 100644
--- a/erpnext/setup/page/modules_setup/modules_setup.js
+++ b/erpnext/setup/page/modules_setup/modules_setup.js
@@ -1,4 +1,4 @@
-wn.require('lib/js/lib/jquery-ui-sortable.min.js');
+wn.require('lib/js/lib/jquery/jquery.ui.sortable.js');
 
 $.extend(wn.pages.modules_setup, {
 	modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Production', 'Projects', 
diff --git a/erpnext/startup/js/modules.js b/erpnext/startup/js/modules.js
index d43b021..2e0e701 100644
--- a/erpnext/startup/js/modules.js
+++ b/erpnext/startup/js/modules.js
@@ -61,7 +61,7 @@
 
 erpnext.module_page.make_list = function(module, wrapper) {
 	// make project listing
-	wrapper.list = new wn.widgets.Listing({
+	wrapper.list = new wn.ui.Listing({
 		parent: $(wrapper).find('.reports-list').get(0),
 		method: 'utilities.get_report_list',
 		render_row: function(row, data) {
diff --git a/erpnext/stock/Module Def/Stock/Stock.txt b/erpnext/stock/Module Def/Stock/Stock.txt
deleted file mode 100644
index 991d410..0000000
--- a/erpnext/stock/Module Def/Stock/Stock.txt
+++ /dev/null
@@ -1,242 +0,0 @@
-# Module Def, Stock
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2011-07-01 17:40:49',
-		'docstatus': 0,
-		'modified': '2012-02-01 15:43:00',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'name': '__common__',
-		'parent': 'Stock',
-		'parentfield': 'roles',
-		'parenttype': 'Module Def'
-	},
-
-	# These values are common for all Module Def Item
-	{
-		'doctype': 'Module Def Item',
-		'name': '__common__',
-		'parent': 'Stock',
-		'parentfield': 'items',
-		'parenttype': 'Module Def'
-	},
-
-	# These values are common for all Module Def
-	{
-		'disabled': 'No',
-		'doctype': u'Module Def',
-		'doctype_list': 'DocType Label, QA Inspection Report',
-		'is_hidden': 'No',
-		'module_desc': 'Material Management',
-		'module_icon': 'Stock.gif',
-		'module_label': 'Stock',
-		'module_name': 'Stock',
-		'module_seq': 7,
-		'name': '__common__'
-	},
-
-	# Module Def, Stock
-	{
-		'doctype': u'Module Def',
-		'name': 'Stock'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Item master',
-		'display_name': 'Item',
-		'doc_name': 'Item',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'name\nitem_group\ndescription'
-	},
-
-	# Module Def Item
-	{
-		'description': 'A unique number identifying each entity of an item',
-		'display_name': 'Serial No',
-		'doc_name': 'Serial No',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'item_code\nstatus\nwarehouse\npr_no\ndelivery_note_no\ncustomer'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Record of items added, removed or moved from one warehouse to another.',
-		'display_name': 'Stock Entry',
-		'doc_name': 'Stock Entry',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'transfer_date\npurpose\nfrom_warehouse\nto_warehouse\nremarks'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Record of items delivered to your customers along with the Printed Note',
-		'display_name': 'Delivery Note',
-		'doc_name': 'Delivery Note',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'status\ntransaction_date\ncustomer\nterritory\ngrand_total\nper_billed'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Generate Packing Slips based on a Delivery Note',
-		'display_name': 'Packing Slip',
-		'doc_name': 'Packing Slip',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'delivery_note\nfrom_case_no\nto_case_no\nnet_weight_pkg\ngross_weight_pkg'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Record of incoming material from your suppliers',
-		'display_name': 'Purchase Receipt',
-		'doc_name': 'Purchase Receipt',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'status\ntransaction_date\nsupplier\ngrand_total\nper_billed'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Details of Installation done after delivery',
-		'display_name': 'Installation Note',
-		'doc_name': 'Installation Note',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Create Quality Inspection Report for any item',
-		'display_name': 'Inspection Report',
-		'doc_name': 'QA Inspection Report',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'inspection_type\nitem_code\nreport_date\npurchase_receipt_no\ndelivery_note_no'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Reconcile your stock by uploading it form an excel file',
-		'display_name': 'Stock Reconciliation',
-		'doc_name': 'Stock Reconciliation',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'fields': 'reconciliation_date\nreconciliation_time\nremark'
-	},
-
-	# Module Def Item
-	{
-		'description': 'This utility tool will update Stock UOM in Item and will respectively update Actual Qty in Stock Ledger as per Conversion Factor.',
-		'display_name': 'Stock UOM Replace Utility',
-		'doc_name': 'Stock UOM Replace Utility',
-		'doc_type': 'Single DocType',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'This utility will help in tracking stock for Sales Return and Purchase Return.',
-		'display_name': 'Sales and Purchase Return Wizard',
-		'doc_name': 'Sales and Purchase Return Wizard',
-		'doc_type': 'Single DocType',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'You can create master template for landed cost wizard',
-		'display_name': 'Landed Cost Master',
-		'doc_name': 'Landed Cost Master',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'icon': 'accept.gif'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Add extra expenses into Purchase Receipt which should be consider for item valuation. The cost will be added proportionately as per purchase receipt value.',
-		'display_name': 'Landed Cost Wizard',
-		'doc_name': 'Landed Cost Wizard',
-		'doc_type': 'Forms',
-		'doctype': 'Module Def Item',
-		'icon': 'accept.gif'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Stock Ledger',
-		'doc_name': 'Stock Ledger Entry',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Stock Level',
-		'doc_name': 'Bin',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Shortage To Indent',
-		'doc_name': 'Item',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'description': 'Stock Value as per Item and Warehouse',
-		'display_name': 'Stock Report',
-		'doc_name': 'Stock Ledger Entry',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Item
-	{
-		'display_name': 'Stock Aging Report',
-		'doc_name': 'Serial No',
-		'doc_type': 'Reports',
-		'doctype': 'Module Def Item'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Material User'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Material Master Manager'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Material Manager'
-	},
-
-	# Module Def Role
-	{
-		'doctype': 'Module Def Role',
-		'role': 'Quality Manager'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index d2b58f8..95bd7bf 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -20,9 +20,10 @@
 cur_frm.cscript.other_fname = "other_charges";
 cur_frm.cscript.sales_team_fname = "sales_team";
 
-$import(Sales Common)
-$import(Other Charges)
-$import(SMS Control)
+wn.require('erpnext/selling/doctype/sales_common/sales_common.js');
+wn.require('erpnext/setup/doctype/other_charges/other_charges.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 // ONLOAD
 // ================================================================================================
@@ -322,7 +323,6 @@
 	return out;
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Delivery Note',
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index 7ad9d91..921eede 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -18,9 +18,10 @@
 cur_frm.cscript.fname = "purchase_receipt_details";
 cur_frm.cscript.other_fname = "purchase_tax_details";
 
-$import(Purchase Common)
-$import(Purchase Other Charges)
-$import(SMS Control)
+wn.require('erpnext/buying/doctype/purchase_other_charges/purchase_other_charges.js');
+wn.require('erpnext/buying/doctype/purchase_common/purchase_common.js');
+wn.require('erpnext/utilities/doctype/sms_control/sms_control.js');
+wn.require('erpnext/setup/doctype/notification_control/notification_control.js');
 
 //========================== On Load ================================================================
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
@@ -315,7 +316,6 @@
 	return out;
 }
 
-$import(Notification Control)
 cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
 	var args = {
 		type: 'Purchase Receipt',
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js
index 86264a6..a51b83a 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.js
+++ b/erpnext/support/doctype/support_ticket/support_ticket.js
@@ -73,7 +73,7 @@
 		cur_frm.fields_dict['Thread HTML'].wrapper.innerHTML = '';
 		
 		// render first message
-		new EmailMessage(cur_frm.fields_dict['Thread HTML'].wrapper, {
+		new EmailMessage($a(cur_frm.fields_dict['Thread HTML'].wrapper, 'div'), {
 			from_email: doc.raised_by,
 			creation: doc.creation,
 			mail: doc.description,
@@ -81,8 +81,8 @@
 		}, null, -1)
 		
 		// render thread		
-		cs.thread_list = new wn.widgets.Listing({
-			parent: cur_frm.fields_dict['Thread HTML'].wrapper,
+		cs.thread_list = new wn.ui.Listing({
+			parent: $a(cur_frm.fields_dict['Thread HTML'].wrapper, 'div'),
 			no_result_message: 'No responses yet',
 			get_query: function() {
 				return 'select mail, from_email, creation, content_type '+
@@ -188,7 +188,7 @@
 		);
 		
 		// show only first and last message
-		if(idx==-1 || list && list.values.length-1==idx) {
+		if(idx==-1 || list && list.data.length-1==idx) {
 			$ds(this.message)
 		}
 		
diff --git a/erpnext/utilities/Module Def/Utilities/Utilities.txt b/erpnext/utilities/Module Def/Utilities/Utilities.txt
deleted file mode 100644
index 98b4d0f..0000000
--- a/erpnext/utilities/Module Def/Utilities/Utilities.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-# Module Def, Utilities
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2011-07-01 17:46:25',
-		'docstatus': 0,
-		'modified': '2011-07-01 17:47:34',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all Module Def
-	{
-		'disabled': 'No',
-		'doctype': 'Module Def',
-		'is_hidden': 'No',
-		'module_label': 'Utilities',
-		'module_name': 'Utilities',
-		'name': '__common__'
-	},
-
-	# Module Def, Utilities
-	{
-		'doctype': 'Module Def',
-		'name': 'Utilities'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/utilities/page/messages/messages.js b/erpnext/utilities/page/messages/messages.js
index 6937796..7e74fef 100644
--- a/erpnext/utilities/page/messages/messages.js
+++ b/erpnext/utilities/page/messages/messages.js
@@ -91,7 +91,7 @@
 		return user;	
 	},
 	make_list: function() {
-		erpnext.messages.list = new wn.widgets.Listing({
+		erpnext.messages.list = new wn.ui.Listing({
 			parent: $('#message-list').get(0),
 			method: 'utilities.page.messages.messages.get_list',
 			args: {
diff --git a/erpnext/utilities/page/messages/messages.py b/erpnext/utilities/page/messages/messages.py
index b282991..3a407dd 100644
--- a/erpnext/utilities/page/messages/messages.py
+++ b/erpnext/utilities/page/messages/messages.py
@@ -56,8 +56,12 @@
 @webnotes.whitelist()
 def post(arg=None):
 	"""post message"""
-	import json
-	arg = json.loads(arg)
+	if arg:
+		import json
+		arg = json.loads(arg)
+	else:
+		arg = {}
+		arg.update(webnotes.form_dict)
 	from webnotes.model.doc import Document
 	d = Document('Comment Widget Record')
 	d.comment = arg['txt']
@@ -69,4 +73,4 @@
 def delete(arg=None):
 	webnotes.conn.sql("""delete from `tabComment Widget Record` where name=%s""", 
 		webnotes.form_dict['name']);
-	
\ No newline at end of file
+	
diff --git a/erpnext/utilities/page/todo/todo.css b/erpnext/utilities/page/todo/todo.css
index 4ac49d6..b7c9f20 100644
--- a/erpnext/utilities/page/todo/todo.css
+++ b/erpnext/utilities/page/todo/todo.css
@@ -3,6 +3,7 @@
 	border-bottom: 1px solid #DEB85F;
 	margin-bottom: 5px;
 	height: 14px;
+	clear: both;
 }
 
 .todoitem .label {
diff --git a/erpnext/utilities/page/todo/todo.html b/erpnext/utilities/page/todo/todo.html
index 3400455..32a0a78 100644
--- a/erpnext/utilities/page/todo/todo.html
+++ b/erpnext/utilities/page/todo/todo.html
@@ -4,7 +4,7 @@
 	<br>
 	<div id="todo-list">
 	</div>
-	<div style="margin-top: 21px">
+	<div style="margin-top: 21px; clear: both">
 		<button id="add-todo" class="btn btn-small"><i class="icon-plus"></i> Add</button>
 	</div>
 </div>
\ No newline at end of file
diff --git a/erpnext/utilities/page/users/users.js b/erpnext/utilities/page/users/users.js
index 130e538..9ce622e 100644
--- a/erpnext/utilities/page/users/users.js
+++ b/erpnext/utilities/page/users/users.js
@@ -269,8 +269,8 @@
 			</div>', {role: this.roles[i]}));
 		}
 		$(this.dialog.body).append('<div style="clear: both">\
-			<button class="btn btn-small btn-primary">Save</button></div>');
-		$(this.dialog.body).find('button.btn-primary').click(function() {
+			<button class="btn btn-small btn-info">Save</button></div>');
+		$(this.dialog.body).find('button.btn-info').click(function() {
 			me.save();
 		});
 		$(this.dialog.body).find('.user-role a').click(function() {
@@ -314,7 +314,7 @@
 				unset_roles: JSON.stringify(unset_roles),
 				uid: this.uid
 			},
-			btn: $(this.dialog.body).find('.btn-primary').get(0),
+			btn: $(this.dialog.body).find('.btn-info').get(0),
 			callback: function() {
 				
 			}
diff --git a/erpnext/website/doctype/blog/blog_page.js b/erpnext/website/doctype/blog/blog_page.js
index 76cbf81..d419a0b 100644
--- a/erpnext/website/doctype/blog/blog_page.js
+++ b/erpnext/website/doctype/blog/blog_page.js
@@ -21,7 +21,7 @@
 	var side = $(wrapper).find('.web-side-section')
 		.append('<h4>Recent Posts</h4>').get(0);
 		
-	wrapper.recent_list = new wn.widgets.Listing({
+	wrapper.recent_list = new wn.ui.Listing({
 		parent: side,
 		query: 'select name, title, left(content, 100) as content from tabBlog\
 			where ifnull(published,1)=1',
@@ -39,7 +39,7 @@
 	// comments
 	$(wrapper).find('.web-main-section').append('<hr><h3>Comments</h3>');
 
-	wrapper.comment_list = new wn.widgets.Listing({
+	wrapper.comment_list = new wn.ui.Listing({
 		parent: $(wrapper).find('.web-main-section').get(0),
 		query: 'select comment, comment_by_fullname, modified\
 			from `tabComment Widget Record` where comment_doctype="Page"\
diff --git a/erpnext/website/doctype/product/product_page.js b/erpnext/website/doctype/product/product_page.js
index 0f0c56b..926ef69 100644
--- a/erpnext/website/doctype/product/product_page.js
+++ b/erpnext/website/doctype/product/product_page.js
@@ -30,7 +30,7 @@
 	});
 	
 	// similar products
-	wrapper.similar = new wn.widgets.Listing({
+	wrapper.similar = new wn.ui.Listing({
 		parent: $(wrapper).find('.similar-products').get(0),
 		hide_refresh: true,
 		page_length: 5,
diff --git a/erpnext/website/js/product_category.js b/erpnext/website/js/product_category.js
index 9e0c7f0..956d7a6 100644
--- a/erpnext/website/js/product_category.js
+++ b/erpnext/website/js/product_category.js
@@ -18,7 +18,7 @@
 erpnext.product_item_group = {}
 
 erpnext.make_product_categories = function(wrapper) {
-	wrapper.category_list = new wn.widgets.Listing({
+	wrapper.category_list = new wn.ui.Listing({
 		parent: $(wrapper).find('.more-categories').get(0),
 		query: 'select label, count(t2.name) as items, t1.item_group \
 			from `tabProduct Group` t1, `tabProduct` t2, tabItem t3\
diff --git a/erpnext/website/page/blog/blog.js b/erpnext/website/page/blog/blog.js
index 9ca7392..bc7aec4 100644
--- a/erpnext/website/page/blog/blog.js
+++ b/erpnext/website/page/blog/blog.js
@@ -16,7 +16,7 @@
 
 
 pscript.onload_blog = function(wrapper) {
-	wrapper.blog_list = new wn.widgets.Listing({
+	wrapper.blog_list = new wn.ui.Listing({
 		parent: $(wrapper).find('.web-main-section').get(0),
 		query: 'select tabBlog.name, title, left(content, 300) as content, tabBlog.modified, \
 			ifnull(first_name, "") as first_name, ifnull(last_name, "") as last_name \
diff --git a/erpnext/website/page/products/products.js b/erpnext/website/page/products/products.js
index 7af551e..09ccba0 100644
--- a/erpnext/website/page/products/products.js
+++ b/erpnext/website/page/products/products.js
@@ -57,7 +57,7 @@
 }
 
 erpnext.products.make_product_list = function(wrapper) {
-	wrapper.mainlist = new wn.widgets.Listing({
+	wrapper.mainlist = new wn.ui.Listing({
 		parent: $(wrapper).find('.web-main-section').get(0),
 		run_btn: $(wrapper).find('.products-search .btn').get(0),
 		hide_refresh: true,
diff --git a/js/all-app.js b/js/all-app.js
index abb3c08..b38b1ec 100644
--- a/js/all-app.js
+++ b/js/all-app.js
Binary files differ
diff --git a/js/all-web.js b/js/all-web.js
index 5133644..7c9f9cd 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -1,7 +1,8 @@
 
 /*
  *	lib/js/lib/history/history.min.js
- *//*
+ */
+/*
  * jQuery hashchange event - v1.3 - 7/21/2010
  * http://benalman.com/projects/jquery-hashchange-plugin/
  * 
@@ -28,9 +29,12 @@
 	});	
 })
 
+
 /*
  *	lib/js/lib/bootstrap.min.js
- */!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=a.extend({},a.fn.modal.defaults,c),this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this;if(this.isShown)return;a("body").addClass("modal-open"),this.isShown=!0,this.$element.trigger("show"),g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");!b.$element.parent().length&&b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();if(!this.isShown)return;var e=this;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.trigger("hide").removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=typeof c=="object"&&c;e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.show?c.show():(c.hoverState="in",setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show))},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.hide?c.hide():(c.hoverState="out",setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide))},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip();a.find(".tooltip-inner").html(this.getTitle()),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,delay:0,selector:!1,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var b=this.tip(),c=this.getTitle(),d=this.getContent();b.find(".popover-title")[a.type(c)=="object"?"append":"html"](c),b.find(".popover-content > *")[a.type(d)=="object"?"append":"html"](d),b.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body").on("click.scroll.data-api",this.selector,d),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var b=a(this).attr("href");return/^#\w/.test(b)&&a(b).length?b:null}),this.offsets=a.map(this.targets,function(b){return a(b).position().top})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.offsets,c=this.targets,d=this.activeTarget,e;for(e=b.length;e--;)d!=c[e]&&a>=b[e]&&(!b[e+1]||a<=b[e+1])&&this.activate(c[e])},activate:function(a){var b;this.activeTarget=a,this.$body.find(this.selector).parent(".active").removeClass("active"),b=this.$body.find(this.selector+'[href="'+a+'"]').parent("li").addClass("active"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],b.trigger({type:"show",relatedTarget:e}),f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(a),this.hide()},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){if(c.matcher(a))return a}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){return a.replace(new RegExp("("+this.query+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){a.stopPropagation(),a.preventDefault();switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:this.hide();break;default:this.lookup()}},keypress:function(a){a.stopPropagation();if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}},blur:function(a){var b=this;a.stopPropagation(),a.preventDefault(),setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery);
+ */
+!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=a.extend({},a.fn.modal.defaults,c),this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this;if(this.isShown)return;a("body").addClass("modal-open"),this.isShown=!0,this.$element.trigger("show"),g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");!b.$element.parent().length&&b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();if(!this.isShown)return;var e=this;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.trigger("hide").removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=typeof c=="object"&&c;e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.show?c.show():(c.hoverState="in",setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show))},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.hide?c.hide():(c.hoverState="out",setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide))},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip();a.find(".tooltip-inner").html(this.getTitle()),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,delay:0,selector:!1,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var b=this.tip(),c=this.getTitle(),d=this.getContent();b.find(".popover-title")[a.type(c)=="object"?"append":"html"](c),b.find(".popover-content > *")[a.type(d)=="object"?"append":"html"](d),b.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body").on("click.scroll.data-api",this.selector,d),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var b=a(this).attr("href");return/^#\w/.test(b)&&a(b).length?b:null}),this.offsets=a.map(this.targets,function(b){return a(b).position().top})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.offsets,c=this.targets,d=this.activeTarget,e;for(e=b.length;e--;)d!=c[e]&&a>=b[e]&&(!b[e+1]||a<=b[e+1])&&this.activate(c[e])},activate:function(a){var b;this.activeTarget=a,this.$body.find(this.selector).parent(".active").removeClass("active"),b=this.$body.find(this.selector+'[href="'+a+'"]').parent("li").addClass("active"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],b.trigger({type:"show",relatedTarget:e}),f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(a),this.hide()},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){if(c.matcher(a))return a}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){return a.replace(new RegExp("("+this.query+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){a.stopPropagation(),a.preventDefault();switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:this.hide();break;default:this.lookup()}},keypress:function(a){a.stopPropagation();if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}},blur:function(a){var b=this;a.stopPropagation(),a.preventDefault(),setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery);
+
 /*
  *	lib/js/lib/sprintf.js
  */
@@ -61,6 +65,7 @@
 /*
  *	lib/js/core.min.js
  */
+
 /*
  *	lib/js/wn/class.js
  */;(function(){var initializing=false,fnTest=/xyz/.test(function(){xyz;})?/\b_super\b/:/.*/;this.Class=function(){};Class.extend=function(prop){var _super=this.prototype;initializing=true;var prototype=new this();initializing=false;for(var name in prop){prototype[name]=typeof prop[name]=="function"&&typeof _super[name]=="function"&&fnTest.test(prop[name])?(function(name,fn){return function(){var tmp=this._super;this._super=_super[name];var ret=fn.apply(this,arguments);this._super=tmp;return ret;};})(name,prop[name]):prop[name];}
@@ -75,13 +80,6 @@
 parent=parent[n];}}
 wn.provide('wn.settings');wn.provide('wn.ui');
 /*
- *	lib/js/wn/xmlhttp.js
- */
-wn.xmlhttp={request:function(){if(window.XMLHttpRequest)
-return new XMLHttpRequest();else if(window.ActiveXObject)
-return new ActiveXObject("MsXml2.XmlHttp");},complete:function(req,callback,url){if(req.status==200||req.status==304){callback(req.responseText);}else{alert(url+' request error: '+req.statusText+' ('+req.status+')');}},get:function(url,callback,args,async){if(async===null)async=true;var req=wn.xmlhttp.request();req.onreadystatechange=function(){if(req.readyState==4){wn.xmlhttp.complete(req,callback,url)}}
-var sep=((args&&args.indexOf('?'))==-1)?'?':'&';var u=args?(url+sep+args):url;req.open('GET',u,async);req.send(null);if(!async){wn.xmlhttp.complete(req,callback,url)}}}
-/*
  *	lib/js/wn/versions.js
  */
 wn.versions={check:function(){if(window.localStorage){if(window._version_number==-1||parseInt(localStorage._version_number)!=parseInt(window._version_number)){var localversion=localStorage._version_number;localStorage.clear();console.log("Cache cleared - version: "+localversion
@@ -92,7 +90,7 @@
  */
 wn.assets={executed_:{},exists:function(src){if('localStorage'in window&&localStorage.getItem(src))
 return true},add:function(src,txt){if('localStorage'in window){localStorage.setItem(src,txt);}},get:function(src){return localStorage.getItem(src);},extn:function(src){if(src.indexOf('?')!=-1){src=src.split('?').slice(-1)[0];}
-return src.split('.').slice(-1)[0];},load:function(src){var t=src;wn.xmlhttp.get(t,function(txt){wn.assets.add(src,txt);},'q='+Math.floor(Math.random()*1000),false)},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);}
+return src.split('.').slice(-1)[0];},load:function(src){var t=src;$.ajax({url:t,data:{q:Math.floor(Math.random()*1000)},dataType:'text',success:function(txt){wn.assets.add(src,txt);},async:false})},execute:function(src){if(!wn.assets.exists(src)){wn.assets.load(src);}
 var type=wn.assets.extn(src);if(wn.assets.handler[type]){wn.assets.handler[type](wn.assets.get(src),src);wn.assets.executed_[src]=1;}},handler:{js:function(txt,src){wn.dom.eval(txt);},css:function(txt,src){var se=document.createElement('style');se.type="text/css";if(se.styleSheet){se.styleSheet.cssText=txt;}else{se.appendChild(document.createTextNode(txt));}
 document.getElementsByTagName('head')[0].appendChild(se);},cgi:function(txt,src){wn.dom.eval(txt)}}}
 /*
@@ -112,8 +110,11 @@
 c.className=className;}
 if(cs)wn.dom.css(c,cs);if(innerHTML)c.innerHTML=innerHTML;if(onclick)c.onclick=onclick;return c;}
 wn.dom.css=function(ele,s){if(ele&&s){for(var i in s)ele.style[i]=s[i];};return ele;}
-wn.dom.hide=function(ele){ele.style.display='none';}
-wn.dom.show=function(ele,value){if(!value)value='block';ele.style.display=value;}
+wn.get_cookie=function(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind==-1||c=="")return"";var ind1=t.indexOf(';',ind);if(ind1==-1)ind1=t.length;return unescape(t.substring(ind+c.length+1,ind1));}
+/*
+ *	lib/js/wn/model.js
+ */
+wn.provide('wn.model');wn.model.no_value_type=['Section Break','Column Break','HTML','Table','Button','Image'];wn.model.can_delete=function(doctype){if(!doctype)return false;return locals.DocType[doctype].allow_trash&&wn.boot.profile.can_cancel.indexOf(doctype)!=-1;}
 /*
  *	lib/js/wn/page.js
  */
@@ -159,15 +160,29 @@
 if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
 throw new SyntaxError('JSON.parse');};}}());
 /*
+ *	lib/js/wn/request.js
+ */
+wn.provide('wn.request');wn.request.url='index.cgi';wn.request.prepare=function(opts){if(opts.btn)$(opts.btn).set_working();if(opts.show_spinner)set_loading();if(opts.freeze)freeze();if(!opts.args.cmd){console.log(opts)
+throw"Incomplete Request";}}
+wn.request.cleanup=function(opts,r){if(opts.btn)$(opts.btn).done_working();if(opts.show_spinner)hide_loading();if(opts.freeze)unfreeze();if(wn.boot.sid&&wn.get_cookie('sid')!=wn.boot.sid){msgprint('Session expired');setTimeout('redirect_to_login()',3000);return;}
+if(r.server_messages)msgprint(r.server_messages)
+if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.docs)LocalDB.sync(r.docs);}
+wn.request.call=function(opts){wn.request.prepare(opts);$.ajax({url:opts.url||wn.request.url,data:opts.args,type:opts.type||'POST',dataType:opts.dataType||'json',success:function(r,xhr){wn.request.cleanup(opts,r);opts.success(r,xhr.responseText);},error:function(xhr,textStatus){wn.request.cleanup(opts,{});msgprint('Unable to complete request: '+textStatus)
+if(opts.error)opts.error(xhr)}})}
+wn.call=function(opts){var args=opts.args||{};if(opts.module&&opts.page){args.cmd=opts.module+'.page.'+opts.page+'.'+opts.page+'.'+opts.method}else if(opts.method){args.cmd=opts.method;}
+for(key in args){if(args[key]&&typeof args[key]!='string'){args[key]=JSON.stringify(args[key]);}}
+wn.request.call({args:args,success:opts.callback,error:opts.error,btn:opts.btn,freeze:opts.freeze,show_spinner:!opts.no_spinner});}
+/*
  *	lib/js/core.js
  */
 if(!console){var console={log:function(txt){errprint(txt);}}}
 wn.versions.check();$(document).bind('ready',function(){var base=window.location.href.split('#')[0];$.each($('a[softlink!="false"]'),function(i,v){if(v.href.substr(0,base.length)==base){var path=(v.href.substr(base.length));if(path.substr(0,1)!='#'){v.href=base+'#'+path;}}});if(!wn.settings.no_history&&window.location.hash){wn.page.set(window.location.hash.substr(1));}});
+
 /*
  *	lib/js/legacy/globals.js
  */
 wn.provide('wn.widgets.form');wn.provide('wn.widgets.report');wn.provide('wn.utils');wn.provide('wn.model');wn.provide('wn.profile');wn.provide('wn.session');wn.provide('_f');wn.provide('_p');wn.provide('_r');wn.provide('_c');wn.provide('_e');wn.provide('_startup_data')
-wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var hide_autosuggest=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;var cur_autosug=null;
+wn.settings.no_history=1;var NEWLINE='\n';var login_file='';var version='v170';var profile=null;var session={};var is_testing=false;var user=null;var user_defaults=null;var user_roles=null;var user_fullname=null;var user_email=null;var user_img={};var home_page=null;var page_body=null;var pscript={};var selector=null;var top_index=91;var _f={};var _p={};var _e={};var _r={};var FILTER_SEP='\1';var frms={};var cur_frm=null;var pscript={};var validated=true;var validation_message='';var tinymce_loaded=null;
 /*
  *	lib/js/legacy/utils/datatype.js
  */
@@ -198,7 +213,7 @@
 function nth(number){number=cint(number);var s='th';if((number+'').substr(-1)=='1')s='st';if((number+'').substr(-1)=='2')s='nd';if((number+'').substr(-1)=='3')s='rd';return number+s;}
 function flt(v,decimals){if(v==null||v=='')return 0;v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v))
 v=0;if(decimals!=null)
-return v.toFixed(decimals);return v;}
+return parseFloat(v.toFixed(decimals));return v;}
 function esc_quotes(s){if(s==null)s='';return s.replace(/'/,"\'");}
 var crop=function(s,len){if(s.length>len)
 return s.substr(0,len-3)+'...';else
@@ -280,13 +295,13 @@
  */
 wn.dom.set_unique_id=function(ele){var id='unique-'+wn.dom.id_count;ele.setAttribute('id',id);wn.dom.id_count++;return id;}
 wn.tinymce={add_simple:function(ele,height){if(ele.myid){tinyMCE.execCommand('mceAddControl',true,ele.myid);return;}
-ele.myid=wn.dom.set_unique_id(ele);$(ele).tinymce({script_url:'lib/js/legacy/tiny_mce_33/tiny_mce.js',height:height?height:'200px',theme:"advanced",theme_advanced_buttons1:"bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,link,unlink,forecolor,backcolor,code,",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_path:false,theme_advanced_resizing:false});},remove:function(ele){tinyMCE.execCommand('mceRemoveControl',true,ele.myid);},get_value:function(ele){return tinymce.get(ele.myid).getContent();}}
+ele.myid=wn.dom.set_unique_id(ele);$(ele).tinymce({script_url:'lib/js/lib/tiny_mce_33/tiny_mce.js',height:height?height:'200px',theme:"advanced",theme_advanced_buttons1:"bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,link,unlink,forecolor,backcolor,code,",theme_advanced_buttons2:"",theme_advanced_buttons3:"",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_path:false,theme_advanced_resizing:false});},remove:function(ele){tinyMCE.execCommand('mceRemoveControl',true,ele.myid);},get_value:function(ele){return tinymce.get(ele.myid).getContent();}}
 wn.ele={link:function(args){var span=$a(args.parent,'span','link_type',args.style);span.loading_img=$a(args.parent,'img','',{margin:'0px 4px -2px 4px',display:'none'});span.loading_img.src='lib/images/ui/button-load.gif';span.innerHTML=args.label;span.user_onclick=args.onclick;span.onclick=function(){if(!this.disabled)this.user_onclick(this);}
 span.set_working=function(){this.disabled=1;$di(this.loading_img);}
 span.done_working=function(){this.disabled=0;$dh(this.loading_img);}
 return span;}}
 function $ln(parent,label,onclick,style){return wn.ele.link({parent:parent,label:label,onclick:onclick,style:style})}
-function $btn(parent,label,onclick,style,css_class,is_ajax){wn.require('lib/js/wn/ui/button.js');if(css_class==='green')css_class='btn-primary';return new wn.ui.Button({parent:parent,label:label,onclick:onclick,style:style,is_ajax:is_ajax,css_class:css_class}).btn;}
+function $btn(parent,label,onclick,style,css_class,is_ajax){wn.require('lib/js/wn/ui/button.js');if(css_class==='green')css_class='btn-info';return new wn.ui.Button({parent:parent,label:label,onclick:onclick,style:style,is_ajax:is_ajax,css_class:css_class}).btn;}
 $item_normal=function(ele){$y(ele,{padding:'6px 8px',cursor:'pointer',marginRight:'8px',whiteSpace:'nowrap',overflow:'hidden',borderBottom:'1px solid #DDD'});$bg(ele,'#FFF');$fg(ele,'#000');}
 $item_active=function(ele){$bg(ele,'#FE8');$fg(ele,'#000');}
 $item_selected=function(ele){$bg(ele,'#777');$fg(ele,'#FFF');}
@@ -294,6 +309,9 @@
 $.fn.done_working=function(){var ele=this.get(0);ele.disabled=0;if(ele.loading_img){$dh(ele.loading_img)};}})(jQuery);function set_opacity(ele,ieop){var op=ieop/100;if(ele.filters){try{ele.filters.item("DXImageTransform.Microsoft.Alpha").opacity=ieop;}catch(e){ele.style.filter='progid:DXImageTransform.Microsoft.Alpha(opacity='+ieop+')';}}else{ele.style.opacity=op;}}
 $br=function(ele,r,corners){if(corners){var cl=['top-left','top-right','bottom-right','bottom-left'];for(var i=0;i<4;i++){if(corners[i]){$(ele).css('-moz-border-radius-'+cl[i].replace('-',''),r).css('-webkit-'+cl[i]+'-border-radius',r);}}}else{$(ele).css('-moz-border-radius',r).css('-webkit-border-radius',r).css('border-radius',r);}}
 $bs=function(ele,r){$(ele).css('-moz-box-shadow',r).css('-webkit-box-shadow',r).css('box-shadow',r);}
+function SelectWidget(parent,options,width,editable,bg_color){var me=this;this.inp=$a(parent,'select');if(options)add_sel_options(this.inp,options);if(width)$y(this.inp,{width:width});this.set_width=function(w){$y(this.inp,{width:w})};this.set_options=function(o){add_sel_options(this.inp,o);}
+this.inp.onchange=function(){if(me.onchange)me.onchange(this);}
+return;}
 function empty_select(s){if(s.custom_select){s.empty();return;}
 if(s.inp)s=s.inp;if(s){var tmplen=s.length;for(var i=0;i<tmplen;i++)s.options[0]=null;}}
 function sel_val(s){if(s.custom_select){return s.inp.value?s.inp.value:'';}
@@ -323,12 +341,9 @@
 d.style.display=t;}
 function $di(d){if(d&&d.substr)d=$i(d);if(d)d.style.display='inline';}
 function $i(id){if(!id)return null;if(id&&id.appendChild)return id;return document.getElementById(id);}
-function $t(parent,txt){if(parent.substr)parent=$i(parent);return parent.appendChild(document.createTextNode(txt));}
 function $w(e,w){if(e&&e.style&&w)e.style.width=w;}
 function $h(e,h){if(e&&e.style&&h)e.style.height=h;}
 function $bg(e,w){if(e&&e.style&&w)e.style.backgroundColor=w;}
-function $fg(e,w){if(e&&e.style&&w)e.style.color=w;}
-function $op(e,w){if(e&&e.style&&w){set_opacity(e,w);}}
 function $y(ele,s){if(ele&&s){for(var i in s)ele.style[i]=s[i];};return ele;}
 function $yt(tab,r,c,s){var rmin=r;var rmax=r;if(r=='*'){rmin=0;rmax=tab.rows.length-1;}
 if(r.search&&r.search('-')!=-1){r=r.split('-');rmin=cint(r[0]);rmax=cint(r[1]);}
@@ -354,54 +369,26 @@
 function get_scroll_top(){var st=0;if(document.documentElement&&document.documentElement.scrollTop)
 st=document.documentElement.scrollTop;else if(document.body&&document.body.scrollTop)
 st=document.body.scrollTop;return st;}
-function get_cookie(c){var t=""+document.cookie;var ind=t.indexOf(c);if(ind==-1||c=="")return"";var ind1=t.indexOf(';',ind);if(ind1==-1)ind1=t.length;return unescape(t.substring(ind+c.length+1,ind1));}
 wn.urllib={get_arg:function(name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
 return"";else
 return decodeURIComponent(results[1]);},get_dict:function(){var d={}
 var t=window.location.href.split('?')[1];if(!t)return d;if(t.indexOf('#')!=-1)t=t.split('#')[0];if(!t)return d;t=t.split('&');for(var i=0;i<t.length;i++){var a=t[i].split('=');d[decodeURIComponent(a[0])]=decodeURIComponent(a[1]);}
 return d;},get_base_url:function(){var url=window.location.href.split('#')[0].split('?')[0].split('index.cgi')[0];if(url.substr(url.length-1,1)=='/')url=url.substr(0,url.length-1)
 return url},get_file_url:function(file_id){return repl('files/%(fn)s',{fn:file_id})}}
-get_url_arg=wn.urllib.get_arg;get_url_dict=wn.urllib.get_dict;var user_img={}
-var user_img_queue={};var user_img_loading=[];set_user_img=function(img,username,get_latest,img_id){function set_it(i){if(user_img[username]=='no_img_m')
-i.src='lib/images/ui/no_img_m.gif';else if(user_img[username]=='no_img_f')
-i.src='lib/images/ui/no_img_f.gif';else{ac_id=wn.control_panel.account_id;i.src=repl('cgi-bin/getfile.cgi?ac=%(ac)s&name=%(fn)s',{fn:user_img[username],ac:ac_id});}}
-if(img_id){user_img[username]=img_id;set_it(img);return;}
-if(user_img[username]&&!get_latest){set_it(img);}else{if(in_list(user_img_loading,username)){if(!user_img_queue[username])
-user_img_queue[username]=[];user_img_queue[username].push(img);return;}
-$c('webnotes.profile.get_user_img',{username:username},function(r,rt){delete user_img_loading[user_img_loading.indexOf(username)];user_img[username]=r.message;if(user_img_queue[username]){var q=user_img_queue[username];for(var i in q){set_it(q[i]);}}
-set_it(img);},null,1);user_img_loading.push(username);}}
+get_url_arg=wn.urllib.get_arg;get_url_dict=wn.urllib.get_dict;
 /*
  *	lib/js/legacy/utils/handler.js
  */
-var outUrl="index.cgi";var NULL_CHAR='^\5*';function checkResponse(r,on_timeout,no_spinner,freeze_msg){try{if(r.readyState==4&&r.status==200)return true;else return false;}catch(e){msgprint("error:Request timed out, try again");if(on_timeout)
-on_timeout();hide_loading();if(freeze_msg)
-unfreeze();return false;}}
-var pending_req=0;function newHttpReq(){if(!$.browser.msie)
-var r=new XMLHttpRequest();else if(window.ActiveXObject)
-var r=new ActiveXObject("Microsoft.XMLHTTP");return r;}
-function $c(command,args,fn,on_timeout,no_spinner,freeze_msg,btn){var req=newHttpReq();ret_fn=function(){if(checkResponse(req,on_timeout,no_spinner,freeze_msg)){if(btn)$(btn).done_working();if(!no_spinner)
-hide_loading();var rtxt=req.responseText;try{var r=JSON.parse(rtxt);}catch(e){msgprint('Handler Exception:'+rtxt);return;}
-if(freeze_msg)unfreeze();if(!validate_session(r,rtxt))return;if(r.exc){errprint(r.exc);console.log(r.exc);};if(r.server_messages){msgprint(r.server_messages);};if(r.docs){LocalDB.sync(r.docs);}
-saveAllowed=true;if(fn)fn(r,rtxt);}}
-if(btn)$(btn).set_working();req.onreadystatechange=ret_fn;req.open("POST",outUrl,true);req.setRequestHeader("ENCTYPE","multipart/form-data");req.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");args['cmd']=command;req.send(makeArgString(args));if(!no_spinner)set_loading();if(freeze_msg)freeze(freeze_msg,1);}
-function validate_session(r,rt){if(r.message=='Logged In'){start_sid=get_cookie('sid');return true;}
-if(start_sid&&start_sid!=get_cookie('sid')&&user&&user!='Guest'){page_body.set_session_changed();return;}
-if(r.exc&&r.session_status=='Session Expired'){resume_session();return;}
-if(r.exc&&r.session_status=='Logged Out'){msgprint('You have been logged out');setTimeout('redirect_to_login()',3000);return;}
-if(r.exc&&r.exc_type&&r.exc_type=='PermissionError'){loadpage('_home');}
-return true;}
-function $c_obj(doclist,method,arg,call_back,no_spinner,freeze_msg,btn){var args={'method':method,'arg':(typeof arg=='string'?arg:JSON.stringify(arg))}
-if(typeof doclist=='string')args.doctype=doclist;else args.docs=compress_doclist(doclist)
-$c('runserverobj',args,call_back,null,no_spinner,freeze_msg,btn);}
-function $c_page(module,page,method,arg,call_back,no_spinner,freeze_msg,btn){if(arg&&!arg.substr)arg=JSON.stringify(arg);$c(module+'.page.'+page+'.'+page+'.'+method,{'arg':arg},call_back,null,no_spinner,freeze_msg,btn);}
-wn.call=function(args){if(!args.args)args.args={};if(args.module&&args.page){$c_page(args.module,args.page,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else if(args.docs){$c_obj(args.doc,args.method,args.args,args.callback,args.no_spinner,false,args.btn);}else{$c(args.method,args.args,args.callback,false,args.no_spinner,false,args.btn);}}
+function $c(command,args,callback,error,no_spinner,freeze_msg,btn){wn.request.call({args:$.extend(args,{cmd:command}),success:callback,error:error,btn:btn,freeze:freeze_msg,show_spinner:!no_spinner})}
+function $c_obj(doclist,method,arg,callback,no_spinner,freeze_msg,btn){if(arg&&typeof arg!='string')arg=JSON.stringify(arg);args={cmd:'runserverobj',arg:arg,method:method};if(typeof doclist=='string')
+args.doctype=doclist;else
+args.docs=compress_doclist(doclist)
+wn.request.call({args:args,success:callback,btn:btn,freeze:freeze_msg,show_spinner:!no_spinner});}
+function $c_page(module,page,method,arg,callback,no_spinner,freeze_msg,btn){if(arg&&typeof arg!='string')arg=JSON.stringify(arg);wn.request.call({args:{cmd:module+'.page.'+page+'.'+page+'.'+method,arg:arg,method:method},success:callback,btn:btn,freeze:freeze_msg,show_spinner:!no_spinner});}
 function $c_obj_csv(doclist,method,arg){var args={}
 args.cmd='runserverobj';args.as_csv=1;args.method=method;args.arg=arg;if(doclist.substr)
 args.doctype=doclist;else
-args.docs=compress_doclist(doclist);open_url_post(outUrl,args);}
-function my_eval(co){var w=window;if(!w.execScript){if(/Gecko/.test(navigator.userAgent)){eval(co,w);}else{eval.call(w,co);}}else{w.execScript(co);}}
-function makeArgString(dict){var varList=[];for(key in dict){varList[varList.length]=key+'='+encodeURIComponent(dict[key]);}
-return varList.join('&');}
+args.docs=compress_doclist(doclist);open_url_post(wn.request.url,args);}
 function open_url_post(URL,PARAMS,new_window){var temp=document.createElement("form");temp.action=URL;temp.method="POST";temp.style.display="none";if(new_window){temp.target='_blank';}
 for(var x in PARAMS){var opt=document.createElement("textarea");opt.name=x;opt.value=PARAMS[x];temp.appendChild(opt);}
 document.body.appendChild(temp);temp.submit();return temp;}
@@ -438,22 +425,22 @@
  */
 var no_value_fields=['Section Break','Column Break','HTML','Table','FlexTable','Button','Image'];var codeid=0;var code_editors={};function Field(){this.with_label=1;}
 Field.prototype.make_body=function(){var ischk=(this.df.fieldtype=='Check'?1:0);if(this.parent)
-this.wrapper=$a(this.parent,'div');else
-this.wrapper=document.createElement('div');this.label_area=$a(this.wrapper,'div','',{margin:'8px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
+this.wrapper=$a(this.parent,(this.with_label?'div':'span'));else
+this.wrapper=document.createElement((this.with_label?'div':'span'));this.label_area=$a(this.wrapper,'div','',{margin:'0px 0px 2px 0px'});if(ischk&&!this.in_grid){this.input_area=$a(this.label_area,'span','',{marginRight:'4px'});this.disp_area=$a(this.label_area,'span','',{marginRight:'4px'});}
 if(this.with_label){this.label_span=$a(this.label_area,'span','field_label')
 this.label_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 4px'});$dh(this.label_icon);this.label_icon.src='lib/images/icons/error.gif';this.label_icon.title='Mandatory value needs to be entered';this.suggest_icon=$a(this.label_area,'img','',{margin:'-3px 4px -3px 0px'});$dh(this.suggest_icon);this.suggest_icon.src='lib/images/icons/bullet_arrow_down.png';this.suggest_icon.title='With suggestions';}else{this.label_span=$a(this.label_area,'span','',{marginRight:'4px'})
 $dh(this.label_area);}
-if(!this.input_area){this.input_area=$a(this.wrapper,'div');this.disp_area=$a(this.wrapper,'div');}
-if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'4px'});this.set_description();}
+if(!this.input_area){this.input_area=$a(this.wrapper,(this.with_label?'div':'span'));this.disp_area=$a(this.wrapper,(this.with_label?'div':'span'));}
+if(this.in_grid){if(this.label_area)$dh(this.label_area);}else{this.input_area.className='input_area';$y(this.wrapper,{marginBottom:'9px'});this.set_description();}
 if(this.onmake)this.onmake();}
 Field.prototype.set_max_width=function(){var no_max=['Code','Text Editor','Text','Table','HTML']
 if(this.wrapper&&this.layout_cell&&this.layout_cell.parentNode.cells&&this.layout_cell.parentNode.cells.length==1&&!in_list(no_max,this.df.fieldtype)){$y(this.wrapper,{paddingRight:'50%'});}}
 Field.prototype.set_label=function(){if(this.with_label&&this.label_area&&this.label!=this.df.label){this.label_span.innerHTML=this.df.label;this.label=this.df.label;}}
-Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','field_description','',this.df.description)
+Field.prototype.set_description=function(){if(this.df.description){var p=in_list(['Text Editor','Code','Check'],this.df.fieldtype)?this.label_area:this.wrapper;this.desc_area=$a(p,'div','help','',this.df.description)
 if(in_list(['Text Editor','Code'],this.df.fieldtype))
 $(this.desc_area).addClass('field_description_top');}}
 Field.prototype.get_status=function(){if(this.in_filter)this.not_in_form=this.in_filter;if(this.not_in_form){return'Write';}
-var fn=this.df.fieldname?this.df.fieldname:this.df.label;this.df=get_field(this.doctype,fn,this.docname);if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary')
+if(!this.df.permlevel)this.df.permlevel=0;var p=this.perm[this.df.permlevel];var ret;if(cur_frm.editable&&p&&p[WRITE])ret='Write';else if(p&&p[READ])ret='Read';else ret='None';if(this.df.fieldtype=='Binary')
 ret='None';if(cint(this.df.hidden))
 ret='None';if(ret=='Write'&&cint(cur_frm.doc.docstatus)>0)ret='Read';var a_o_s=cint(this.df.allow_on_submit);if(a_o_s&&(this.in_grid||(this.frm&&this.frm.not_in_container))){a_o_s=null;if(this.in_grid)a_o_s=this.grid.field.df.allow_on_submit;if(this.frm&&this.frm.not_in_container){a_o_s=cur_grid.field.df.allow_on_submit;}}
 if(cur_frm.editable&&a_o_s&&cint(cur_frm.doc.docstatus)>0&&!this.df.hidden){tmp_perm=get_perm(cur_frm.doctype,cur_frm.docname,1);if(tmp_perm[this.df.permlevel]&&tmp_perm[this.df.permlevel][WRITE])ret='Write';}
@@ -497,15 +484,15 @@
 if(this.input.focus){try{this.input.focus();}catch(e){}}}
 if(this.txt){try{this.txt.focus();}catch(e){}
 this.txt.field_object=this;}}
-function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)v=this.validate(v);return v;}
-this.input.name=this.df.fieldname;this.input.onchange=function(){if(!me.last_value)me.last_value='';if(me.validate)
-me.input.value=me.validate(me.input.value);me.set(me.input.value);if(me.format_input)
-me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(me.input.value)){me.last_value=me.input.value;return;}}
-me.last_value=me.input.value;me.run_trigger();}
+function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)
+v=this.validate(v);return v;}
+this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value($(this).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val;}
+me.set(val);if(me.format_input)
+me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(val)){me.last_value=val;return;}}
+me.last_value=val;me.run_trigger();}
 this.input.set_input=function(val){if(val==null)val='';me.input.value=val;if(me.format_input)me.format_input();}
-if(this.df.options=='Suggest'){wn.require('lib/js/legacy/widgets/autosuggest.js');if(this.suggest_icon)$di(this.suggest_icon);this.set_get_query=function(){}
-this.get_query=function(doc,dt,dn){return repl('SELECT DISTINCT `%(fieldname)s` FROM `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})}
-var opts={script:'',json:true,maxresults:10,link_field:this};this.as=new AutoSuggest(this.input,opts);}}
+if(this.df.options=='Suggest'){if(this.suggest_icon)$di(this.suggest_icon);$(me.input).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':repl('SELECT DISTINCT `%(fieldname)s` FROM \
+       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});},select:function(event,ui){me.set_input_value(ui.item.value);return false;}});}}
 DataField.prototype.validate=function(v){if(this.df.options=='Phone'){if(v+''=='')return'';v1=''
 v=v.replace(/ /g,'').replace(/-/g,'').replace(/\(/g,'').replace(/\)/g,'');if(v&&v.substr(0,1)=='+'){v1='+';v=v.substr(1);}
 if(v&&v.substr(0,2)=='00'){v1+='00';v=v.substr(2);}
@@ -518,7 +505,7 @@
 HTMLField.prototype=new Field();HTMLField.prototype.with_label=0;HTMLField.prototype.set_disp=function(val){this.disp_area.innerHTML=val;}
 HTMLField.prototype.set_input=function(val){if(val)this.set_disp(val);}
 HTMLField.prototype.onrefresh=function(){this.set_disp(this.df.options?this.df.options:'');}
-var datepicker_active=0;function DateField(){}DateField.prototype=new Field();DateField.prototype.make_input=function(){var me=this;this.user_fmt=wn.control_panel.date_format;if(!this.user_fmt)this.user_fmt='dd-mm-yy';this.input=$a(this.input_area,'input');wn.require('lib/css/legacy/jquery-ui.css');$(this.input).datepicker({dateFormat:me.user_fmt.replace('yyyy','yy'),altFormat:'yy-mm-dd',changeYear:true,beforeShow:function(input,inst){datepicker_active=1},onClose:function(dateText,inst){datepicker_active=0;if(_f.cur_grid_cell)
+var datepicker_active=0;function DateField(){}DateField.prototype=new Field();DateField.prototype.make_input=function(){var me=this;this.user_fmt=wn.control_panel.date_format;if(!this.user_fmt)this.user_fmt='dd-mm-yy';this.input=$a(this.input_area,'input');$(this.input).datepicker({dateFormat:me.user_fmt.replace('yyyy','yy'),altFormat:'yy-mm-dd',changeYear:true,beforeShow:function(input,inst){datepicker_active=1},onClose:function(dateText,inst){datepicker_active=0;if(_f.cur_grid_cell)
 _f.cur_grid_cell.grid.cell_deselect();}});var me=this;me.input.onchange=function(){if(this.value==null)this.value='';if(!this.not_in_form)
 me.set(dateutil.user_to_str(me.input.value));me.run_trigger();}
 me.input.set_input=function(val){if(val==null)val='';else val=dateutil.str_to_user(val);me.input.value=val;}
@@ -529,23 +516,25 @@
 var t=v.split('-');if(t.length!=3){return this.clear();}
 else if(cint(t[1])>12||cint(t[1])<1){return this.clear();}
 else if(cint(t[2])>31||cint(t[2])<1){return this.clear();}
-return v;};var _link_onchange_flag=null;function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create&&cur_frm.doc.docstatus==0)
+return v;};function LinkField(){}LinkField.prototype=new Field();LinkField.prototype.make_input=function(){var me=this;if(me.df.no_buttons){this.txt=$a(this.input_area,'input');this.input=this.txt;}else{makeinput_popup(this,'icon-search','icon-play','icon-plus');me.setup_buttons();me.onrefresh=function(){if(me.can_create&&cur_frm.doc.docstatus==0)
 $(me.btn2).css('display','inline-block');else $dh(me.btn2);}}
-me.txt.field_object=this;me.set_onchange();me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;}
+me.txt.field_object=this;me.input.set_input=function(val){if(val==undefined)val='';me.txt.value=val;}
 me.get_value=function(){return me.txt.value;}
-wn.require('lib/js/legacy/widgets/autosuggest.js');var opts={script:'',json:true,maxresults:10,link_field:me};this.as=new AutoSuggest(me.txt,opts);}
+$(me.txt).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':me.get_custom_query()},callback:function(r){response(r.results);},});},select:function(event,ui){me.set_input_value(ui.item.value);return false;}}).data('autocomplete')._renderItem=function(ul,item){return $('<li></li>').data('item.autocomplete',item).append(repl('<a>%(label)s<br><span style="font-size:10px">%(info)s</span></a>',item)).appendTo(ul);};}
+LinkField.prototype.get_custom_query=function(){this.set_get_query();if(this.get_query){if(cur_frm)
+var doc=locals[cur_frm.doctype][cur_frm.docname];return this.get_query(doc,this.doctype,this.docname);}}
 LinkField.prototype.setup_buttons=function(){var me=this;me.btn.onclick=function(){selector.set(me,me.df.options,me.df.label);selector.show(me.txt);}
 if(me.btn1)me.btn1.onclick=function(){if(me.txt.value&&me.df.options){loaddoc(me.df.options,me.txt.value);}}
 me.can_create=0;if((!me.not_in_form)&&in_list(profile.can_create,me.df.options)){me.can_create=1;me.btn2.onclick=function(){var on_save_callback=function(new_rec){if(new_rec){var d=_f.calling_doc_stack.pop();locals[d[0]][d[1]][me.df.fieldname]=new_rec;me.refresh();if(me.grid)me.grid.refresh();me.run_trigger();}}
 _f.calling_doc_stack.push([me.doctype,me.docname]);new_doc(me.df.options,me.on_new,1,on_save_callback,me.doctype,me.docname,me.frm.not_in_container);}}else{$dh(me.btn2);$y($td(me.tab,0,2),{width:'0px'});}}
-LinkField.prototype.set_onchange=function(){var me=this;me.txt.onchange=function(e){if(cur_autosug)return;if(_link_onchange_flag){return;}
-_link_onchange_flag=1;me.refresh_label_icon();if(me.not_in_form){_link_onchange_flag=0;return;}
-if(cur_frm){if(me.txt.value==locals[me.doctype][me.docname][me.df.fieldname]){me.set(me.txt.value);me.run_trigger();setTimeout('_link_onchange_flag = 0',500);return;}}
-me.set(me.txt.value);if(_f.cur_grid_cell)
-_f.cur_grid_cell.grid.cell_deselect();if(!me.txt.value){me.run_trigger();setTimeout('_link_onchange_flag = 0',500);return;}
+LinkField.prototype.set_input_value=function(val){var me=this;me.refresh_label_icon();if(me.not_in_form){$(this.txt).val(val);return;}
+if(cur_frm){if(val==locals[me.doctype][me.docname][me.df.fieldname]){me.set(val);me.run_trigger();return;}}
+me.set(val);if(_f.cur_grid_cell)
+_f.cur_grid_cell.grid.cell_deselect();if(!val){me.run_trigger();return;}
 var fetch='';if(cur_frm.fetch_dict[me.df.fieldname])
-fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':me.txt.value,'options':me.df.options,'fetch':fetch},function(r,rt){setTimeout('_link_onchange_flag = 0',500);if(selector&&selector.display)return;if(r.message=='Ok'){if(r.fetch_values)me.set_fetch_values(r.fetch_values);me.run_trigger();}else{var astr='';if(in_list(profile.can_create,me.df.options))astr=repl('<br><br><span class="link_type" onclick="newdoc(\'%(dt)s\')">Click here</span> to create a new %(dtl)s',{dt:me.df.options,dtl:get_doctype_label(me.df.options)})
-msgprint(repl('error:<b>%(val)s</b> is not a valid %(dt)s.<br><br>You must first create a new %(dt)s <b>%(val)s</b> and then select its value. To find an existing %(dt)s, click on the magnifying glass next to the field.%(add)s',{val:me.txt.value,dt:get_doctype_label(me.df.options),add:astr}));me.txt.value='';me.set('');}});}}
+fetch=cur_frm.fetch_dict[me.df.fieldname].columns.join(', ');$c('webnotes.widgets.form.utils.validate_link',{'value':val,'options':me.df.options,'fetch':fetch},function(r,rt){if(selector&&selector.display)return;if(r.message=='Ok'){if(r.fetch_values)
+me.set_fetch_values(r.fetch_values);me.run_trigger();}else{var astr='';if(in_list(profile.can_create,me.df.options))astr=repl('<br><br><span class="link_type" onclick="newdoc(\'%(dt)s\')">Click here</span> to create a new %(dtl)s',{dt:me.df.options,dtl:get_doctype_label(me.df.options)})
+msgprint(repl('error:<b>%(val)s</b> is not a valid %(dt)s.<br><br>You must first create a new %(dt)s <b>%(val)s</b> and then select its value. To find an existing %(dt)s, click on the magnifying glass next to the field.%(add)s',{val:me.txt.value,dt:get_doctype_label(me.df.options),add:astr}));me.txt.value='';me.set('');}});}
 LinkField.prototype.set_fetch_values=function(fetch_values){var fl=cur_frm.fetch_dict[this.df.fieldname].fields;var changed_fields=[];for(var i=0;i<fl.length;i++){if(locals[this.doctype][this.docname][fl[i]]!=fetch_values[i]){locals[this.doctype][this.docname][fl[i]]=fetch_values[i];if(!this.grid){refresh_field(fl[i]);changed_fields.push(fl[i]);}}}
 for(i=0;i<changed_fields.length;i++){if(cur_frm.fields_dict[changed_fields[i]])
 cur_frm.fields_dict[changed_fields[i]].run_trigger();}
@@ -553,7 +542,8 @@
 LinkField.prototype.set_get_query=function(){if(this.get_query)return;if(this.grid){var f=this.grid.get_field(this.df.fieldname);if(f.get_query)this.get_query=f.get_query;}}
 LinkField.prototype.set_disp=function(val){var t=null;if(val)t="<a href=\'javascript:loaddoc(\""+this.df.options+"\", \""+val+"\")\'>"+val+"</a>";this.set_disp_html(t);}
 function IntField(){}IntField.prototype=new DataField();IntField.prototype.validate=function(v){if(isNaN(parseInt(v)))return null;return cint(v);};IntField.prototype.format_input=function(){if(this.input.value==null)this.input.value='';}
-function FloatField(){}FloatField.prototype=new DataField();FloatField.prototype.validate=function(v){var v=parseFloat(v);if(isNaN(v))return null;return v;};FloatField.prototype.format_input=function(){if(this.input.value==null)this.input.value='';}
+function FloatField(){}FloatField.prototype=new DataField();FloatField.prototype.validate=function(v){var v=parseFloat(v);if(isNaN(v))
+return null;return v;};FloatField.prototype.format_input=function(){if(this.input.value==null)this.input.value='';}
 function CurrencyField(){}CurrencyField.prototype=new DataField();CurrencyField.prototype.format_input=function(){var v=fmt_money(this.input.value);if(this.not_in_form){if(!flt(this.input.value))v='';}
 this.input.value=v;}
 CurrencyField.prototype.validate=function(v){if(v==null||v=='')
@@ -644,7 +634,7 @@
  */
 wn.widgets.FieldGroup=function(){this.first_button=false;this.make_fields=function(body,fl){$y(this.body,{padding:'11px'});this.fields_dict={};for(var i=0;i<fl.length;i++){var df=fl[i];var div=$a(body,'div','',{margin:'6px 0px'})
 f=make_field(df,null,div,null);f.not_in_form=1;this.fields_dict[df.fieldname]=f
-f.refresh();if(df.fieldtype=='Button'&&!this.first_button){$(f.input).addClass('btn-primary');this.first_button=true;}}}
+f.refresh();if(df.fieldtype=='Button'&&!this.first_button){$(f.input).addClass('btn-info');this.first_button=true;}}}
 this.get_values=function(){var ret={};var errors=[];for(var key in this.fields_dict){var f=this.fields_dict[key];var v=f.get_value?f.get_value():null;if(f.df.reqd&&!v)
 errors.push(f.df.label+' is mandatory');if(v)ret[f.df.fieldname]=v;}
 if(errors.length){msgprint('<b>Please check the following Errors</b>\n'+errors.join('\n'));return null;}
@@ -662,7 +652,7 @@
 this.set_postion=function(){var d=get_screen_dims();this.wrapper.style.left=((d.w-cint(this.wrapper.style.width))/2)+'px';this.wrapper.style.top=(get_scroll_top()+60)+'px';top_index++;$y(this.wrapper,{zIndex:top_index});}
 this.show=function(){if(this.display)return;this.set_postion()
 $ds(this.wrapper);freeze();this.display=true;cur_dialog=this;if(this.onshow)this.onshow();}
-this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);if(cur_autosug)cur_autosug.clearSuggestions();this.display=false;cur_dialog=null;}
+this.hide=function(){if(this.onhide)this.onhide();unfreeze();$dh(this.wrapper);this.display=false;cur_dialog=null;}
 this.no_cancel=function(){$dh(this.cancel_img);}
 if(opts)this.make();}
 wn.widgets.Dialog.prototype=new wn.widgets.FieldGroup();$(document).bind('keydown',function(e){if(cur_dialog&&!cur_dialog.no_cancel_flag&&e.which==27){cur_dialog.hide();}});
@@ -674,7 +664,7 @@
 Dialog.prototype.make_body=function(content){this.rows={};this.widgets={};for(var i in content)this.make_row(content[i]);}
 Dialog.prototype.clear_inputs=function(d){for(var wid in this.widgets){var w=this.widgets[wid];var tn=w.tagName?w.tagName.toLowerCase():'';if(tn=='input'||tn=='textarea'){w.value='';}else if(tn=='select'){sel_val(w.options[0].value);}else if(w.txt){w.txt.value='';}else if(w.input){w.input.value='';}}}
 Dialog.prototype.make_row=function(d){var me=this;this.rows[d[1]]=$a(this.body,'div','dialog_row');var row=this.rows[d[1]];if(d[0]!='HTML'){var t=make_table(row,1,2,'100%',['30%','70%']);row.tab=t;var c1=$td(t,0,0);var c2=$td(t,0,1);if(d[0]!='Check'&&d[0]!='Button')
-$t(c1,d[1]);}
+$(c1).text(d[1]);}
 if(d[0]=='HTML'){if(d[2])row.innerHTML=d[2];this.widgets[d[1]]=row;}
 else if(d[0]=='Check'){var i=$a_input(c2,'checkbox','',{width:'20px'});c1.innerHTML=d[1];this.widgets[d[1]]=i;}
 else if(d[0]=='Data'){c1.innerHTML=d[1];c2.style.overflow='auto';this.widgets[d[1]]=$a_input(c2,'text');if(d[2])$a(c2,'div','field_description').innerHTML=d[2];}
@@ -684,35 +674,97 @@
 else if(d[0]=='Select'){c1.innerHTML=d[1];this.widgets[d[1]]=$a(c2,'select','',{width:'160px'})
 if(d[2])$a(c2,'div','field_description').innerHTML=d[2];if(d[3])add_sel_options(this.widgets[d[1]],d[3],d[3][0]);}
 else if(d[0]=='Text'){c1.innerHTML=d[1];c2.style.overflow='auto';this.widgets[d[1]]=$a(c2,'textarea');if(d[2])$a(c2,'div','field_description').innerHTML=d[2];}
-else if(d[0]=='Button'){c2.style.height='32px';var b=$btn(c2,d[1],function(btn){if(btn._onclick)btn._onclick(me)},null,null,1);b.dialog=me;if(!this.first_button){$(b).addClass('btn-primary');this.first_button=true;}
+else if(d[0]=='Button'){c2.style.height='32px';var b=$btn(c2,d[1],function(btn){if(btn._onclick)btn._onclick(me)},null,null,1);b.dialog=me;if(!this.first_button){$(b).addClass('btn-info');this.first_button=true;}
 if(d[2]){b._onclick=d[2];}
 this.widgets[d[1]]=b;}}
 /*
  *	lib/js/wn/ui/listing.js
  */
-wn.widgets.Listing=function(opts){this.opts=opts;this.page_length=20;this.btns={};this.start=0;var me=this;this.make=function(opts){if(this.opts.parent.jquery)
-this.opts.parent=this.opts.parent.get(0);this.wrapper=$a(this.opts.parent,'div');this.filters_area=$a(this.wrapper,'div','listing-filters');this.toolbar_area=$a(this.wrapper,'div','listing-toolbar');this.results_area=$a(this.wrapper,'div','listing-results');this.more_button_area=$a(this.wrapper,'div','listing-more');this.no_results_area=$a(this.wrapper,'div','help_box',{display:'none'},(this.opts.no_result_message?this.opts.no_result_message:'No results'));if(opts)this.opts=opts;this.page_length=this.opts.page_length?this.opts.page_length:this.page_length;this.make_toolbar();this.make_filters();this.make_more_button();}
-this.make_filters=function(){if(this.opts.filters){$ds(this.filters_area);this.filters=new wn.widgets.FieldGroup(this.filters_area,this.opts.fields);}}
-this.make_toolbar=function(){if(!(this.opts.hide_refresh||this.opts.no_refresh)){if(this.opts.title){$a(this.toolbar_area,'h3','',{display:'inline-block',marginRight:'15px'},this.opts.title);}
-this.ref_img=$a(this.toolbar_area,'span','link_type',{color:'#888'},'[refresh]');this.ref_img.onclick=function(){me.run();}
-this.loading_img=$a(this.toolbar_area,'img','lib/images/ui/button-load.gif',{display:'none',marginLeft:'3px',marginBottom:'-2px'});}
-if(this.opts.new_doctype){this.new_btn=$btn(this.toolbar_area,'New '+get_doctype_label(this.opts.new_doctype),function(){newdoc(me.opts.new_doctype,me.opts.new_doc_onload,me.opts.new_doc_indialog,me.opts.new_doc_onsave);},{marginLeft:'7px'});}}
-this.make_more_button=function(){this.more_btn=$btn(this.more_button_area,'More...',function(){me.more_btn.set_working();me.run(function(){me.more_btn.done_working();},1);},'',0,1);$y(this.more_btn.loading_img,{marginBottom:'0px'});}
-this.clear=function(){this.results_area.innerHTML='';this.table=null;$ds(this.results_area);$dh(this.no_results_area);}
-this.make_results=function(r,rt){if(this.start==0)this.clear();$dh(this.more_button_area);if(this.loading_img)$dh(this.loading_img)
-if(r.message)r.values=r.message;if(r.values&&r.values.length){this.values=r.values;var m=Math.min(r.values.length,this.page_length);for(var i=0;i<m;i++){var row=this.add_row();this.opts.render_row(row,r.values[i],this,i);}
-this.start+=m;if(r.values.length>=this.page_length)$ds(this.more_button_area);}else{if(this.start==0){$dh(this.results_area);$ds(this.no_results_area);}}
-if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();if(this.opts.callback)this.opts.callback(r);}
-this.add_row=function(){return $a(this.results_area,'div','',(opts.cell_style?opts.cell_style:{padding:'3px 0px'}));}
-this.run=function(callback,append){if(callback)
-this.onrun=callback;if(!append)
-this.start=0;if(!this.opts.method){this.query=this.opts.get_query?this.opts.get_query():this.opts.query;this.add_limits();var args={query_max:this.query_max||this.opts.query_max||'',as_dict:1}
+wn.provide('wn.ui');wn.ui.Listing=Class.extend({init:function(opts){this.opts=opts||{};this.page_length=20;this.start=0;this.data=[];if(opts){this.make();}},prepare_opts:function(){if(this.opts.new_doctype){if(wn.boot.profile.can_read.indexOf(this.opts.new_doctype)==-1){this.opts.new_doctype=null;}else{this.opts.new_doctype=get_doctype_label(this.opts.new_doctype);}}
+if(!this.opts.no_result_message){this.opts.no_result_message='Nothing to show'}},make:function(opts){if(opts){this.opts=opts;}
+this.prepare_opts();$.extend(this,this.opts);$(this.parent).html(repl('\
+   <div class="wnlist">\
+    <h3 class="title hide">%(title)s</h3>\
+    <div style="height: 37px;" class="list-toolbar-wrapper">\
+     <div class="list-toolbar">\
+      <a class="btn btn-small btn-refresh btn-info">\
+       <i class="icon-refresh icon-white"></i> Refresh</a>\
+      <a class="btn btn-small btn-new">\
+       <i class="icon-plus"></i> New</a>\
+      <a class="btn btn-small btn-filter">\
+       <i class="icon-search"></i> Filter</a>\
+     </div>\
+     <img src="lib/images/ui/button-load.gif" \
+      class="img-load" style="float: left;"/>\
+    </div><div style="clear:both"></div>\
+    \
+    <div class="list-filters hide">\
+     <div class="show_filters well">\
+      <div class="filter_area"></div>\
+      <div>\
+       <button class="btn btn-small add-filter-btn">\
+        <i class="icon-plus"></i> Add Filter</button>\
+      </div>\
+     </div>\
+    </div>\
+    \
+    <div class="no-result help hide">\
+     %(no_result_message)s\
+    </div>\
+    \
+    <div class="result">\
+     <div class="result-list"></div>\
+     <div class="result-grid hide"></div>\
+    </div>\
+    \
+    <div class="paging-button">\
+     <button class="btn btn-small btn-more hide">More...</div>\
+    </div>\
+   </div>\
+  ',this.opts));this.$w=$(this.parent).find('.wnlist');this.set_events();this.make_filters();},add_button:function(html,onclick,before){$(html).click(onclick).insertBefore(this.$w.find('.list-toolbar '+before));this.btn_groupify();},show_view:function($btn,$div,$btn_unsel,$div_unsel){$btn_unsel.removeClass('btn-info');$btn_unsel.find('i').removeClass('icon-white');$div_unsel.toggle(false);$btn.addClass('btn-info');$btn.find('i').addClass('icon-white');$div.toggle(true);},set_events:function(){var me=this;this.$w.find('.btn-refresh').click(function(){me.run();});this.$w.find('.btn-more').click(function(){me.run({append:true});});if(this.title){this.$w.find('h3').html(this.title).toggle(true);}
+if(this.new_doctype){this.$w.find('.btn-new').toggle(true).click(function(){newdoc(me.new_doctype,me.new_doc_onload,true,me.new_doc_onsave);})}else{this.$w.find('.btn-new').remove();}
+if(!me.show_filters){this.$w.find('.btn-filter').remove();}
+if(this.hide_refresh||this.no_refresh){this.$w.find('.btn-refresh').remove();}
+this.btn_groupify();},btn_groupify:function(){var nbtns=this.$w.find('.list-toolbar a').length;if(nbtns>1){this.$w.find('.list-toolbar').addClass('btn-group')}
+if(nbtns==0){this.$w.find('.list-toolbar-wrapper').toggle(false);}},make_filters:function(){this.filter_list=new wn.ui.FilterList({listobj:this,$parent:this.$w.find('.list-filters').toggle(true),doctype:this.doctype,filter_fields:this.filter_fields});},clear:function(){this.data=[];this.$w.find('.result-list').empty();this.$w.find('.result').toggle(true);this.$w.find('.no-result').toggle(false);this.start=0;},run:function(){var me=this;var a0=arguments[0];var a1=arguments[1];if(a0&&typeof a0=='function')
+this.onrun=a0;if(a0&&a0.callback)
+this.onrun=a0.callback;if(!a1&&!(a0&&a0.append))
+this.start=0;me.set_working(true);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:this.get_call_args(),callback:function(r){me.set_working(false);me.render_results(r)},no_spinner:this.opts.no_loading,btn:this.run_btn});},set_working:function(flag){this.$w.find('.img-load').toggle(flag);},get_call_args:function(){if(!this.method){this.query=this.get_query?this.get_query():this.query;this.add_limits();var args={query_max:this.query_max,as_dict:1}
 args.simple_query=this.query;}else{var args={limit_start:this.start,limit_page_length:this.page_length}}
-if(this.opts.args)
-$.extend(args,this.opts.args)
-if(this.loading_img)$di(this.loading_img);wn.call({method:this.opts.method||'webnotes.widgets.query_builder.runquery',args:args,callback:function(r,rt){me.make_results(r,rt)},no_spinner:this.opts.no_loading,btn:this.opts.run_btn});}
-this.refresh=this.run;this.add_limits=function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}
-if(opts)this.make();}
+if(this.args)
+$.extend(args,this.args)
+if(this.get_args){$.extend(args,this.get_args());}
+return args;},render_results:function(r){if(this.start==0)this.clear();this.$w.find('.btn-more').toggle(false);if(r.message)r.values=r.message;if(r.values&&r.values.length){this.data=this.data.concat(r.values);this.render_list(r.values);}else{if(this.start==0){this.$w.find('.result').toggle(false);this.$w.find('.no-result').toggle(true);}}
+if(this.onrun)this.onrun();if(this.callback)this.callback(r);},render_list:function(values){var m=Math.min(values.length,this.page_length);for(var i=0;i<m;i++){this.render_row(this.add_row(),values[i],this,i);}
+this.start+=m;if(values.length>=this.page_length)
+this.$w.find('.btn-more').toggle(true);},add_row:function(){return this.$w.find('.result-list').append('<div class="list-row">').find('.list-row:last').get(0);},refresh:function(){this.run();},add_limits:function(){this.query+=' LIMIT '+this.start+','+(this.page_length+1);}});wn.ui.FilterList=Class.extend({init:function(opts){$.extend(this,opts);this.filters=[];this.$w=this.$parent;this.set_events();},set_events:function(){var me=this;this.listobj.$w.find('.btn-filter').bind('click',function(){me.$w.find('.show_filters').slideToggle();if(!me.filters.length)
+me.add_filter();});this.$w.find('.add-filter-btn').bind('click',function(){me.add_filter();});},add_filter:function(fieldname,condition,value){this.filters.push(new wn.ui.Filter({flist:this,fieldname:fieldname,condition:condition,value:value}));if(fieldname){this.$w.find('.show_filters').slideDown();}},get_filters:function(){var values=[];$.each(this.filters,function(i,f){if(f.field)
+values.push(f.get_value());})
+return values;},update_filters:function(){var fl=[];$.each(this.filters,function(i,f){if(f.field)fl.push(f);})
+this.filters=fl;}});wn.ui.Filter=Class.extend({init:function(opts){$.extend(this,opts);this.doctype=this.flist.doctype;this.fields_by_name={};this.make();this.make_options();this.set_events();},make:function(){this.flist.$w.find('.filter_area').append('<div class="list_filter">\
+  <select class="fieldname_select"></select>\
+  <select class="condition">\
+   <option value="=">Equals</option>\
+   <option value="like">Like</option>\
+   <option value=">=">Greater or equals</option>\
+   <option value=">=">Less or equals</option>\
+   <option value=">">Greater than</option>\
+   <option value="<">Less than</option>\
+   <option value="in">In</option>\
+   <option value="!=">Not equals</option>\
+  </select>\
+  <span class="filter_field"></span>\
+  <a class="close">&times;</a>\
+  </div>');this.$w=this.flist.$w.find('.list_filter:last-child');this.$select=this.$w.find('.fieldname_select');},make_options:function(){if(this.filter_fields){for(var i in this.filter_fields)
+this.add_field_option(this.filter_fields[i])}else{this.render_field_select();}},set_events:function(){var me=this;this.$w.find('.fieldname_select').bind('change',function(){me.set_field(this.value);});this.$w.find('a.close').bind('click',function(){me.$w.css('display','none');var value=me.field.get_value();me.field=null;if(!me.flist.get_filters().length){me.flist.$w.find('.set_filters').toggle(true);me.flist.$w.find('.show_filters').toggle(false);}
+if(value){me.flist.listobj.run();}
+me.flist.update_filters();return false;});me.$w.find('.condition').change(function(){if(!me.field.desc_area){me.field.desc_area=$a(me.field.wrapper,'span','help');}
+me.field.desc_area.innerHTML='';if($(this).val()=='in'){me.field.desc_area.innerHTML='Multiple values, separated by a comma'}});if(me.fieldname){me.set_field(me.fieldname);if(me.condition)me.$w.find('.condition').val(me.condition).change();if(me.value)me.field.set_input(me.value)}else{me.set_field('name');}},render_field_select:function(){var me=this;me.table_fields=[];var std_filters=[{fieldname:'name',fieldtype:'Data',label:'ID',parent:me.doctype},{fieldname:'modified',fieldtype:'Date',label:'Last Modified',parent:me.doctype},{fieldname:'owner',fieldtype:'Data',label:'Created By',parent:me.doctype},{fieldname:'_user_tags',fieldtype:'Data',label:'Tags',parent:me.doctype}];$.each(std_filters.concat(fields_list[me.doctype]),function(i,df){me.add_field_option(df);});$.each(me.table_fields,function(i,table_df){if(table_df.options){$.each(fields_list[table_df.options],function(i,df){me.add_field_option(df);});}})},add_field_option:function(df){var me=this;if(me.doctype&&df.parent==me.doctype){var label=df.label;var table=get_label_doctype(me.doctype);if(df.fieldtype=='Table')me.table_fields.push(df);}else{var label=df.label+' ('+df.parent+')';var table=df.parent;}
+if(wn.model.no_value_type.indexOf(df.fieldtype)==-1&&!me.fields_by_name[df.fieldname]){this.$select.append($('<option>',{value:df.fieldname,table:table}).text(label));me.fields_by_name[df.fieldname]=df;}},set_field:function(fieldname){var me=this;me.$w.find('.fieldname_select').val(fieldname);wn.require('lib/js/legacy/widgets/form/fields.js');var field_area=me.$w.find('.filter_field').empty().get(0);var df=me.fields_by_name[fieldname];df.original_type=df.fieldtype;df.description='';df.reqd=0;if(df.fieldtype=='Check'){df.fieldtype='Select';df.options='No\nYes';}else if(['Text','Text Editor','Code','Link'].indexOf(df.fieldtype)!=-1){df.fieldtype='Data';}
+f=make_field(me.fields_by_name[fieldname],null,field_area,null,0,1);f.df.single_select=1;f.not_in_form=1;f.with_label=0;f.refresh();me.field=f;if(df.fieldtype=='Data'){me.$w.find('.condition').val('like');}else{me.$w.find('.condition').val('=');}
+$(me.field.wrapper).find(':input').keydown(function(ev){if(ev.which==13){me.flist.listobj.run();}})},get_value:function(){var me=this;var val=me.field.get_value();var cond=me.$w.find('.condition').val();if(me.field.df.original_type=='Check'){val=(val=='Yes'?1:0);}
+if(cond=='like'){val=val+'%';}
+return[me.$w.find('.fieldname_select option:selected').attr('table'),me.field.df.fieldname,me.$w.find('.condition').val(),val];}});
 /*
  *	lib/js/legacy/widgets/layout.js
  */
@@ -726,13 +778,13 @@
 Layout.prototype.show=function(){$ds(this.wrapper);}
 Layout.prototype.hide=function(){$dh(this.wrapper);}
 Layout.prototype.close_borders=function(){if(this.with_border){this.myrows[this.myrows.length-1].wrapper.style.borderBottom='1px solid #000';}}
-function LayoutRow(layout,parent){this.layout=layout;this.wrapper=$a(parent,'div');this.main_head=$a(this.wrapper,'div');this.main_body=$a(this.wrapper,'div');if(layout.with_border){this.wrapper.style.border='1px solid #000';this.wrapper.style.borderBottom='0px';}
+function LayoutRow(layout,parent){this.layout=layout;this.wrapper=$a(parent,'div','form-layout-row');this.main_head=$a(this.wrapper,'div');this.main_body=$a(this.wrapper,'div');if(layout.with_border){this.wrapper.style.border='1px solid #000';this.wrapper.style.borderBottom='0px';}
 this.header=$a(this.main_body,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.body=$a(this.main_body,'div');this.table=$a(this.body,'table','',{width:'100%',borderCollapse:'collapse'});this.row=this.table.insertRow(0);this.mycells=[];}
 LayoutRow.prototype.hide=function(){$dh(this.wrapper);}
 LayoutRow.prototype.show=function(){$ds(this.wrapper);}
 LayoutRow.prototype.addCell=function(wid){var lc=new LayoutCell(this.layout,this,wid);this.mycells[this.mycells.length]=lc;return lc;}
 function LayoutCell(layout,layoutRow,width){if(width){var w=width+'';if(w.substr(w.length-2,2)!='px'){if(w.substr(w.length-1,1)!="%"){width=width+'%'};}}
-this.width=width;this.layout=layout;var cidx=layoutRow.row.cells.length;this.cell=layoutRow.row.insertCell(cidx);this.cell.style.verticalAlign='top';this.set_width(layoutRow.row,width);var h=$a(this.cell,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.wrapper=$a(this.cell,'div','',{padding:(layout.with_border?'8px':'8px 0px')});layout.cur_cell=this.wrapper;layout.cur_cell.header=h;}
+this.width=width;this.layout=layout;var cidx=layoutRow.row.cells.length;this.cell=layoutRow.row.insertCell(cidx);this.cell.style.verticalAlign='top';this.set_width(layoutRow.row,width);var h=$a(this.cell,'div','',{padding:(layout.with_border?'0px 8px':'0px')});this.wrapper=$a(this.cell,'div','',{padding:(layout.with_border?'8px':'0px')});layout.cur_cell=this.wrapper;layout.cur_cell.header=h;}
 LayoutCell.prototype.set_width=function(row,width){var w=100;var n_cells=row.cells.length;var cells_with_no_width=n_cells;if(width){$y(row.cells[n_cells-1],{width:cint(width)+'%'})}else{row.cells[n_cells-1].estimated_width=1;}
 for(var i=0;i<n_cells;i++){if(!row.cells[i].estimated_width){w=w-cint(row.cells[i].style.width);cells_with_no_width--;}}
 for(var i=0;i<n_cells;i++){if(row.cells[i].estimated_width)
@@ -745,16 +797,11 @@
 var def_ph_style={wrapper:{marginBottom:'16px',backgroundColor:'#EEE'},main_heading:{},sub_heading:{marginBottom:'8px',color:'#555',display:'none'},separator:{borderTop:'3px solid #777'},toolbar_area:{padding:'3px 0px',display:'none',borderBottom:'1px solid #AAA'}}
 function PageHeader(parent,main_text,sub_text){this.wrapper=$a(parent,'div','page_header');this.t1=make_table($a(this.wrapper,'div','',def_ph_style.wrapper.backgroundColor),1,2,'100%',[null,'100px'],{padding:'2px'});$y(this.t1,{borderCollapse:'collapse'})
 this.lhs=$td(this.t1,0,0);this.main_head=$a(this.lhs,'h1','',def_ph_style.main_heading);this.sub_head=$a(this.lhs,'h4','',def_ph_style.sub_heading);this.separator=$a(this.wrapper,'div','',def_ph_style.separator);this.toolbar_area=$a(this.wrapper,'div','',def_ph_style.toolbar_area);this.padding_area=$a(this.wrapper,'div','',{padding:'3px'});$y($td(this.t1,0,1),{textAlign:'right',padding:'3px'});this.close_btn=$a($td(this.t1,0,1),'span','close',{},'&times;');this.close_btn.onclick=function(){nav_obj.show_last_open();};if(main_text)this.main_head.innerHTML=main_text;if(sub_text)this.sub_head.innerHTML=sub_text;this.buttons={};this.buttons2={};}
-PageHeader.prototype.add_button=function(label,fn,bold,icon,green){var tb=this.toolbar_area;if(this.buttons[label])return;var btn=$btn(tb,label,fn,{marginRight:'4px'},(green?'btn-primary':''));if(bold)$y(btn,{fontWeight:'bold'});this.buttons[label]=btn;$ds(this.toolbar_area);return btn;}
+PageHeader.prototype.add_button=function(label,fn,bold,icon,green){var tb=this.toolbar_area;if(this.buttons[label])return;iconhtml=icon?('<i class="'+icon+'"></i> '):'';var $button=$('<button class="btn btn-small">'+iconhtml+label+'</button>').click(fn).appendTo(tb);if(green){$button.addClass('btn-info');$button.find('i').addClass('icon-white');}
+if(bold)$button.css('font-weight','bold');this.buttons[label]=$button.get(0);$ds(this.toolbar_area);return this.buttons[label];}
 PageHeader.prototype.clear_toolbar=function(){this.toolbar_area.innerHTML='';this.buttons={};}
 PageHeader.prototype.make_buttonset=function(){$(this.toolbar_area).buttonset();}
 /*
- *	lib/js/legacy/widgets/select.js
- */
-function SelectWidget(parent,options,width,editable,bg_color){var me=this;this.inp=$a(parent,'select');if(options)add_sel_options(this.inp,options);if(width)$y(this.inp,{width:width});this.set_width=function(w){$y(this.inp,{width:w})};this.set_options=function(o){add_sel_options(this.inp,o);}
-this.inp.onchange=function(){if(me.onchange)me.onchange(this);}
-return;}
-/*
  *	lib/js/legacy/webpage/history.js
  */
 var nav_obj={}
@@ -773,17 +820,17 @@
 return parts.join('/')}
 nav_obj.get_page=function(loc){if(!loc)loc=window.location.hash;if(loc.substr(0,1)=='#'){loc=loc.substr(1);}
 if(loc.substr(0,1)=='!'){loc=loc.substr(1);}
-if(!in_list(['Page/','Form/','Repor','DocBr','List/'],loc.substr(0,5))){loc='Page/'+loc;}
+if(!in_list(['Page/','Form/','Repor','DocBr','List/','List2'],loc.substr(0,5))){loc='Page/'+loc;}
 return loc.split('/');}
 function historyChange(newLocation){var t=nav_obj.get_page(newLocation)
 for(var i=0;i<t.length;i++)
 t[i]=decodeURIComponent(t[i]);if(nav_obj.ol.length){var c=nav_obj.ol[nav_obj.ol.length-1];if(t.length==2){if(c[0]==t[0]&&c[1]==t[1])return;}else{if(c[0]==t[0]&&c[1]==t[1]&&c[2]==t[2])return;}}
 if(t[2])
-var docname=history_get_name(t);if(t[0]=='Form'){_history_current=newLocation;if(docname.substr(0,3)=='New'&&!(locals[t[1]]&&locals[t[1]][docname])){newdoc(t[1]);}else{loaddoc(t[1],docname);}}else if(t[0]=='Report'){_history_current=newLocation;loadreport(t[1],docname);}else if(t[0]=='Page'){_history_current=newLocation;loadpage(t[1]);}else if(t[0]=='Application'){_history_current=newLocation;loadapp(t[1]);}else if(t[0]=='DocBrowser'||t[0]=='List'){_history_current=newLocation;loaddocbrowser(t[1]);}};$(window).bind('hashchange',function(){historyChange(location.hash);});
+var docname=history_get_name(t);if(t[0]=='Form'){_history_current=newLocation;if(docname.substr(0,3)=='New'&&!(locals[t[1]]&&locals[t[1]][docname])){newdoc(t[1]);}else{loaddoc(t[1],docname);}}else if(t[0]=='Report'){_history_current=newLocation;loadreport(t[1],docname);}else if(t[0]=='Page'){_history_current=newLocation;loadpage(t[1]);}else if(t[0]=='Application'){_history_current=newLocation;loadapp(t[1]);}else if(t[0]=='DocBrowser'||t[0]=='List'){_history_current=newLocation;loaddocbrowser(t[1]);}else if(t[0]=='List2'){_history_current=newLocation;loaddocbrowser2(t[1]);}};$(window).bind('hashchange',function(){historyChange(location.hash);});
 /*
  *	lib/js/legacy/webpage/search.js
  */
-search_fields={};function setlinkvalue(name){selector.input.set_input(name);selector.hide();}
+search_fields={};function setlinkvalue(name){selector.input.set_input_value(name);selector.hide();}
 function makeselector(){var d=new Dialog(540,440,'Search');d.make_body([['Data','Beginning With','Tip: You can use wildcard "%"'],['Select','Search By'],['Button','Search'],['HTML','Help'],['HTML','Result']]);var inp=d.widgets['Beginning With'];var field_sel=d.widgets['Search By'];var btn=d.widgets['Search'];d.sel_type='';d.values_len=0;d.set=function(input,type,label){d.sel_type=type;d.input=input;if(d.style!='Link'){d.rows['Result'].innerHTML='';d.values_len=0;}
 d.style='Link';d.set_query_description()
 if(!d.sel_type)d.sel_type='Value';d.set_title('Select a "'+d.sel_type+'" for field "'+label+'"');}
@@ -797,8 +844,7 @@
 try{inp.focus();}catch(e){}
 if(d.input)d.input.set_get_query();var get_sf_list=function(dt){var l=[];var lf=search_fields[dt];for(var i=0;i<lf.length;i++)l.push(lf[i][1]);return l;}
 $ds(d.rows['Search By']);if(search_fields[d.sel_type]){empty_select(field_sel);add_sel_options(field_sel,get_sf_list(d.sel_type),'ID');}else{empty_select(field_sel);add_sel_options(field_sel,['ID'],'ID');$c('webnotes.widgets.search.getsearchfields',{'doctype':d.sel_type},function(r,rt){search_fields[d.sel_type]=r.searchfields;empty_select(field_sel);add_sel_options(field_sel,get_sf_list(d.sel_type));field_sel.selectedIndex=0;});}}
-d.onhide=function(){if(d.input&&d.input.txt)
-d.input.txt.onchange()}
+d.onhide=function(){}
 btn.onclick=function(){if(this.disabled)return;this.args.is_ajax=true;this.set_working();d.set_doctype=d.sel_type;var q='';args={};if(d.input&&d.input.get_query){var doc={};args.is_simple=1;if(cur_frm)doc=locals[cur_frm.doctype][cur_frm.docname];var q=d.input.get_query(doc,d.input.doctype,d.input.docname);if(!q){return'';}}
 var get_sf_fieldname=function(v){var lf=search_fields[d.sel_type];if(!lf)
 return'name'
@@ -816,15 +862,11 @@
 /*
  *	lib/js/legacy/webpage/spinner.js
  */
-function set_loading(){pending_req++;$('#spinner').css('visibility','visible');$('body').css('cursor','progress');}
+var pending_req=0;var fcount=0;var dialog_back;function set_loading(){pending_req++;$('#spinner').css('visibility','visible');$('body').css('cursor','progress');}
 function hide_loading(){pending_req--;if(!pending_req){$('body').css('cursor','default');$('#spinner').css('visibility','hidden');}}
-/*
- *	lib/js/legacy/webpage/freeze_page.js
- */
-var fcount=0;var frozen=0;var dialog_message;var dialog_back;function freeze(msg,do_freeze){if(!dialog_back){dialog_back=$a($i('body_div'),'div','dialog_back');$(dialog_back).css('opacity',0.6);}
-$ds(dialog_back);fcount++;frozen=1;}
-function unfreeze(){if(dialog_message)
-$dh(dialog_message);if(!fcount)return;fcount--;if(!fcount){$dh(dialog_back);frozen=0;}}
+function freeze(){if(!dialog_back){dialog_back=$a($i('body_div'),'div','dialog_back');$(dialog_back).css('opacity',0.6);}
+$ds(dialog_back);fcount++;}
+function unfreeze(){if(!fcount)return;fcount--;if(!fcount){$dh(dialog_back);}}
 /*
  *	lib/js/legacy/webpage/error_console.js
  */
@@ -873,22 +915,21 @@
 fn();else{args=get_url_dict();args.name=page_name;$c('webnotes.widgets.page.getpage',args,fn);}}
 pscript.update_page_history=function(page_name,no_history){var arg=null;var t=null;if(window.location.hash){var t=nav_obj.get_page(window.location.hash)}else if(get_url_arg('page')){var t=nav_obj.get_page(get_url_arg('page'))}
 if(t&&t[1]==page_name)arg=t[2];nav_obj.open_notify('Page',page_name,arg,no_history);}
-function loadscript(src,call_back){set_loading();var script=$a('head','script');script.type='text/javascript';script.src=src;script.onload=function(){if(call_back)call_back();hide_loading();}
-script.onreadystatechange=function(){if(this.readyState=='complete'||this.readyState=='loaded'){hide_loading();call_back();}}}
 var doc_browser_page;function loaddocbrowser(dt,label,fields){wn.require('lib/js/legacy/webpage/docbrowser.js');dt=get_label_doctype(dt);if(!doc_browser_page)
 doc_browser_page=new ItemBrowserPage();doc_browser_page.show(dt,label,fields);nav_obj.open_notify('List',dt,'');}
+function loaddocbrowser2(dt,label,fields){wn.pages.doclistview.show(dt);return;}
 /*
  *	lib/js/legacy/webpage/uploader.js
  */
 var uploaders={};var upload_frame_count=0;Uploader=function(parent,args,callback){var id='frame'+upload_frame_count;upload_frame_count++;this.callback=callback;var div=$a(parent,'div');div.innerHTML='<iframe id="'+id+'" name="'+id+'" src="blank.html" \
-  style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+outUrl+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
+  style="width:0px; height:0px; border:0px"></iframe>';var div=$a(parent,'div');div.innerHTML='<form method="POST" enctype="multipart/form-data" action="'+wn.request.url+'" target="'+id+'"></form>';var ul_form=div.childNodes[0];var f_list=[];var inp_fdata=$a_input($a(ul_form,'span'),'file',{name:'filedata'},{marginLeft:'7px'});if(!('cmd'in args)){var inp=$a_input($a(ul_form,'span'),'hidden',{name:'cmd'});inp.value='uploadfile';}
 var inp=$a_input($a(ul_form,'span'),'hidden',{name:'uploader_id'});inp.value=id;var inp=$a_input($a(ul_form,'span'),'submit',null,{marginLeft:'7px'});inp.value='Upload';$y(inp,{width:'80px'});for(var key in args){var inp=$a_input($a(ul_form,'span'),'hidden',{name:key});inp.value=args[key];}
 uploaders[id]=this;}
 function upload_callback(id,fid){uploaders[id].callback(fid);}
 /*
  *	lib/js/legacy/webpage/page.js
  */
-var stylesheets=[];function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name])
+function Page(page_name,content){var me=this;this.name=page_name;this.trigger=function(event){try{if(pscript[event+'_'+this.name])
 pscript[event+'_'+this.name](me.wrapper);if(me.wrapper[event]){me.wrapper[event](me.wrapper);}}catch(e){console.log(e);}}
 this.page_show=function(){set_title(me.doc.title?me.doc.title:me.name);if(!me.onload_complete){me.trigger('onload');me.onload_complete=true;}
 me.trigger('onshow');cur_frm=null;}
@@ -897,11 +938,10 @@
 this.wrapper.innerHTML=content;return this;}
 function render_page(page_name,menuitem){if(!page_name)return;if((!locals['Page'])||(!locals['Page'][page_name])){loadpage('_home');return;}
 var pdoc=locals['Page'][page_name];if(pdoc.style)set_style(pdoc.style)
-if(pdoc.stylesheet){set_style(locals.Stylesheet[pdoc.stylesheet].stylesheet);stylesheets.push(pdoc.stylesheet);}
 var p=new Page(page_name,pdoc._Page__content?pdoc._Page__content:pdoc.content);var script=pdoc.__script?pdoc.__script:pdoc.script;p.doc=pdoc;if(script){eval(script);}
 page_body.change_to(page_name);return p;}
 function refresh_page(page_name){var fn=function(r,rt){render_page(page_name)}
-$c('webnotes.widgets.page.getpage',{'name':page_name,stylesheets:JSON.stringify(stylesheets)},fn);}
+$c('webnotes.widgets.page.getpage',{'name':page_name},fn);}
 /*
  *	lib/js/legacy/wn/page_layout.js
  */
@@ -1023,7 +1063,7 @@
 /*
  *	lib/js/legacy/app.js
  */
-var popup_cont;var session={};var start_sid=null;if(!wn)var wn={};function startup(){start_sid=get_cookie('sid');popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
+var popup_cont;var session={};if(!wn)var wn={};function startup(){popup_cont=$a(document.getElementsByTagName('body')[0],'div');var setup_globals=function(r){wn.boot=r;profile=r.profile;user=r.profile.name;user_fullname=wn.user_info(user).fullname;user_defaults=profile.defaults;user_roles=profile.roles;user_email=profile.email;home_page=r.home_page;_p.letter_heads=r.letter_heads;sys_defaults=r.sysdefaults;session.rt=profile.can_read;if(r.ipinfo)session.ipinfo=r.ipinfo;session.dt_labels=r.dt_labels;session.rev_dt_labels={}
 if(r.dt_labels){for(key in r.dt_labels)session.rev_dt_labels[r.dt_labels[key]]=key;}
 wn.control_panel=r.control_panel;}
 var setup_history=function(r){rename_observers.push(nav_obj);}
diff --git a/version.num b/version.num
index f08bce7..d0378c4 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-841
\ No newline at end of file
+1049