Merge branch 'stable' into latest
diff --git a/.gitignore b/.gitignore
index e9e476b..28fcc88 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,8 @@
 *.comp.js
 .DS_Store
 server_tools
+services
+user_files
 patch.log
 lib
 versions-local.db
diff --git a/erpnext/utilities/doctype/production_tips_common/__init__.py b/blank.html
similarity index 100%
rename from erpnext/utilities/doctype/production_tips_common/__init__.py
rename to blank.html
diff --git a/config/conf.py b/config/conf.py
deleted file mode 100644
index 1cf35e2..0000000
--- a/config/conf.py
+++ /dev/null
@@ -1,7 +0,0 @@
-index_path = '/'
-
-include_paths = [
-	'erpnext',
-	'lib/py',
-	'lib/py/legacy'
-]
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index 51cacda..b07bb9c 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -15,7 +15,7 @@
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
   cur_frm.cscript.account_type(doc, cdt, cdn);
   // hide India specific fields
-  var cp = locals['Control Panel']['Control Panel'];
+  var cp = wn.control_panel;
   if(cp.country == 'India')
     unhide_field(['pan_number', 'tds_applicable', 'tds_details', 'TDS']);
   else
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
index b63f448..699d17b 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
@@ -1,6 +1,6 @@
 cur_frm.cscript.onload = function(doc, cdt, cdn) {
-	var cp = locals['Control Panel']['Control Panel'];
-	
+	var cp = wn.control_panel;
+
 	if (!doc.voucher_date) doc.voucher_date = dateutil.obj_to_str(new Date());
 
 	if(cp.country == 'India') {
@@ -11,7 +11,6 @@
 	}
 
 	cur_frm.cscript.load_defaults(doc, cdt, cdn);
-
 }
 
 
diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
index 44dea8a..b19db79 100644
--- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
+++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js
@@ -7,10 +7,10 @@
 // On Load
 // --------
 cur_frm.cscript.onload = function(doc,dt,dn) {
-	var cp = locals['Control Panel']['Control Panel'];
-	
+	var cp = wn.control_panel;
+
 	if(!doc.voucher_date) set_multiple(dt,dn,{voucher_date:get_today()});
-	if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});	
+	if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()});  
 
 	if(cp.country == 'India') {
 		unhide_field(['TDS','tds_applicable','tds_category','Get TDS','tax_code','rate','ded_amount','total_tds_on_voucher','tds_amount_on_advance']);
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
index dcd522b..7defbad 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js
@@ -74,7 +74,7 @@
 	}
 
 	// India related fields
-	var cp = locals['Control Panel']['Control Panel'];
+	var cp = wn.control_panel;
 	if (cp.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']);
 	else hide_field(['c_form_applicable', 'c_form_no']);
 
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
index 22294c5..d8eb761 100644
--- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
+++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
@@ -11,7 +11,8 @@
 
 in_transaction = webnotes.conn.in_transaction
 convert_to_lists = webnotes.conn.convert_to_lists
-	
+session = webnotes.session
+
 # -----------------------------------------------------------------------------------------
 
 from utilities.transaction_base import TransactionBase
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index 61b36d2..13416e6 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -1,4 +1,5 @@
 pscript['onload_Accounts Browser'] = function(){
+	wn.require('lib/js/legacy/widgets/tree.js');
   // if the user directly loads the page, ask to select the chart
   var parent = $i('ab_body');
   parent.innerHTML = 'Please select your chart: '
@@ -124,7 +125,7 @@
           var imgsrc=null;
           var has_children = true;
           if(cl[i].group_or_ledger=='Ledger') {
-            var imgsrc = 'lib/images/icons/page.gif';
+            var imgsrc = 'lib/images/icons/page.png';
             has_children = false;
           }
           var t = tree.addNode(n, cl[i].account_name, imgsrc,tree.std_onclick, has_children ? tree.std_onexp : null);
@@ -137,7 +138,7 @@
           var imgsrc=null;
           var has_children = true;
           if(cl[i].group_or_ledger=='Ledger') {
-            var imgsrc = 'lib/images/icons/page.gif';
+            var imgsrc = 'lib/images/icons/page.png';
             has_children = false;
           }
           var t = tree.addNode(n, cl[i].cost_center_name, imgsrc,tree.std_onclick, has_children ? tree.std_onexp : null);
diff --git a/erpnext/accounts/page/financial_statements/financial_statements.html b/erpnext/accounts/page/financial_statements/financial_statements.html
index 6e69bc2..e6735fa 100644
--- a/erpnext/accounts/page/financial_statements/financial_statements.html
+++ b/erpnext/accounts/page/financial_statements/financial_statements.html
@@ -1,6 +1,5 @@
 <div class="layout_wrapper">
 <div id="fs_header"></div>
-</div>
 <!--  table.statement td {    vertical-align: middle;  }  table.statement td select {    width: 100px;  }  table.stmt_table {    table-layout: fixed;    border-collapse: collapse;  }  table.stmt_table td {    vertical-align: middle;    padding: 2px;  }  td.stmt_level0 {    font-weight: bold;    font-size: 14px;    border-bottom: 1px solid #AAA;  }  td.stmt_level1 {    font-weight: bold;    font-size: 12px;  }  td.stmt_level2 {    font-size: 11px;  }  td.stmt_level3 {    font-size: 11px;  }  td.stmt_level4 {    font-size: 12px;    font-weight: bold;    border-bottom: 1px solid #000;  }  td.stmt_level5 {    color: BLUE;    font-size: 11px;  }  --> <!--
 <div style="border: 1px solid #cccccc; padding: 4px; margin-top: 8px; background-color: #eeeeee; width: 98%;">
 <table class="statement" border="0" cellspacing="2px">
@@ -25,7 +24,8 @@
 <div style="margin:10px 0px 10px 0px" mce_style="margin:10px 0px 10px 0px"><button class="button" onclick="pscript.print_statement();">Print</button></div>
 -->
 <div id="print_html">
-<div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>
-<div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>
-<div id="stmt_tree" style="margin: 0px 0px 16px; overflow: auto; display: none; width: 100%;"></div>
+	<div id="stmt_title1" style="margin:16px 0px 4px 0px; font-size: 16px; font-weight: bold; color: #888;"></div>
+	<div id="stmt_title2" style="margin:0px 0px 8px 0px; font-size: 16px; font-weight: bold;"></div>
+	<div id="stmt_tree" style="margin: 0px 0px 16px; overflow: auto; display: none; width: 100%;"></div>
+</div>
 </div>
diff --git a/erpnext/erpnext_version.py b/erpnext/erpnext_version.py
deleted file mode 100644
index 48e45d5..0000000
--- a/erpnext/erpnext_version.py
+++ /dev/null
@@ -1,3 +0,0 @@
-# version info
-
-version='1.0.0'
diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py
index 8969695..d41b262 100644
--- a/erpnext/home/__init__.py
+++ b/erpnext/home/__init__.py
@@ -31,26 +31,40 @@
 	# Support
 	'Customer Issue':       ['[%(status)s] %(description)s by %(customer_name)s', '#000080'],
 	'Maintenance Visit':['To %(customer_name)s', '#4169E1'],
-	'Support Ticket':       ['[%(status)s] %(subject)s', '#000080']	
+	'Support Ticket':       ['[%(status)s] %(subject)s', '#000080'],
+	
+	# Website
+	'Web Page': ['%(title)s', '#00080'],
+	'Blog': ['%(title)s', '#00080']
 }
 
-def make_feed(doc, subject, color):
+def make_feed(feedtype, doctype, name, owner, subject, color):
 	"makes a new Feed record"
 	#msgprint(subject)
 	from webnotes.model.doc import Document
-	webnotes.conn.sql("delete from tabFeed where doc_type=%s and doc_name=%s", (doc.doctype, doc.name))
+
+	if feedtype in ('Login', 'Comment'):
+		# delete old login, comment feed
+		webnotes.conn.sql("""delete from tabFeed where 
+			datediff(curdate(), creation) > 7 and doc_type in ('Comment', 'Login')""")
+	else:
+		# one feed per item
+		webnotes.conn.sql("""delete from tabFeed
+			where doc_type=%s and doc_name=%s 
+			and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
+
 	f = Document('Feed')
-	f.doc_type = doc.doctype
-	f.doc_name = doc.name
+	f.owner = owner
+	f.feed_type = feedtype
+	f.doc_type = doctype
+	f.doc_name = name
 	f.subject = subject
 	f.color = color
-	f.save(1)
+	f.save()
 
 def update_feed(doc, method=None):   
 	"adds a new feed"
-	if method=='validate':
-		return
-	subject, color = feed_dict.get(doc.doctype, [None, None])
-	if subject:
-		subject = subject % doc.fields
-		make_feed(doc, subject, color)
+	if method=='on_update':
+		subject, color = feed_dict.get(doc.doctype, [None, None])
+		if subject:			
+			make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color)
diff --git a/erpnext/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.txt
index 5aa4f91..f239f7c 100644
--- a/erpnext/home/doctype/feed/feed.txt
+++ b/erpnext/home/doctype/feed/feed.txt
@@ -3,9 +3,9 @@
 
 	# These values are common in all dictionaries
 	{
-		'creation': '2011-04-08 10:50:41',
+		'creation': '2011-04-06 18:11:38',
 		'docstatus': 0,
-		'modified': '2011-04-05 09:16:57',
+		'modified': '2012-02-03 11:28:16',
 		'modified_by': 'Administrator',
 		'owner': 'Administrator'
 	},
@@ -14,18 +14,18 @@
 	{
 		'autoname': '_FEED.#####',
 		'colour': 'White:FFF',
+		'default_print_format': 'Standard',
 		'doctype': 'DocType',
 		'module': 'Home',
 		'name': '__common__',
 		'section_style': 'Simple',
 		'show_in_menu': 0,
-		'version': 1
+		'version': 2
 	},
 
 	# These values are common for all DocField
 	{
 		'doctype': 'DocField',
-		'fieldtype': 'Data',
 		'name': '__common__',
 		'parent': 'Feed',
 		'parentfield': 'fields',
@@ -42,8 +42,16 @@
 	# DocField
 	{
 		'doctype': 'DocField',
+		'fieldname': 'feed_type',
+		'fieldtype': 'Select',
+		'label': 'Feed Type'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
 		'fieldname': 'doc_type',
-		'idx': 1,
+		'fieldtype': 'Data',
 		'label': 'Doc Type'
 	},
 
@@ -51,7 +59,7 @@
 	{
 		'doctype': 'DocField',
 		'fieldname': 'doc_name',
-		'idx': 2,
+		'fieldtype': 'Data',
 		'label': 'Doc Name'
 	},
 
@@ -59,7 +67,7 @@
 	{
 		'doctype': 'DocField',
 		'fieldname': 'subject',
-		'idx': 3,
+		'fieldtype': 'Data',
 		'label': 'Subject'
 	},
 
@@ -67,7 +75,7 @@
 	{
 		'doctype': 'DocField',
 		'fieldname': 'color',
-		'idx': 4,
+		'fieldtype': 'Data',
 		'label': 'Color'
 	}
 ]
\ No newline at end of file
diff --git a/erpnext/home/doctype/home_control/home_control.py b/erpnext/home/doctype/home_control/home_control.py
index ce15bfd..9d82153 100644
--- a/erpnext/home/doctype/home_control/home_control.py
+++ b/erpnext/home/doctype/home_control/home_control.py
@@ -197,7 +197,10 @@
 		return count
 		
 	def get_todo_list(self):
-		return convert_to_lists(sql("select name, description, date, priority,checked from `tabToDo Item` where owner=%s order by field(priority,'High','Medium','Low') asc, date asc", session['user']))
+		return sql("""select name, description, date, 
+			priority, checked, reference_type, reference_name from `tabToDo Item` 
+			where owner=%s order by field(priority,'High','Medium','Low') asc, date asc""", \
+				session['user'], as_dict=1)
 		
 	def add_todo_item(self,args):
 		args = json.loads(args)
diff --git a/erpnext/home/page/dashboard/dashboard.js b/erpnext/home/page/dashboard/dashboard.js
index aac42a3..e8f2992 100644
--- a/erpnext/home/page/dashboard/dashboard.js
+++ b/erpnext/home/page/dashboard/dashboard.js
@@ -1,6 +1,6 @@
 pscript.onload_dashboard = function() {
 	// load jqplot
-	$.scriptPath = 'js/'
+	wn.require('lib/css/jqpot.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');
diff --git a/erpnext/home/page/event_updates/complete_registration.js b/erpnext/home/page/event_updates/complete_registration.js
new file mode 100644
index 0000000..4ed3fe9
--- /dev/null
+++ b/erpnext/home/page/event_updates/complete_registration.js
@@ -0,0 +1,88 @@
+// complete my company registration
+// --------------------------------
+pscript.complete_registration = function(is_complete) {
+	if(is_complete == 'No'){
+		var d = new Dialog(400, 200, "Please Complete Your Registration");
+		if(user != 'Administrator'){
+			d.no_cancel(); // Hide close image
+			$('header').toggle(false);
+		}
+
+		d.make_body([
+			['Data','Company Name','Example: Your Company LLC'],
+	  		['Data','Company Abbreviation', 'Example: YC (all your acconts will have this as a suffix)'],
+	  		['Select','Fiscal Year Start Date'],
+	  		['Select','Default Currency'],
+	  		['Button','Save'],
+		]);
+
+		// if company name is set, set the input value
+		// and disable it
+		if(wn.control_panel.company_name) {
+			d.widgets['Company Name'].value = wn.control_panel.company_name;
+			d.widgets['Company Name'].disabled = 1;
+		}
+		
+
+		//d.widgets['Save'].disabled = true;	  // disable Save button
+		pscript.make_dialog_field(d);
+
+		// submit details
+		d.widgets['Save'].onclick = function()
+		{
+			d.widgets['Save'].set_working();
+			
+			flag = pscript.validate_fields(d);
+			if(flag)
+			{
+				var args = [
+					d.widgets['Company Name'].value,
+					d.widgets['Company Abbreviation'].value,
+					d.widgets['Fiscal Year Start Date'].value,
+					d.widgets['Default Currency'].value
+				];
+				
+				$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
+					sys_defaults = r.message;
+					d.hide();
+					$('header').toggle(true);
+				});
+			}
+		}
+		d.show();
+	}
+}
+
+// make dialog fields
+// ------------------
+pscript.make_dialog_field = function(d)
+{
+	// fiscal year format 
+	fisc_format = d.widgets['Fiscal Year Start Date'];
+	add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']);
+  
+	// default currency
+	currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
+	currency = d.widgets['Default Currency'];
+	add_sel_options(currency, currency_list);
+}
+
+
+// validate fields
+// ---------------
+pscript.validate_fields = function(d)
+{
+	var lst = ['Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
+	var msg = 'Please enter the following fields';
+	var flag = 1;
+	for(var i=0; i<lst.length; i++)
+	{
+		if(!d.widgets[lst[i]].value){
+			flag = 0;
+			msg = msg + NEWLINE + lst[i];
+		}
+	}
+
+	if(!flag)  alert(msg);
+	return flag;
+}
\ No newline at end of file
diff --git a/erpnext/home/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js
index ee348e6..90aef9e 100644
--- a/erpnext/home/page/event_updates/event_updates.js
+++ b/erpnext/home/page/event_updates/event_updates.js
@@ -6,7 +6,7 @@
 			
 	pscript.home_make_body();
 	pscript.home_make_status();
-	pscript.home_pre_process();
+	pscript.home_set_banner();
 	pscript.home_make_widgets();
 }
 
@@ -30,9 +30,9 @@
 
 // ==================================
 
-pscript.home_pre_process = function(wrapper) {
+pscript.home_set_banner = function(wrapper) {
 	var wrapper = page_body.pages['Event Updates'];
-	var cp = locals['Control Panel']['Control Panel'];
+	var cp = wn.control_panel;
 
 	// banner
 	if(cp.client_name) {
@@ -212,7 +212,8 @@
 	var callback = function(r,rt) {
 		$(me.wrapper).slideUp();
 	}
-	$c_obj('Home Control',this.widget.delete_method, this.widget.get_item_id(this.det) ,callback);
+	$c_obj('Home Control',this.widget.delete_method, 
+		this.widget.get_item_id(this.det) ,callback);
 		
 }
 
@@ -324,7 +325,7 @@
 	this.widget.get_list_method = 'get_todo_list';
 	this.widget.delete_method = 'remove_todo_item';
 	this.widget.no_items_message = 'Nothing to do?';
-	this.widget.get_item_id = function(det) { return det[0]; }
+	this.widget.get_item_id = function(det) { return det.name; }
 
 	this.widget.decorator = this;
 
@@ -346,21 +347,32 @@
 	$y(tab, {tableLayout:'fixed'});
 
 	var span = $a($td(tab, 0, 0), 'span', '', {padding:'2px',color:'#FFF',fontSize:'10px'
-		,backgroundColor:(det[3]=='Low' ? '#888' : (det[3]=='High' ? '#EDA857' : '#687FD3'))});
+		, backgroundColor:(det.priority=='Low' ? '#888' : 
+			(det.priority=='High' ? '#EDA857' : '#687FD3'))});
 		
 	$(span).css('-moz-border-radius','3px').css('-webkit-border-radius','3px');
-	span.innerHTML = det[3];
+	span.innerHTML = det.priority;
 
 	// text
-	var span = $a($td(tab, 0, 1), 'span', 'social', {lineHeight:'1.5em'}, replace_newlines(det[1]));
-	if(det[4]) $y(span,{textDecoration:'line-through'});
+	var span = $a($td(tab, 0, 1), 'div', 'social', {lineHeight:'1.5em'}, 
+		replace_newlines(det.description));
+	if(det.checked) $y(span,{textDecoration:'line-through'});
+	
+	// reference link
+	if(det.reference_name) {
+		$a($td(tab, 0, 1), 'div', 'social', '', 
+			repl('<a href="#!Form/%(reference_type)s/%(reference_name)s">%(reference_name)s</a>',
+				det))
+	}
 	
 	// if expired & open, then in red
-	if(!det[4] && dateutil.str_to_obj(det[2]) < new Date()) {
+	if(!det.checked && dateutil.str_to_obj(det.date) < new Date()) {
 		$y(span,{color:'RED'}); 
-		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]) + ' (Overdue)');
+		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'},
+		 	dateutil.str_to_user(det.date) + ' (Overdue)');
 	} else {
-		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, dateutil.str_to_user(det[2]));		
+		$a($td(tab, 0, 1), 'div', '', {fontSize:'10px', color:'#666'}, 
+			dateutil.str_to_user(det.date));		
 	}
 }
 
@@ -371,10 +383,10 @@
 HomeToDo.prototype.set_dialog_values = function(det) {
 	var d = this.widget.dialog;
 	d.set_values({
-		date: det[2],
-		priority: det[3],
-		description: det[1],
-		checked: det[4]
+		date: det.date,
+		priority: det.priority,
+		description: det.description,
+		checked: det.checked
 	});
 	d.det = det;
 }
@@ -389,8 +401,7 @@
 	 	return;	
 	}
 
-	det.name = d.det ? d.det[0] : '';
-	
+	det.name = d.det.name;
 	var callback = function(r,rt) {
 		btn.done_working();
 		me.widget.dialog.hide();
@@ -420,9 +431,6 @@
 	// head
 
 	$a(this.head,'h1','', {display:'inline'}, 'Home'); 
-	$a(this.head,'span','link_type', {marginLeft:'7px', fontSize:'11px'}, 'help', function() {
-		msgprint('<b>What appears here?</b> This is where you get updates of everything you are permitted to follow')
-	})
 
 	// refresh
 	$a(this.head,'span','link_type', 
@@ -442,51 +450,36 @@
 }
 
 FeedList.prototype.make_list = function() {
-	this.list_area = $a(this.wrapper,'div')
-	this.no_result = $a(this.wrapper, 'div','help_box',{display:'none'},'Nothing to show yet. Your feed will be updated as you start your activities')
-	
-	var l = new Listing('Feed List',1);
 	var me = this;
-
-	// style
-	l.colwidths = ['100%']; l.page_len = 20;	
-	l.opts.cell_style = {padding:'0px'};
-	l.opts.hide_rec_label = 1;
+	this.list_area = $a(this.wrapper,'div')
 	
-	// build query
-	l.get_query = function(){
-		this.query = repl('select \
-			distinct t1.name, t1.doc_type, t1.doc_name, t1.subject, t1.modified_by, \
-			concat(ifnull(t2.first_name,""), " ", ifnull(t2.last_name,"")), t1.modified, t1.color \
+	this.list = new wn.widgets.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, \
+			concat(ifnull(t2.first_name,""), " ", ifnull(t2.last_name,"")) as full_name, \
+			t1.modified, t1.color \
 			from tabFeed t1, tabProfile t2, tabUserRole t3, tabDocPerm t4 \
 			where t1.doc_type = t4.parent \
 			and t2.name = t1.owner \
 			and t3.parent = "%(user)s" \
 			and t4.role = t3.role \
 			and ifnull(t4.`read`,0) = 1 \
-			order by t1.modified desc', {user:user})
-		this.query_max = ''
-	}
-	
-	// render list ui
-	l.show_cell = function(cell,ri,ci,d){ me.render_feed(cell,ri,ci,d); }
-	
-	// onrun
-	l.onrun = function(){ $(me.wrapper).fadeIn(); if(me.after_run) me.after_run(); }
-	
-	// make
-	l.make(this.list_area);
-	$dh(l.btn_area);
-
-	this.list = l;
+			order by t1.modified desc', {user:user}),
+		no_result_message: 'Nothing to show yet. Your feed will be updated as you start your activities',
+		render_row: function(parent, data) {
+			me.render_feed(parent, data)
+		},
+		onrun: function() {
+			$(me.wrapper).fadeIn(); 
+			if(me.after_run) me.after_run();
+		},
+		hide_refresh: true
+	});
 }
 
-FeedList.prototype.after_run = function() {
-	this.list.has_data() ? $dh(this.no_result) : $ds(this.no_result)
-}
-
-FeedList.prototype.render_feed = function(cell,ri,ci,d) {
-	new FeedItem(cell, d[ri], this);
+FeedList.prototype.render_feed = function(parent, data) {
+	new FeedItem(parent, data, this);
 }
 
 // Item
@@ -502,13 +495,11 @@
 	this.tab = make_table(this.wrapper, 1, 2, '100%', [(100/7)+'%', (600/7)+'%']);
 	$y(this.tab,{tableLayout:'fixed'})
 
-	// image
 	$y($td(this.tab,0,0),{textAlign:'right',paddingRight:'4px'});
 	
 	// text
 	this.text_area = $a($td(this.tab,0,1), 'div');
-	this.render_references(this.text_area, det);
-	
+	this.render_references(this.text_area, det);	
 	this.render_tag(det);
 	
 	// add day separator
@@ -520,12 +511,12 @@
 
 FeedItem.prototype.add_day_sep = function(det) {
 	var me = this;
-	var prev_date = det[6].split(' ')[0];
+	var prev_date = det.modified.split(' ')[0];
 	
 	var make_div = function() {
 		var div = $a(me.head, 'div', '', 
 			{borderBottom:'1px solid #888', margin:'8px 0px', padding:'2px 0px', color:'#888', fontSize:'11px'});
-		div.innerHTML = comment_when(det[6], 1);
+		div.innerHTML = comment_when(det.modified, 1);
 		
 		// today?
 		if(prev_date==get_today()) {
@@ -544,35 +535,47 @@
 // -------------------------------------------------
 
 FeedItem.prototype.render_tag = function(det) {
+	// type is the name
 	tag = $a($td(this.tab,0,0), 'div', '', 
-		{color:'#FFF', padding:'3px', textAlign:'right', fontSize:'11px', whiteSpace:'nowrap', overflow:'hidden', cursor:'pointer'});
+		{color:'#FFF', padding:'3px', textAlign:'right', fontSize:'11px', 
+			whiteSpace:'nowrap', overflow:'hidden', cursor:'pointer'});
 	$br(tag,'3px');
-	$y(tag, {backgroundColor:(det[7] ? det[7] : '#273')});
-	tag.innerHTML = get_doctype_label(det[1]);
-	tag.dt = det[1]
-	tag.onclick = function() { loaddocbrowser(this.dt); }
+	$y(tag, {backgroundColor:(det.color || '#273')});
+	
+	// tag label
+	tag.innerHTML = det.feed_type || get_doctype_label(det.doc_type);
+	
+	// not comment / label
+	if(!det.feed_type) {
+		tag.dt = det.doc_type;
+		tag.onclick = function() { loaddocbrowser(this.dt); }		
+	}
 }
 
 FeedItem.prototype.render_references = function(div, det) {
 	// name
-	div.tab = make_table(div, 1, 2, '100%', [null, '15%'])
-	//div.innerHTML = '<b>' + (strip(det[11]) ? det[11] : det[2]) + ' (' + cint(det[12]) + '): </b> has ' + det[7] + ' ';
-	
-	var dt = det[1]; var dn = det[2]
+	div.tab = make_table(div, 1, 2, '100%', [null, '15%'])	
+	var dt = det.doc_type; var dn = det.doc_name
 	
 	// link
-	var allow = in_list(profile.can_read, dt);
-	var span = $a($td(div.tab,0,0), 'span', (allow ? 'link_type': ''), null, det[2]);
-	span.dt = dt; span.dn = dn;
-	if(allow) span.onclick = function() { loaddoc(this.dt, this.dn); }
+	if(det.feed_type=='Login') {
+		// nothing - no link		
+	} else {
+		var allow = in_list(profile.can_read, dt);
+		var span = $a($td(div.tab,0,0), 'span', (allow ? 'link_type': ''), null, 
+			det.doc_name);
+		span.dt = dt; span.dn = dn;
+		if(allow) span.onclick = function() { loaddoc(this.dt, this.dn); }		
+	}
 	
 	// subject
-	if(det[3]) {
-		$a($td(div.tab,0,0), 'span', '', {marginLeft:'7px', color:'#444'}, det[3]);
+	if(det.subject) {
+		$a($td(div.tab,0,0), 'span', '', {marginLeft:'7px', color:'#444'}, det.subject);
 	}
 	
 	// by
-	$y($td(div.tab,0,1), {fontSize:'11px'}).innerHTML = (strip(det[5]) ? det[5] : det[4]);
+	$y($td(div.tab,0,1), {fontSize:'11px'}).innerHTML = 
+		(strip(det.full_name) ? det.full_name : det.modified_by);
 }
 
 HomeStatusBar = function() {
@@ -583,10 +586,6 @@
 	
 	this.render = function(r) {
 		this.wrapper.innerHTML = '';
-		this.profile_settings = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
-		this.profile_settings.innerHTML = user_fullname + ' (Profile Settings)';
-		this.profile_settings.onclick = function() { loadpage('profile-settings'); }
-
 		this.span = $a($a(this.wrapper, 'p'), 'span', 'link_type', {fontWeight:'bold'});
 		this.span.onclick = function() { loadpage('My Company')	}
 		
@@ -614,6 +613,7 @@
 	
 			// complete registration
 			if(in_list(user_roles,'System Manager')) { 
+				wn.require("erpnext/home/page/event_updates/complete_registration.js");
 				pscript.complete_registration(r.message.registration_complete); 
 			}
 			
@@ -625,95 +625,6 @@
 	);	
 }
 
-// complete my company registration
-// --------------------------------
-pscript.complete_registration = function(is_complete) {
-	if(is_complete == 'No'){
-		var d = new Dialog(400, 200, "Please Complete Your Registration");
-		if(user != 'Administrator'){
-			d.no_cancel(); // Hide close image
-			$dh(page_body.wntoolbar.wrapper);
-		}
-
-		d.make_body([
-			['Data','Company Name','Example: Your Company LLC'],
-	  		['Data','Company Abbreviation', 'Example: YC (all your acconts will have this as a suffix)'],
-	  		['Select','Fiscal Year Start Date'],
-	  		['Select','Default Currency'],
-	  		['Button','Save'],
-		]);
-
-		// if company name is set, set the input value
-		// and disable it
-		if(locals['Control Panel']['Control Panel'].company_name) {
-			d.widgets['Company Name'].value = locals['Control Panel']['Control Panel'].company_name;
-			d.widgets['Company Name'].disabled = 1;
-		}
-		
-
-		//d.widgets['Save'].disabled = true;	  // disable Save button
-		pscript.make_dialog_field(d);
-
-		// submit details
-		d.widgets['Save'].onclick = function()
-		{
-			d.widgets['Save'].set_working();
-			
-			flag = pscript.validate_fields(d);
-			if(flag)
-			{
-				var args = [
-					d.widgets['Company Name'].value,
-					d.widgets['Company Abbreviation'].value,
-					d.widgets['Fiscal Year Start Date'].value,
-					d.widgets['Default Currency'].value
-				];
-				
-				$c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
-					sys_defaults = r.message;
-					d.hide();
-					$ds(page_body.wntoolbar.wrapper);
-				});
-			}
-		}
-		d.show();
-	}
-}
-
-// make dialog fields
-// ------------------
-pscript.make_dialog_field = function(d)
-{
-	// fiscal year format 
-	fisc_format = d.widgets['Fiscal Year Start Date'];
-	add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']);
-  
-	// default currency
-	currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
-	currency = d.widgets['Default Currency'];
-	add_sel_options(currency, currency_list);
-}
-
-
-// validate fields
-// ---------------
-pscript.validate_fields = function(d)
-{
-	var lst = ['Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
-	var msg = 'Please enter the following fields';
-	var flag = 1;
-	for(var i=0; i<lst.length; i++)
-	{
-		if(!d.widgets[lst[i]].value){
-			flag = 0;
-			msg = msg + NEWLINE + lst[i];
-		}
-	}
-
-	if(!flag)  alert(msg);
-	return flag;
-}
-
 SetupWizard = function(status) { 
 	var me = this;
 	$.extend(this, {
diff --git a/erpnext/home/page/my_company/my_company.js b/erpnext/home/page/my_company/my_company.js
index 58ff91e..298b313 100644
--- a/erpnext/home/page/my_company/my_company.js
+++ b/erpnext/home/page/my_company/my_company.js
@@ -43,14 +43,11 @@
 //
 pscript.myc_add_user = function() {
 	var fields = [{
-		fieldtype: 'Data',
-		fieldname: 'user',
-		reqd: 1,
-		label: 'Email Id of the user to add'
-	}];
-
-	if(!pscript.is_erpnext_saas) {
-		fields = fields.concat([
+			fieldtype: 'Data',
+			fieldname: 'user',
+			reqd: 1,
+			label: 'Email Id of the user to add'
+		},
 		{
 			fieldtype: 'Data',
 			fieldname: 'first_name',
@@ -67,14 +64,14 @@
 			fieldname: 'password',
 			reqd: 1,
 			label: 'Password'
-		}]);		
-	}
+		},
+		{
+			fieldtype: 'Button',
+			label: 'Add',
+			fieldname: 'add'
+		}];
 
-	fields.push({
-		fieldtype: 'Button',
-		label: 'Add',
-		fieldname: 'add'
-	});
+	fields.push();
 
 	var d = new wn.widgets.Dialog({
 		title: 'Add User',
@@ -246,7 +243,8 @@
 		// image
 		this.img = $a($td(this.tab,0,0),'img','',{width:'41px'});
 		set_user_img(this.img, det.name, null, 
-			(det.file_list ? det.file_list.split(NEWLINE)[0].split(',')[1] : ('no_img_' + (det.gender=='Female' ? 'f' : 'm'))));		
+			(det.file_list ? det.file_list.split(NEWLINE)[0].split(',')[1] : 
+				('no_img_' + (det.gender=='Female' ? 'f' : 'm'))));
 	}
 	
 	// set other details like email id, name etc
@@ -464,7 +462,7 @@
 	// delete user
 	// create a confirm dialog and call server method
 	this.delete_user = function() {
-		var cp = locals['Control Panel']['Control Panel'];
+		var cp = wn.control_panel;
 
 		var d = new Dialog(400,200,'Delete User');
 		d.make_body([
@@ -581,7 +579,7 @@
 		$ds(this.member_item.working_img);
 		$dh(this.wrapper);
 		this.loading = 1;
-		$c('webnotes.widgets.form.getdoc', {'name':this.uid, 'doctype':'Profile', 'user':user}, callback);	// onload		
+		$c('webnotes.widgets.form.load.getdoc', {'name':this.uid, 'doctype':'Profile', 'user':user}, callback);	// onload		
 	}
 	
 	// show / hide
@@ -860,7 +858,7 @@
 	
 	var t = make_table($td(tbl, ridx, cidx),1,2,null,['16px', null],{marginRight:'5px'});
 	var ic = $a($td(t,0,0), 'img','',{cursor:'pointer', marginRight:'5px'});
-	ic.src= 'lib/images/icons/help.gif';
+	ic.src= 'lib/images/icons/help.png';
 	ic.role = role;
 		
 	ic.onclick = function(){
diff --git a/erpnext/home/page/my_company/my_company.py b/erpnext/home/page/my_company/my_company.py
index dcd54e1..48566f2 100644
--- a/erpnext/home/page/my_company/my_company.py
+++ b/erpnext/home/page/my_company/my_company.py
@@ -1,6 +1,7 @@
 import webnotes
 
 from webnotes.utils import cint, load_json, cstr
+from webnotes.model.doc import Document
 
 try: import json
 except: import simplejson as json
@@ -64,8 +65,7 @@
 # add profile record
 #
 def add_profile(args):
-	from webnotes.utils import validate_email_add
-	from webnotes.model.doc import Document
+	from webnotes.utils import validate_email_add, now
 	email = args['user']
 			
 	sql = webnotes.conn.sql
@@ -79,7 +79,7 @@
 	if sql("select name from tabProfile where name = %s", email):
 		# exists, enable it
 		sql("update tabProfile set enabled = 1, docstatus=0 where name = %s", email)
-		webnotes.msgprint('Profile exists, enabled it')
+		webnotes.msgprint('Profile exists, enabled it with new password')
 	else:
 		# does not exist, create it!
 		pr = Document('Profile')
@@ -91,11 +91,25 @@
 		pr.user_type = 'System User'
 		pr.save(1)
 
-		if args.get('password'):
-			sql("""
-				UPDATE tabProfile 
-				SET password = PASSWORD(%s)
-				WHERE name = %s""", (args.get('password'), email))
+	if args.get('password'):
+		sql("""
+			UPDATE tabProfile 
+			SET password = PASSWORD(%s), modified = %s
+			WHERE name = %s""", (args.get('password'), now, email))
+
+	send_welcome_mail(email, args)
+
+def send_welcome_mail(email, args):
+	"""send welcome mail to user with password and login url"""
+	pr = Document('Profile', email)
+	from webnotes.utils.email_lib import sendmail_md
+	args.update({
+		'company': webnotes.conn.get_default('company'),
+		'password': args.get('password'),
+		'account_url': webnotes.conn.get_default('account_url')
+	})
+	if not args.get('last_name'): args['last_name'] = ''
+	sendmail_md(pr.email, subject="Welcome to ERPNext", msg=welcome_txt % args)
 
 #
 # post comment
@@ -165,3 +179,20 @@
 		else:
 			webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", (args['new_password'], args['user']))
 	else: webnotes.msgprint('Settings Updated')
+
+welcome_txt = """
+## %(company)s
+
+Dear %(first_name)s %(last_name)s
+
+Welcome!
+
+A new account has been created for you, here are your details:
+
+login-id: %(user)s
+password: %(password)s
+
+To login to your new ERPNext account, please go to:
+
+%(account_url)s
+"""
diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py
index 22af804..ef969ca 100644
--- a/erpnext/home/page/profile_settings/profile_settings.py
+++ b/erpnext/home/page/profile_settings/profile_settings.py
@@ -8,16 +8,12 @@
 	"""
 	arg = load_json(arg)
 	
-	if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')):
-		import server_tools.gateway_utils
-		webnotes.msgprint(server_tools.gateway_utils.change_password(arg['old_password'], arg['new_password'])['message'])
-	else:
-		if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
-			webnotes.msgprint('Old password is not correct', raise_exception=1)
+	if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
+		webnotes.msgprint('Old password is not correct', raise_exception=1)
 			
-		from webnotes.utils import nowdate
-		webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
-		webnotes.msgprint('Password Updated');
+	from webnotes.utils import nowdate
+	webnotes.conn.sql("update tabProfile set password=password(%s), modified=%s where name=%s",(arg['new_password'], nowdate(), webnotes.session['user']))
+	webnotes.msgprint('Password Updated');
 
 def get_user_details(arg=None):
 	"""
diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js
index d040c53..78b5fd3 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.js
+++ b/erpnext/hr/doctype/appraisal/appraisal.js
@@ -90,8 +90,6 @@
 		
 		declare_completed_dialog.refresh_dt = function(){
 			cur_frm.cscript.refresh(this.doc, this.cdt, this.cdn);
-			msgprint("refersh done");
-			$c('webnotes.widgets.form.form_header.refresh_labels',this.doc,function(r,rt){});
 		}
 		
 		declare_completed_dialog.add = function() {
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/patches/jan_mar_2012/latest/__init__.py
similarity index 100%
rename from erpnext/utilities/doctype/sso_control/__init__.py
rename to erpnext/patches/jan_mar_2012/latest/__init__.py
diff --git a/erpnext/patches/jan_mar_2012/latest/cleanups.py b/erpnext/patches/jan_mar_2012/latest/cleanups.py
new file mode 100644
index 0000000..9a78a70
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/latest/cleanups.py
@@ -0,0 +1,35 @@
+import webnotes
+
+def execute():
+	from webnotes.model import delete_doc
+	from webnotes.modules import reload_doc
+	delete_doc("DocType", "SSO Control")
+	delete_doc("DocType", "WN ERP Client Control")
+	delete_doc("DocType", "Production Tips Common")
+	delete_doc("DocType", "DocTrigger")
+	delete_doc("Page", "Setup Wizard")
+	
+	# cleanup control panel
+	delete_doc("DocType", "Control Panel")
+	reload_doc("core", "doctype", "control_panel")
+
+	# cleanup page
+	delete_doc("DocType", "Page")
+	reload_doc("core", "doctype", "page")
+	
+	webnotes.conn.sql("""delete from tabSingles
+		where field like 'startup_%' and doctype='Control Panel'""")
+	webnotes.conn.sql("""delete from __SessionCache""")
+
+	webnotes.conn.commit()
+
+	# DDLs
+	# -------------------
+	
+	webnotes.conn.sql("drop table if exists tabDocTrigger")	
+
+	try: webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""")
+	except: pass
+		
+	webnotes.conn.sql("""alter table __PatchLog engine=InnoDB""")
+	
diff --git a/erpnext/patches/jan_mar_2012/latest/feed.py b/erpnext/patches/jan_mar_2012/latest/feed.py
new file mode 100644
index 0000000..c913c49
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/latest/feed.py
@@ -0,0 +1,6 @@
+import webnotes
+from webnotes.model.doc import Document
+from webnotes.modules import reload_doc
+
+def execute():
+	reload_doc('home', 'doctype', 'feed')
\ No newline at end of file
diff --git a/erpnext/patches/jan_mar_2012/latest/login.py b/erpnext/patches/jan_mar_2012/latest/login.py
new file mode 100644
index 0000000..97cd323
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/latest/login.py
@@ -0,0 +1,19 @@
+import webnotes
+from webnotes.model.doc import Document
+from webnotes.modules import reload_doc
+
+def execute():
+	add_default_home_page()
+	reload_doc('setup','doctype','manage_account')
+
+	
+def add_default_home_page():
+	if not webnotes.conn.sql("""select name from `tabDefault Home Page`
+		where role='Guest' and home_page='Login Page'"""):
+		d = Document('Default Home Page')
+		d.parent = 'Control Panel'
+		d.parenttype = 'Control Panel'
+		d.parentfield = 'default_home_pages'
+		d.role = 'Guest'
+		d.home_page = 'Login Page'
+		d.save(1)
diff --git a/erpnext/patches/jan_mar_2012/latest/website.py b/erpnext/patches/jan_mar_2012/latest/website.py
new file mode 100644
index 0000000..9c930e2
--- /dev/null
+++ b/erpnext/patches/jan_mar_2012/latest/website.py
@@ -0,0 +1,67 @@
+# website patch
+
+import webnotes
+from webnotes.model.doc import Document
+
+def execute():	
+	add_website_manager()
+	from webnotes.modules import reload_doc
+	from webnotes.model import delete_doc
+
+	reload_doc('setup', 'doctype', 'item_group')
+	delete_doc('Website', 'Module Def', 'Website')
+	reload_doc('website', 'Module Def', 'Website')
+	reload_doc('website', 'Role', 'Website Manager')
+
+	webnotes.conn.sql("""delete from `tabModule Def Role` where parent='Website'""")
+	d = Document('Module Def Role')
+	d.parent = 'Website'
+	d.role = 'Website Manager'
+	d.save()
+	
+	reload_doc('website', 'doctype', 'about_us_settings')
+	reload_doc('website', 'doctype', 'about_us_team')
+	reload_doc('website', 'doctype', 'blog')
+	reload_doc('website', 'doctype', 'blog_subscriber')
+	reload_doc('website', 'doctype', 'contact_us_settings')
+	reload_doc('website', 'doctype', 'product')
+	reload_doc('website', 'doctype', 'product_group')
+	reload_doc('website', 'doctype', 'products_settings')
+	reload_doc('website', 'doctype', 'related_page')
+	reload_doc('website', 'doctype', 'style_settings')
+	reload_doc('website', 'doctype', 'top_bar_item')
+	reload_doc('website', 'doctype', 'web_page')
+	reload_doc('website', 'doctype', 'website_settings')
+
+	reload_doc('website', 'page', 'about')
+	reload_doc('website', 'page', 'blog')
+	reload_doc('website', 'page', 'contact')
+	reload_doc('website', 'page', 'products')
+	reload_doc('website', 'page', 'unsubscribe')
+		
+	create_home_page()
+
+def create_home_page():
+	"""create a dummy home page"""
+	from webnotes.model.code import get_obj
+	if not webnotes.conn.sql("""select name from `tabWeb Page` where name='home'"""):
+		d = Document('Web Page')
+		d.title = 'Home'
+		d.head_section = "<h1>Your Headline</h1>"
+		d.main_section = "<p>Some introduction about your company</p>"
+		d.side_section = "<p>Links to other pages</p>"
+		d.save()
+		obj = get_obj(doc = d)
+		obj.validate()
+		obj.doc.save()
+
+def add_website_manager():
+	"""add website manager to system manager"""
+	for i in webnotes.conn.sql("""select distinct parent from tabUserRole 
+		where role='System Manager'"""):
+		if not webnotes.conn.sql("""select parent from tabUserRole 
+			where role='Website Manager' and parent=%s""", i[0]):
+			d = Document('UserRole')
+			d.parent = i[0]
+			d.role = 'Website Manager'
+			d.save(1)
diff --git a/erpnext/production/page/bill_of_materials/bill_of_materials.html b/erpnext/production/page/bill_of_materials/bill_of_materials.html
index 1263e44..55b4e70 100644
--- a/erpnext/production/page/bill_of_materials/bill_of_materials.html
+++ b/erpnext/production/page/bill_of_materials/bill_of_materials.html
@@ -1,4 +1,4 @@
-<div style="margin:0px">
+<div class="layout_wrapper">
 <div id="bom_header">&nbsp;</div>
 <!--
 <div style="color: #444444;" mce_style="color: #444444;">
diff --git a/erpnext/production/page/bill_of_materials/bill_of_materials.js b/erpnext/production/page/bill_of_materials/bill_of_materials.js
index f2c9b0a..c40fa11 100644
--- a/erpnext/production/page/bill_of_materials/bill_of_materials.js
+++ b/erpnext/production/page/bill_of_materials/bill_of_materials.js
@@ -1,4 +1,5 @@
 pscript['onload_Bill of Materials'] = function() {
+	wn.require('lib/js/legacy/widgets/tree.js');
 	
 	// header and toolbar
 	var h = new PageHeader('bom_header','Bill of Materials','BOM gives the breakdown of cost for product');
@@ -113,12 +114,11 @@
   $c('runserverobj', args={'doctype':'BOM Control', 'docname':'BOM Control', 'method':'calculate_cost', 'arg':pscript.bom_no}, function(r,rt) {
       var calculated = r.message;
       if (calculated == 'calculated') {pscript.show_bom();}
-      else  {$i('bom_tree').innerHTML = "Sorry it's taking too long try next time....";}
+      else  {$i('bom_tree').innerHTML = "Not available";}
   });	
 }
 
 pscript.collapse_all = function(){
-  alert("In");
   pscript.bom_tree.collapseall()
 }
 
diff --git a/erpnext/projects/page/projects/projects.js b/erpnext/projects/page/projects/projects.js
index 8335869..5f4c52d 100644
--- a/erpnext/projects/page/projects/projects.js
+++ b/erpnext/projects/page/projects/projects.js
@@ -58,7 +58,7 @@
 	var w = this.make_filter(label,idx);
 	var i = $a(w, 'input');
 
-	var user_fmt = locals['Control Panel']['Control Panel'].date_format;
+	var user_fmt = wn.control_panel.date_format;
 	if(!this.user_fmt)this.user_fmt = 'dd-mm-yy';
 
 	$(i).datepicker({
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index c0c4542..c7e400e 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -1,4 +1,5 @@
 pscript['onload_Sales Browser'] = function(){
+  wn.require('lib/js/legacy/widgets/tree.js');
   var parent = $i('tr_body');
   parent.innerHTML = 'Please select your chart: '
   var sel = $a(parent,'select');
@@ -139,7 +140,7 @@
         var has_children = true;
 
         if(cl[i].is_group=='No') {
-          var imgsrc = 'lib/images/icons/page.gif';
+          var imgsrc = 'lib/images/icons/page.png';
           has_children = false;
         }
         var t = me.tree.addNode(n, cl[i].name, imgsrc,me.tree.std_onclick, has_children ? me.tree.std_onexp : null);
@@ -219,7 +220,7 @@
       var has_children = true;
 
       if(cl[i].is_group=='No') {
-        var imgsrc = 'lib/images/icons/page.gif';
+        var imgsrc = 'lib/images/icons/page.png';
         has_children = false;
       }
      me.tree_area.innerHTML = ''; 
diff --git a/erpnext/selling/page/sales_dashboard/sales_dashboard.js b/erpnext/selling/page/sales_dashboard/sales_dashboard.js
index cdb5c7c..d15c602 100644
--- a/erpnext/selling/page/sales_dashboard/sales_dashboard.js
+++ b/erpnext/selling/page/sales_dashboard/sales_dashboard.js
@@ -5,11 +5,10 @@
   $dh(pscript.mnt_div);
   $dh(pscript.mnt_div1);
   //pscript.dx_axis = [];
-  
-  if($.jqplot) pscript.all_onchnge();
-  else
-    // import the library
-    $c_js('jquery/jquery.jqplot.min.js', pscript.all_onchnge);
+
+	wn.require('lib/css/jqpot.css');
+	wn.require('lib/js/legacy/jquery/jquery.jqplot.min.js');
+	pscript.all_onchnge();
 }
 //=======================================================================
 pscript.make_filters = function(){
diff --git a/erpnext/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.txt
index d2604fd..7c3e928 100644
--- a/erpnext/setup/doctype/item_group/item_group.txt
+++ b/erpnext/setup/doctype/item_group/item_group.txt
@@ -5,52 +5,54 @@
 	{
 		'creation': '2010-08-08 17:09:06',
 		'docstatus': 0,
-		'modified': '2010-12-24 11:58:29',
-		'modified_by': 'abhishek@webnotestech.com',
-		'owner': 'Administrator'
+		'modified': '2012-02-06 17:38:00',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
+		'_last_update': u'1322549700',
 		'allow_trash': 1,
-		'autoname': 'field:item_group_name',
-		'colour': 'White:FFF',
+		'autoname': u'field:item_group_name',
+		'colour': u'White:FFF',
+		'default_print_format': u'Standard',
 		'doctype': 'DocType',
-		'document_type': 'Master',
+		'document_type': u'Master',
 		'in_create': 1,
 		'issingle': 0,
-		'module': 'Setup',
+		'module': u'Setup',
 		'name': '__common__',
-		'search_fields': 'parent_item_group',
-		'section_style': 'Simple',
-		'server_code_error': ' ',
+		'search_fields': u'parent_item_group',
+		'section_style': u'Simple',
+		'server_code_error': u' ',
 		'show_in_menu': 0,
-		'version': 54
+		'version': 58
 	},
 
 	# These values are common for all DocField
 	{
-		'doctype': 'DocField',
+		'doctype': u'DocField',
 		'name': '__common__',
-		'parent': 'Item Group',
-		'parentfield': 'fields',
-		'parenttype': 'DocType'
+		'parent': u'Item Group',
+		'parentfield': u'fields',
+		'parenttype': u'DocType'
 	},
 
 	# These values are common for all DocPerm
 	{
-		'doctype': 'DocPerm',
+		'doctype': u'DocPerm',
 		'name': '__common__',
-		'parent': 'Item Group',
-		'parentfield': 'permissions',
-		'parenttype': 'DocType',
+		'parent': u'Item Group',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
 		'read': 1
 	},
 
 	# DocType, Item Group
 	{
 		'doctype': 'DocType',
-		'name': 'Item Group'
+		'name': u'Item Group'
 	},
 
 	# DocPerm
@@ -58,10 +60,9 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
-		'idx': 1,
+		'doctype': u'DocPerm',
 		'permlevel': 1,
-		'role': 'Material Manager',
+		'role': u'Material Manager',
 		'submit': 0,
 		'write': 0
 	},
@@ -71,10 +72,9 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
-		'idx': 2,
+		'doctype': u'DocPerm',
 		'permlevel': 0,
-		'role': 'Material Manager',
+		'role': u'Material Manager',
 		'submit': 0,
 		'write': 0
 	},
@@ -84,10 +84,9 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
-		'idx': 3,
+		'doctype': u'DocPerm',
 		'permlevel': 1,
-		'role': 'Material User',
+		'role': u'Material User',
 		'submit': 0,
 		'write': 0
 	},
@@ -97,10 +96,9 @@
 		'amend': 0,
 		'cancel': 0,
 		'create': 0,
-		'doctype': 'DocPerm',
-		'idx': 4,
+		'doctype': u'DocPerm',
 		'permlevel': 0,
-		'role': 'Material User',
+		'role': u'Material User',
 		'submit': 0,
 		'write': 0
 	},
@@ -109,10 +107,9 @@
 	{
 		'cancel': 1,
 		'create': 1,
-		'doctype': 'DocPerm',
-		'idx': 5,
+		'doctype': u'DocPerm',
 		'permlevel': 0,
-		'role': 'System Manager',
+		'role': u'System Manager',
 		'write': 1
 	},
 
@@ -120,106 +117,98 @@
 	{
 		'cancel': 1,
 		'create': 1,
-		'doctype': 'DocPerm',
-		'idx': 6,
+		'doctype': u'DocPerm',
 		'permlevel': 0,
-		'role': 'Material Master Manager',
+		'role': u'Material Master Manager',
 		'write': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'trash_reason',
-		'fieldtype': 'Small Text',
-		'idx': 1,
-		'label': 'Trash Reason',
-		'oldfieldname': 'trash_reason',
-		'oldfieldtype': 'Small Text',
-		'permlevel': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'item_group_name',
-		'fieldtype': 'Data',
-		'idx': 2,
-		'label': 'Item Group Name',
-		'oldfieldname': 'item_group_name',
-		'oldfieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'item_group_name',
+		'fieldtype': u'Data',
+		'label': u'Item Group Name',
+		'oldfieldname': u'item_group_name',
+		'oldfieldtype': u'Data',
 		'permlevel': 0,
 		'reqd': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'show_in_catalogue',
-		'fieldtype': 'Check',
-		'idx': 3,
-		'label': 'Show in catalogue',
-		'oldfieldname': 'show_in_catalogue',
-		'oldfieldtype': 'Check',
+		'doctype': u'DocField',
+		'fieldname': u'description',
+		'fieldtype': u'Text',
+		'label': u'Description',
+		'oldfieldname': u'description',
+		'oldfieldtype': u'Text',
+		'permlevel': 0,
+		'width': u'300px'
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Check this if you want to show in website',
+		'doctype': u'DocField',
+		'fieldname': u'show_in_website',
+		'fieldtype': u'Check',
+		'label': u'Show in Website',
 		'permlevel': 0
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'description',
-		'fieldtype': 'Text',
-		'idx': 4,
-		'label': 'Description',
-		'oldfieldname': 'description',
-		'oldfieldtype': 'Text',
-		'permlevel': 0,
-		'width': '300px'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'parent_item_group',
-		'fieldtype': 'Link',
-		'idx': 5,
-		'label': 'Parent Item Group',
-		'oldfieldname': 'parent_item_group',
-		'oldfieldtype': 'Link',
-		'options': 'Item Group',
+		'doctype': u'DocField',
+		'fieldname': u'parent_item_group',
+		'fieldtype': u'Link',
+		'label': u'Parent Item Group',
+		'oldfieldname': u'parent_item_group',
+		'oldfieldtype': u'Link',
+		'options': u'Item Group',
 		'permlevel': 0,
 		'reqd': 1,
-		'trigger': 'Client'
+		'trigger': u'Client'
 	},
 
 	# DocField
 	{
-		'colour': 'White:FFF',
-		'description': 'Only leaf nodes are allowed in transaction',
-		'doctype': 'DocField',
-		'fieldname': 'is_group',
-		'fieldtype': 'Select',
-		'idx': 6,
-		'label': 'Has Child Node',
-		'oldfieldname': 'is_group',
-		'oldfieldtype': 'Select',
-		'options': '\nYes\nNo',
+		'colour': u'White:FFF',
+		'description': u'Only leaf nodes are allowed in transaction',
+		'doctype': u'DocField',
+		'fieldname': u'is_group',
+		'fieldtype': u'Select',
+		'label': u'Has Child Node',
+		'oldfieldname': u'is_group',
+		'oldfieldtype': u'Select',
+		'options': u'\nYes\nNo',
 		'permlevel': 0,
 		'reqd': 1
 	},
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'lft',
-		'fieldtype': 'Int',
+		'doctype': u'DocField',
+		'fieldname': u'trash_reason',
+		'fieldtype': u'Small Text',
+		'label': u'Trash Reason',
+		'oldfieldname': u'trash_reason',
+		'oldfieldtype': u'Small Text',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'lft',
+		'fieldtype': u'Int',
 		'hidden': 1,
-		'idx': 7,
 		'in_filter': 1,
-		'label': 'lft',
+		'label': u'lft',
 		'no_copy': 1,
-		'oldfieldname': 'lft',
-		'oldfieldtype': 'Int',
+		'oldfieldname': u'lft',
+		'oldfieldtype': u'Int',
 		'permlevel': 0,
 		'print_hide': 1,
 		'report_hide': 0,
@@ -228,16 +217,15 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'rgt',
-		'fieldtype': 'Int',
+		'doctype': u'DocField',
+		'fieldname': u'rgt',
+		'fieldtype': u'Int',
 		'hidden': 1,
-		'idx': 8,
 		'in_filter': 1,
-		'label': 'rgt',
+		'label': u'rgt',
 		'no_copy': 1,
-		'oldfieldname': 'rgt',
-		'oldfieldtype': 'Int',
+		'oldfieldname': u'rgt',
+		'oldfieldtype': u'Int',
 		'permlevel': 0,
 		'print_hide': 1,
 		'report_hide': 0,
@@ -246,17 +234,17 @@
 
 	# DocField
 	{
-		'doctype': 'DocField',
-		'fieldname': 'old_parent',
-		'fieldtype': 'Data',
+		'doctype': u'DocField',
+		'fieldname': u'old_parent',
+		'fieldtype': u'Link',
 		'hidden': 1,
-		'idx': 9,
-		'label': 'old_parent',
+		'label': u'old_parent',
 		'no_copy': 1,
-		'oldfieldname': 'old_parent',
-		'oldfieldtype': 'Data',
+		'oldfieldname': u'old_parent',
+		'oldfieldtype': u'Data',
+		'options': u'Item Group',
 		'permlevel': 0,
 		'print_hide': 1,
 		'report_hide': 1
 	}
-]
\ No newline at end of file
+]
diff --git a/erpnext/setup/doctype/manage_account/manage_account.js b/erpnext/setup/doctype/manage_account/manage_account.js
index 7c3b193..63cc1d5 100644
--- a/erpnext/setup/doctype/manage_account/manage_account.js
+++ b/erpnext/setup/doctype/manage_account/manage_account.js
@@ -1,6 +1,6 @@
 // Validate
 cur_frm.cscript.validate = function(doc, cdt, cdn) {
-  $c_obj(make_doclist(cdt, cdn), 'update_cp', '', function(r, rt){
+  $c_obj(make_doclist(cdt, cdn), 'get_defaults', '', function(r, rt){
     sys_defaults = r.message;
   });
 }
\ No newline at end of file
diff --git a/erpnext/setup/doctype/manage_account/manage_account.py b/erpnext/setup/doctype/manage_account/manage_account.py
index 5b1292a..757d323 100644
--- a/erpnext/setup/doctype/manage_account/manage_account.py
+++ b/erpnext/setup/doctype/manage_account/manage_account.py
@@ -1,66 +1,60 @@
-# Please edit this list and import only required elements
+"""Global Defaults"""
 import webnotes
 
-from webnotes.utils import cint, cstr, get_defaults, set_default, fmt_money, get_last_day, get_first_day
-from webnotes import session, form, is_testing, msgprint, errprint
-
-sql = webnotes.conn.sql
-
-	
-# -----------------------------------------------------------------------------------------
-
+keydict = {
+	"fiscal_year": "current_fiscal_year",
+    'company': 'default_company',
+    'currency': 'default_currency',
+    'price_list_name': 'default_price_list',
+	'price_list_currency': 'default_price_list_currency',
+    'item_group': 'default_item_group',
+    'customer_group': 'default_customer_group',
+    'cust_master_name': 'cust_master_name', 
+    'supplier_type': 'default_supplier_type',
+    'supp_master_name': 'supp_master_name', 
+    'territory': 'default_territory',
+    'stock_uom': 'default_stock_uom',
+    'fraction_currency': 'default_currency_fraction',
+    'valuation_method': 'default_valuation_method',
+	'date_format': 'date_format',
+	'currency_format':'default_currency_format',
+	'account_url':'account_url'
+}
 
 class DocType:
-  def __init__(self, d, dl):
-    self.doc, self.doclist = d, dl
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
 
-#---------------------------------------------------------------------------------------------------------------------------------------------  
-  def get_bal(self,arg):
-    bal = sql("select `tabAccount Balance`.balance,`tabAccount`.debit_or_credit from `tabAccount`,`tabAccount Balance` where `tabAccount Balance`.account=%s and `tabAccount Balance`.period=%s and `tabAccount Balance`.account=`tabAccount`.name ",(arg,self.doc.current_fiscal_year))
-    if bal:
-      return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
-
-
-# =========================================================================================================================================
-
-  # Update Default
-  # ---------------
-  def set_system_default(self, defkey, defvalue):
-    set_default(defkey, defvalue)
-
-    if defkey == 'fiscal_year':
-      ysd = sql("select year_start_date from `tabFiscal Year` where name=%s", cstr(defvalue))
-      ysd = ysd and ysd[0][0] or ''
-      if ysd:
-        set_default('year_start_date', ysd.strftime('%Y-%m-%d'))
-        set_default('year_end_date', get_last_day(get_first_day(ysd,0,11)).strftime('%Y-%m-%d'))
-
-
-  # Update
-  # --------
-  def update_cp(self):
-    def_list = [['fiscal_year',self.doc.current_fiscal_year],
-                ['company',self.doc.default_company],
-                ['currency',self.doc.default_currency],
-                ['price_list_name',self.doc.default_price_list or ''],
-				['price_list_currency', self.doc.default_price_list_currency or ''],
-                ['item_group',self.doc.default_item_group or ''],
-                ['customer_group',self.doc.default_customer_group or ''],
-                ['cust_master_name',self.doc.cust_master_name or ''], 
-                ['supplier_type',self.doc.default_supplier_type or ''],
-                ['supp_master_name',self.doc.supp_master_name], 
-                ['territory',self.doc.default_territory or ''],
-                ['stock_uom',self.doc.default_stock_uom or ''],
-                ['fraction_currency',self.doc.default_currency_fraction or ''],
-                ['valuation_method',self.doc.default_valuation_method]]
-
-    for d in def_list:
-      self.set_system_default(d[0],d[1])
-    # Update Currency Format
+	def get_bal(self,arg):
+		"""get account balance (??)"""
+		from webnotes.utils import fmt_money, flt
+		bal = webnotes.conn.sql("select `tabAccount Balance`.balance,`tabAccount`.debit_or_credit from `tabAccount`,`tabAccount Balance` where `tabAccount Balance`.account=%s and `tabAccount Balance`.period=%s and `tabAccount Balance`.account=`tabAccount`.name ",(arg,self.doc.current_fiscal_year))
+		if bal:
+			return fmt_money(flt(bal[0][0])) + ' ' + bal[0][1]
 	
-    sql("update `tabSingles` set value = '%s' where field = 'currency_format' and doctype = 'Control Panel'" % self.doc.default_currency_format)
-    sql("update `tabSingles` set value = '%s' where field = 'date_format' and doctype = 'Control Panel'" %self.doc.date_format)
-
-
-    return get_defaults()
-
+	def validate(self):
+		"""validate"""
+		if not (self.doc.account_url and (self.doc.account_url.startswith('http://') \
+			or self.doc.account_url.startswith('https://'))):
+			webnotes.msgprint("Account URL must start with 'http://' or 'https://'", raise_exception=1)
+	
+	def on_update(self):
+		"""update defaults"""
+		self.validate()
+		
+		for key in keydict:
+			webnotes.conn.set_default(key, self.doc.fields.get(keydict[key], ''))
+			
+		# update year start date and year end date from fiscal_year
+		ysd = webnotes.conn.sql("""select year_start_date from `tabFiscal Year` 
+			where name=%s""", self.doc.fiscal_year)
+			
+		ysd = ysd and ysd[0][0] or ''
+		from webnotes.utils import get_first_day, get_last_day
+		if ysd:
+			webnotes.conn.set_default('year_start_date', ysd.strftime('%Y-%m-%d'))
+			webnotes.conn.set_default('year_end_date', \
+				get_last_day(get_first_day(ysd,0,11)).strftime('%Y-%m-%d'))
+		
+	def get_defaults(self):
+		return webnotes.conn.get_defaults()
\ No newline at end of file
diff --git a/erpnext/setup/doctype/manage_account/manage_account.txt b/erpnext/setup/doctype/manage_account/manage_account.txt
index 8a156a0..18a9872 100644
--- a/erpnext/setup/doctype/manage_account/manage_account.txt
+++ b/erpnext/setup/doctype/manage_account/manage_account.txt
@@ -5,14 +5,13 @@
 	{
 		'creation': '2010-08-08 17:09:09',
 		'docstatus': 0,
-		'modified': '2011-12-21 13:22:33',
+		'modified': '2012-01-20 11:25:18',
 		'modified_by': 'Administrator',
 		'owner': 'Administrator'
 	},
 
 	# These values are common for all DocType
 	{
-
 		'_last_update': '1323855502',
 		'allow_copy': 1,
 		'allow_email': 1,
@@ -29,7 +28,7 @@
 		'section_style': 'Tabbed',
 		'server_code_error': ' ',
 		'show_in_menu': 1,
-		'version': 515
+		'version': 517
 	},
 
 	# These values are common for all DocField
@@ -106,6 +105,37 @@
 	{
 		'doctype': 'DocField',
 		'fieldtype': 'Section Break',
+		'label': 'System'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Example: http://frappe.erpnext.com',
+		'doctype': 'DocField',
+		'fieldname': 'account_url',
+		'fieldtype': 'Data',
+		'label': 'Account URL'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldtype': 'Column Break'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'sms_sender_name',
+		'fieldtype': 'Data',
+		'label': 'SMS Sender Name'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldtype': 'Section Break',
 		'label': 'Company'
 	},
 
@@ -176,14 +206,6 @@
 	# DocField
 	{
 		'doctype': 'DocField',
-		'fieldname': 'sms_sender_name',
-		'fieldtype': 'Data',
-		'label': 'SMS Sender Name'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
 		'fieldtype': 'Section Break',
 		'label': 'Stock'
 	},
@@ -510,4 +532,4 @@
 		'label': 'Employee Records to be created by ',
 		'options': '\nNaming Series\nEmployee Number'
 	}
-]
+]
\ No newline at end of file
diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js
index 2e9bb10..d8133bb 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.js
+++ b/erpnext/setup/doctype/notification_control/notification_control.js
@@ -6,7 +6,7 @@
       refresh_field('custom_message');
     }
     $c_obj('Notification Control','get_message',doc.select_transaction, callback)
-  }
+}
 }
 
 cur_frm.cscript.notify = function(doc, args) {
diff --git a/erpnext/setup/page/setup/setup.html b/erpnext/setup/page/setup/setup.html
index e60d00b..ec21ab7 100644
--- a/erpnext/setup/page/setup/setup.html
+++ b/erpnext/setup/page/setup/setup.html
@@ -1 +1,3 @@
-<div id="setup_div" class="layout_wrapper"></div>
\ No newline at end of file
+<div id="setup_div" class="layout_wrapper">
+	<div style="margin: 200px auto; text-align: center; color: #888">Loading...</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/setup/page/setup/setup.js b/erpnext/setup/page/setup/setup.js
index b3a195e..d58f11a 100644
--- a/erpnext/setup/page/setup/setup.js
+++ b/erpnext/setup/page/setup/setup.js
@@ -1,9 +1,8 @@
 pscript.onload_Setup = function() {
   var parent = $i('setup_div');
-  add_space_holder(parent);
 
   var callback = function(r,rt){
-
+    $('#setup_div').empty();
     // header
     parent.page_head = new PageHeader(parent,'Setup');
     
@@ -11,7 +10,6 @@
     var setup_data = new SetupData(r.message);
     pscript.setup_make_sections(setup_data);
     
-    remove_space_holder();
   }
   $c_obj('Setup Wizard Control','get_country','',callback);  
 }
diff --git a/erpnext/setup_masters/Module Def/Setup Masters/Setup Masters.txt b/erpnext/setup_masters/Module Def/Setup Masters/Setup Masters.txt
new file mode 100644
index 0000000..fe1a048
--- /dev/null
+++ b/erpnext/setup_masters/Module Def/Setup Masters/Setup Masters.txt
@@ -0,0 +1,29 @@
+# Module Def, Setup Masters
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2010-08-08 17:35:42',
+		'docstatus': 0,
+		'modified': '2012-01-23 17:04:53',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Module Def
+	{
+		'disabled': 'No',
+		'doctype': u'Module Def',
+		'is_hidden': 'No',
+		'last_updated_date': '2010-11-29 12:02:02',
+		'module_label': 'Setup Masters',
+		'module_name': 'Setup Masters',
+		'name': '__common__'
+	},
+
+	# Module Def, Setup Masters
+	{
+		'doctype': u'Module Def',
+		'name': 'Setup Masters'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index 304d2e4..3c6281f 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -1,103 +1,68 @@
 import webnotes
 import webnotes.defs
 from webnotes.utils import cint
+import home
 
-#
-# alias the current user
-#
 def on_login(login_manager):
-
-	# login as
-	if login_manager.user == 'Administrator':
-		user = webnotes.form.getvalue('login_as')
-	   
-		if user:
-			# create if missing (due to some bug)
-			login_as(user, login_manager)
-
-			# alisaing here... so check if the user is disabled
-			if not webnotes.conn.sql("select ifnull(enabled,0) from tabProfile where name=%s", user)[0][0]:
-				# throw execption
-				webnotes.msgprint("Authentication Failed", raise_exception=1)
-
-			if hasattr(webnotes.defs, 'validate_ip'):
-				msg = getattr(webnotes.defs, 'validate_ip')()
-				if msg: webnotes.msgprint(msg, raise_exception=1)
-			
-			login_manager.user = user
-
-#
-# update account details
-#
-def update_account_details():
-	# additional details (if from gateway)
-	if webnotes.form_dict.get('is_trial'):
-		webnotes.conn.set_global('is_trial', cint(webnotes.form_dict.get('is_trial')))
-
-	if webnotes.form_dict.get('days_to_expiry'):
-		webnotes.conn.set_global('days_to_expiry', webnotes.form_dict.get('days_to_expiry'))
-
-	if webnotes.form_dict.get('first_name'):
-		from server_tools.gateway_utils import update_user_details
-		update_user_details()
+	"""
+		called from login manager, before login
+	"""
+	if login_manager.user not in ('Guest', None, ''):
+		try:
+			import server_tools.gateway_utils
+			server_tools.gateway_utils.check_login(login_manager.user)
+		except ImportError:
+			pass
 		
-#
-# save (login from)
-#
 def on_login_post_session(login_manager):
-	# login from
-	if webnotes.form_dict.get('login_from'):
-		webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from')
-		webnotes.session_obj.update()
-	
+	"""
+		called after login
+		update login_from and delete parallel sessions
+	"""
 	# Clear previous sessions i.e. logout previous log-in attempts
-	exception_list = ['demo@webnotestech.com', 'Administrator']
+	exception_list = ['demo@webnotestech.com', 'Administrator', 'Guest']
 	if webnotes.session['user'] not in exception_list:
 		sid_list = webnotes.conn.sql("""
-			SELECT sid
-			FROM `tabSessions`
+			DELETE FROM `tabSessions`
 			WHERE
 				user=%s AND
-				sid!=%s
-			ORDER BY lastupdate desc""", \
+				sid!=%s""", \
 			(webnotes.session['user'], webnotes.session['sid']), as_list=1)
-		for sid in sid_list:
-			webnotes.conn.sql("DELETE FROM `tabSessions` WHERE sid=%s", sid[0])
 
-	update_account_details()
+	if webnotes.session['user'] not in ('Guest'):
+		# create feed
+		from webnotes.utils import nowtime
+		home.make_feed('Login', 'Profile', login_manager.user, login_manager.user,
+			'%s logged in at %s' % (login_manager.user_fullname, nowtime()), 
+			login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D')		
 
-#
-# logout the user from SSO
-#
-def on_logout(login_manager):
-	if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')):
-		from server_tools.gateway_utils import logout_sso
-		logout_sso(user=login_manager.user)
+def comment_added(doc):
+	"""add comment to feed"""
+	import json
+	home.make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by,
+		'<i>"' + doc.comment + '"</i>', '#6B24B3')
 
-#
-# create a profile (if logs in for the first time)
-#
-def login_as(user, login_manager):
-	import os
+def doclist_all(doc, method):
+	"""doclist trigger called from webnotes.model.doclist on any event"""
+	home.update_feed(doc, method)
+	
+def boot_session(bootinfo):
+	"""boot session - send website info if guest"""
 	import webnotes
-	webnotes.session = {'user': user}
-	ip = os.environ.get('REMOTE_ADDR')
+	import webnotes.model.doc
+	
+	if webnotes.session['user']=='Guest':
+		bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
+		bootinfo['website_menus'] = webnotes.conn.sql("""select label, url, custom_page, 
+			parent_label, parentfield
+			from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
+		bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
+	else:	
+		bootinfo['letter_heads'] = get_letter_heads()
 
-	# validate if user is from SSO
-	if ip == '72.55.168.105' or 1:
-		# if user does not exist, create it
-		if not webnotes.conn.sql("select name from tabProfile where name=%s", user):
-			from webnotes.model.doc import Document
-			
-			import webnotes
-			import webnotes.utils.webservice    
-
-			p = Document('Profile')
-			p.first_name = webnotes.form_dict.get('first_name')
-			p.last_name = webnotes.form_dict.get('last_name')
-			p.email = user
-			p.name = user
-			p.enabled = 1
-			p.owner = user
-			p.save(1)
-			
+def get_letter_heads():
+	"""load letter heads with startup"""
+	import webnotes
+	ret = webnotes.conn.sql("""select name, content from `tabLetter Head` 
+		where ifnull(disabled,0)=0""")
+	return dict(ret)
diff --git a/erpnext/startup/feature_setup.js b/erpnext/startup/feature_setup.js
new file mode 100644
index 0000000..ba81cbd
--- /dev/null
+++ b/erpnext/startup/feature_setup.js
@@ -0,0 +1,187 @@
+/* features setup "Dictionary", "Script"
+Dictionary Format
+	'projects': {
+		'Sales Order': {
+			'fields':['project_name'],
+			'sales_order_details':['projected_qty']
+		},
+		'Purchase Order': {
+			'fields':['project_name']
+		}
+	}
+// ====================================================================*/
+pscript.feature_dict = {
+	'fs_projects': {
+		'Bill Of Materials': {'fields':['project_name']},
+		'Delivery Note': {'fields':['project_name']},
+		'Payable Voucher': {'fields':['project_name']},
+		'Production Order': {'fields':['project_name']},
+		'Purchase Order': {'fields':['project_name']},
+		'Purchase Receipt': {'fields':['project_name']},
+		'Receivable Voucher': {'fields':['project_name']},
+		'Sales Order': {'fields':['project_name']},
+		'Stock Entry': {'fields':['project_name']},
+		'Timesheet': {'timesheet_details':['project_name']}
+	},
+	'fs_packing_details': {
+		'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
+		'Sales Order': {'fields':['packing_details']}
+	},
+	'fs_discounts': {
+		'Delivery Note': {'delivery_note_details':['adj_rate']},
+		'Quotation': {'quotation_details':['adj_rate']},
+		'Receivable Voucher': {'entries':['adj_rate']},
+		'Sales Order': {'sales_order_details':['adj_rate','ref_rate']}
+	},
+	'fs_purchase_discounts': {
+		'Purchase Order': {'po_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
+		'Purchase Receipt': {'purchase_receipt_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
+		'Payable Voucher': {'entries':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']}
+	},
+	'fs_brands': {
+		'Delivery Note': {'delivery_note_details':['brand']},
+		'Indent': {'indent_details':['brand']},
+		'Item': {'fields':['brand']},
+		'Purchase Order': {'po_details':['brand']},
+		'Payable Voucher': {'entries':['brand']},
+		'Quotation': {'quotation_details':['brand']},
+		'Receivable Voucher': {'entries':['brand']},
+		'Sales BOM': {'fields':['new_item_brand']},
+		'Sales Order': {'sales_order_details':['brand']},
+		'Serial No': {'fields':['brand']}
+	},
+	'fs_after_sales_installations': {
+		'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}
+	},
+	'fs_item_batch_nos': {
+		'Delivery Note': {'delivery_note_details':['batch_no']},
+		'Item': {'fields':['has_batch_no']},
+		'Purchase Receipt': {'purchase_receipt_details':['batch_no']},
+		'QA Inspection Report': {'fields':['batch_no']},
+		'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
+		'Receivable Voucher': {'entries':['batch_no']},
+		'Stock Entry': {'mtn_details':['batch_no']},
+		'Stock Ledger Entry': {'fields':['batch_no']}
+	},
+	'fs_item_serial_nos': {
+		'Customer Issue': {'fields':['serial_no']},
+		'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']},
+		'Installation Note': {'installed_item_details':['serial_no']},
+		'Item': {'fields':['has_serial_no']},
+		'Maintenance Schedule': {'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']},
+		'Maintenance Visit': {'maintenance_visit_details':['serial_no']},
+		'Purchase Receipt': {'purchase_receipt_details':['serial_no']},
+		'QA Inspection Report': {'fields':['item_serial_no']},
+		'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
+		'Receivable Voucher': {'entries':['serial_no']},
+		'Stock Entry': {'mtn_details':['serial_no']},
+		'Stock Ledger Entry': {'fields':['serial_no']}
+	},
+	'fs_item_group_in_details': {
+		'Delivery Note': {'delivery_note_details':['item_group']},
+		'Enquiry': {'enquiry_details':['item_group']},
+		'Indent': {'indent_details':['item_group']},
+		'Item': {'fields':['item_group']},
+		'Manage Account': {'fields':['default_item_group']},
+		'Purchase Order': {'po_details':['item_group']},
+		'Purchase Receipt': {'purchase_receipt_details':['item_group']},
+		'Purchase Voucher': {'entries':['item_group']},
+		'Quotation': {'quotation_details':['item_group']},
+		'Receivable Voucher': {'entries':['item_group']},
+		'Sales BOM': {'fields':['serial_no']},
+		'Sales Order': {'sales_order_details':['item_group']},
+		'Serial No': {'fields':['item_group']},
+		'Sales Partner': {'partner_target_details':['item_group']},
+		'Sales Person': {'target_details':['item_group']},
+		'Territory': {'target_details':['item_group']}
+	},
+	'fs_page_break': {
+		'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']},
+		'Indent': {'indent_details':['page_break']},
+		'Purchase Order': {'po_details':['page_break']},
+		'Purchase Receipt': {'purchase_receipt_details':['page_break']},
+		'Purchase Voucher': {'entries':['page_break']},
+		'Quotation': {'quotation_details':['page_break']},
+		'Receivable Voucher': {'entries':['page_break']},
+		'Sales Order': {'sales_order_details':['page_break']}
+	},
+	'fs_exports': {
+		'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate']},
+		'POS Setting': {'fields':['conversion_rate','currency']},
+		'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','export_amount','export_rate']},
+		'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','export_amount','export_rate']},
+		'Item': {'ref_rate_details':['ref_currency']},
+		'Sales BOM': {'fields':['currency']},
+		'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}
+	},
+	'fs_imports': {
+		'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']},
+		'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['import_amount','import_rate']},
+		'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']},
+		'Supplier Quotation': {'fields':['conversion_rate','currency']}
+	},
+	'fs_item_advanced': {
+		'Item': {'fields':['item_customer_details']}
+	},
+	'fs_sales_extras': {
+		'Address': {'fields':['sales_partner']},
+		'Contact': {'fields':['sales_partner']},
+		'Customer': {'fields':['sales_team']},
+		'Delivery Note': {'fields':['sales_team','Packing List']},
+		'Item': {'fields':['item_customer_details']},
+		'Receivable Voucher': {'fields':['sales_team']},
+		'Sales Order': {'fields':['sales_team','Packing List']}
+	},
+	'fs_more_info': {
+		'Customer': {'fields':['More Info']},
+		'Delivery Note': {'fields':['More Info']},
+		'Enquiry': {'fields':['More Info']},
+		'Indent': {'fields':['More Info']},
+		'Lead': {'fields':['More Info']},
+		'Payable Voucher': {'fields':['More Info']},
+		'Purchase Order': {'fields':['More Info']},
+		'Purchase Receipt': {'fields':['More Info']},
+		'Quotation': {'fields':['More Info']},
+		'Receivable Voucher': {'fields':['More Info']},
+		'Sales Order': {'fields':['More Info']},
+		'Serial No': {'fields':['More Info']},
+		'Supplier': {'fields':['More Info']}
+	},
+	'fs_quality': {
+		'Item': {'fields':['Item Inspection Criteria','inspection_required']},
+		'Purchase Receipt': {'purchase_receipt_details':['qa_no']}
+	},
+	'fs_manufacturing': {
+		'Item': {'fields':['Manufacturing']}
+	},
+	'fs_pos': {
+		'Receivable Voucher': {'fields':['is_pos']}
+	},
+	'fs_recurring_invoice': {
+		'Receivable Voucher': {'fields': ['Recurring Invoice']}
+	}
+}
+
+$(document).bind('form_refresh', function() {
+	for(sys_feat in sys_defaults)
+	{
+		if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists
+		{
+			if(cur_frm.doc.doctype in  pscript.feature_dict[sys_feat])
+			{
+				for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype])
+				{
+					if(fort=='fields')
+						hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
+					else if(cur_frm.fields_dict[fort])
+					{
+						for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
+							cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
+					}
+					else
+						msgprint('Grid "'+fort+'" does not exists');
+				}
+			}
+		}
+	}
+})
diff --git a/erpnext/startup/modules.js b/erpnext/startup/modules.js
new file mode 100644
index 0000000..c22aee0
--- /dev/null
+++ b/erpnext/startup/modules.js
@@ -0,0 +1,384 @@
+// ====================================================================
+
+pscript.startup_make_sidebar = function() {
+	$y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'});
+
+	var callback = function(r,rt) {
+		// menu
+		var ml = r.message;
+
+		// clear
+		page_body.left_sidebar.innerHTML = '';
+
+		for(var m=0; m<ml.length; m++){
+			if(ml[m]) {
+				new SidebarItem(ml[m]);
+			}
+		}
+		if(in_list(user_roles, 'System Manager')) {
+			var div = $a(page_body.left_sidebar, 'div', 'link_type', {padding:'8px', fontSize:'11px'});
+			$(div).html('[edit]').click(pscript.startup_set_module_order)
+		}
+		nav_obj.observers.push({notify:function(t,dt,dn) { pscript.select_sidebar_menu(t, dt, dn); }});
+
+		// select current
+		var no = nav_obj.ol[nav_obj.ol.length-1];
+		if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
+			pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
+	}
+	$c_obj('Home Control', 'get_modules', '', callback);
+}
+
+// ====================================================================
+// Menu observer
+// ====================================================================
+
+cur_menu_pointer = null;
+var menu_item_map = {'Form':{}, 'Page':{}, 'Report':{}, 'List':{}}
+
+pscript.select_sidebar_menu = function(t, dt, dn) {
+	// get menu item
+	if(menu_item_map[t][dt]) {
+		// select
+		menu_item_map[t][dt].select();
+	} else {
+		// none found :-( Unselect
+		if(cur_menu_pointer)
+			cur_menu_pointer.deselect();
+	}
+}
+
+// ====================================================================
+// Menu pointer
+// ====================================================================
+
+var body_background = '#e2e2e2';
+
+MenuPointer = function(parent, label) {
+	var me = this;
+	this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'});
+	$br(this.wrapper, '3px');
+
+	this.tab = make_table($a(this.wrapper, 'div'), 1, 2, '100%', ['', '11px'], {height:'22px',
+		verticalAlign:'middle', padding:'0px'}, {borderCollapse:'collapse', tableLayout:'fixed'});
+
+	$y($td(this.tab, 0, 0), {padding:'0px 4px', color:'#444', whiteSpace:'nowrap'});
+
+	// triangle border (?)
+	this.tab.triangle_div = $a($td(this.tab, 0, 1), 'div','', {
+		borderColor: body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent',
+		borderWidth:'11px', borderStyle:'solid', height:'0px', width:'0px', marginRight:'-11px'});
+
+	this.label_area = $a($td(this.tab, 0, 0), 'span', '', '', label);
+
+	$(this.wrapper)
+		.hover(
+			function() { if(!me.selected)
+				$bg(this, '#eee'); } ,
+			function() { if(!me.selected)
+				$bg(this, body_background); }
+		)
+
+	$y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
+
+}
+
+// ====================================================================
+
+MenuPointer.prototype.select = function(grey) {
+	$y($td(this.tab, 0, 0), {
+		color:'#fff', borderBottom:'0px solid #000'
+	});
+	$(this.wrapper).css('background-color', '#999');
+	this.selected = 1;
+
+	if(cur_menu_pointer && cur_menu_pointer != this)
+		cur_menu_pointer.deselect();
+
+	cur_menu_pointer = this;
+}
+
+// ====================================================================
+
+MenuPointer.prototype.deselect = function() {
+	$y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'});
+	$(this.wrapper).css('background-color', body_background);
+	this.selected = 0;
+}
+
+
+// ====================================================================
+// Sidebar Item
+// ====================================================================
+
+var cur_sidebar_item = null;
+
+SidebarItem = function(det) {
+	var me = this;
+	this.det = det;
+	this.wrapper = $a(page_body.left_sidebar, 'div', '', {marginRight:'12px'});
+
+	this.body = $a(this.wrapper, 'div');
+	this.tab = make_table(this.body, 1, 2, '100%', ['24px', null], {verticalAlign:'middle'}, {tableLayout:'fixed'});
+
+	// icon
+	var ic = $a($td(this.tab, 0, 0), 'div', 'module-icons module-icons-' + det.module_label.toLowerCase(), {marginLeft:'3px', marginBottom:'-2px'});
+
+	// pointer table
+	this.pointer = new MenuPointer($td(this.tab, 0, 1), det.module_label);
+	$y($td(this.pointer.tab, 0, 0), {fontWeight:'bold'});
+
+	// for page type
+	if(det.module_page) {
+		menu_item_map.Page[det.module_page] = this.pointer;
+	}
+
+	// items area
+	this.items_area = $a(this.wrapper, 'div');
+
+	this.body.onclick = function() { me.onclick(); }
+}
+
+// ====================================================================
+
+SidebarItem.prototype.onclick = function() {
+	var me = this;
+
+	if(this.det.module_page) {
+		// page type
+		this.pointer.select();
+
+		$(me.pointer.label_area).set_working();
+		loadpage(this.det.module_page, function() { 
+			$(me.pointer.label_area).done_working(); 
+		});
+
+	} else {
+		// show sub items
+		this.toggle();
+	}
+}
+
+// ====================================================================
+
+SidebarItem.prototype.collapse = function() {
+	$(this.items_area).slideUp();
+	this.is_open = 0;
+	$fg(this.pointer.label_area, '#444')
+}
+
+// ====================================================================
+
+SidebarItem.prototype.toggle = function() {
+	if(this.loading) return;
+
+	if(this.is_open) {
+		this.collapse();
+	} else {
+		if(this.loaded) $(this.items_area).slideDown();
+		else this.show_items();
+		this.is_open = 1;
+		$fg(this.pointer.label_area, '#000')
+		//this.pointer.select(1);
+
+		// close existing open
+		if(cur_sidebar_item && cur_sidebar_item != this) {
+			cur_sidebar_item.collapse();
+		}
+		cur_sidebar_item = this;
+	}
+}
+
+// ====================================================================
+
+SidebarItem.prototype.show_items = function() {
+	this.loading = 1;
+	var me = this;
+
+	$(this.pointer.label_area).set_working();
+	var callback = function(r,rt){
+		me.loaded = 1;
+		me.loading = 0;
+		var smi = null;
+		var has_reports = 0;
+		var has_tools = 0;
+
+		// widget code
+		$(me.pointer.label_area).done_working();
+
+		if(r.message.il) {
+			me.il = r.message.il;
+
+			// forms
+			for(var i=0; i<me.il.length;i++){
+				if(me.il[i].doc_type == 'Forms') {
+					if(in_list(profile.can_read, me.il[i].doc_name)) {
+						var smi = new SidebarModuleItem(me, me.il[i]);
+
+						menu_item_map['Form'][me.il[i].doc_name] = smi.pointer;
+						menu_item_map['List'][me.il[i].doc_name] = smi.pointer;
+					}
+				}
+				if(me.il[i].doc_type=='Reports') has_reports = 1;
+				if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type)) 
+					has_tools = 1;
+			}
+			// reports
+			if(has_reports) {
+				var smi = new SidebarModuleItem(me, {doc_name:'Reports', doc_type:'Reports'});
+
+				// add to menu-item mapper
+				menu_item_map['Page'][me.det.module_label + ' Reports'] = smi.pointer;
+			}
+
+			// tools
+			if(has_tools) {
+				var smi = new SidebarModuleItem(me, {doc_name:'Tools', doc_type:'Tools'});
+
+				// add to menu-item mapper
+				menu_item_map['Page'][me.det.module_label + ' Tools'] = smi.pointer;
+			}
+
+			// custom reports
+			if(r.message.custom_reports.length) {
+				me.il = add_lists(r.message.il, r.message.custom_reports);
+				var smi = new SidebarModuleItem(me, {doc_name:'Custom Reports', doc_type:'Custom Reports'});
+
+				// add to menu-item mapper
+				menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer;
+			}
+		}
+		
+		
+		$(me.items_area).slideDown();
+
+		// high light
+		var no = nav_obj.ol[nav_obj.ol.length-1];
+		if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
+			pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
+
+	}
+
+	$c_obj('Home Control', 'get_module_details', me.det.name, callback);
+}
+
+// ====================================================================
+// Show Reports
+// ====================================================================
+
+SidebarItem.prototype.show_section = function(sec_type) {
+	var me = this;
+	var label = this.det.module_label + ' ' + sec_type;
+	var type_map = {'Reports':'Reports', 'Custom Reports':'Custom Reports', 
+		'Pages':'Tools', 'Single DocType':'Tools', 'Setup Forms':'Tools'}
+
+
+	if(page_body.pages[label]) {
+		loadpage(label, null, 1);
+	} else {
+		
+		// make the reports page
+		var page = page_body.add_page(label);
+		this.wrapper = $a(page,'div','layout_wrapper');
+
+
+		// head
+		this.head = new PageHeader(this.wrapper, label);
+
+		// body
+		this.body1 = $a(this.wrapper, 'div', '', {marginTop:'16px'});
+
+		// add a report link
+		var add_link = function(det) {
+			var div = $a(me.body1, 'div', '', {marginBottom:'6px'});
+			var span = $a(div, 'span', 'link_type');
+
+			// tag the span
+			span.innerHTML = det.display_name; span.det = det;
+			if(sec_type=='Reports' || sec_type=='Custom Reports') {
+				// Reports
+				// -------
+				span.onclick = function() { loadreport(this.det.doc_name, this.det.display_name); }
+
+			} else {
+				// Tools
+				// -----
+
+				if(det.doc_type=='Pages') {
+					// Page
+					if(det.click_function) {
+						span.onclick = function() { eval(this.det.click_function) }
+						span.click_function = det.click_function;
+					} else {
+						span.onclick = function() { loadpage(this.det.doc_name); }
+					}
+				} else if(det.doc_type=='Setup Forms') {
+					// Doc Browser
+					span.onclick = function() { loaddocbrowser(this.det.doc_name); }
+				} else {
+					// Single
+					span.onclick = function() { loaddoc(this.det.doc_name, this.det.doc_name); }
+				}
+			}
+		}
+
+		// item list
+		for(var i=0; i<me.il.length;i++){
+			if(type_map[me.il[i].doc_type] == sec_type) {
+				add_link(me.il[i]);
+			}
+		}
+		loadpage(label, null, 1);
+	}
+}
+
+
+// ====================================================================
+// Sidebar module item
+// ====================================================================
+
+SidebarModuleItem = function(si, det) {
+	this.det = det;
+	var me= this;
+
+	this.pointer = new MenuPointer(si.items_area, get_doctype_label(det.doc_name));
+	$y(si.items_area, {marginLeft:'32px'})
+	$y($td(this.pointer.tab, 0, 0), {fontSize:'11px'});
+
+	this.pointer.wrapper.onclick = function() {
+		if(me.det.doc_type=='Forms')
+			loaddocbrowser(det.doc_name);
+		else
+			si.show_section(me.det.doc_type);
+	}
+}
+
+
+// ====================================================================
+// Drag & Drop order selection
+// ====================================================================
+
+pscript.startup_set_module_order = function() {
+	var update_order= function(ml) {
+		mdict = {};
+		for(var i=0; i<ml.length; i++) {
+			mdict[ml[i][3][3]] = {'module_seq':ml[i][1], 'is_hidden':(ml[i][2] ? 'No' : 'Yes')}
+		}
+		$c_obj('Home Control', 'set_module_order', JSON.stringify(mdict), function(r,rt) { pscript.startup_make_sidebar(); } )
+	}
+
+	var callback = function(r, rt) {
+		var ml = [];
+		for(var i=0; i<r.message.length; i++) {
+			var det = r.message[i];
+			ml.push([det[1], det[2], (det[3]!='No' ? 0 : 1), det[0]]);
+		}
+		new ListSelector('Set Module Sequence', 'Select items and set the order you want them to appear'+
+			'<br><b>Note:</b> <i>These changes will apply to all users!</i>', ml, update_order, 1);
+	}
+	$c_obj('Home Control', 'get_module_order', '', callback)
+
+}
+
+
+
diff --git a/erpnext/startup/modules_new.js b/erpnext/startup/modules_new.js
new file mode 100644
index 0000000..5f912b0
--- /dev/null
+++ b/erpnext/startup/modules_new.js
@@ -0,0 +1,36 @@
+// Tools Page
+erpnext.ListPage = Class.extend({
+	init: function(opts) {
+		var me = this;
+		this.opts = opts;
+		this.page = page_body.add_page[opts.title];
+		this.page.wrapper = $a(this.page, 'div', 'layout_wrapper');
+		this.page.head = new PageHeading(this.wrapper, this.title)
+		this.page.list = new wn.widgets.Listing({
+			parent: this.page.wrapper,
+			query: opts.query,
+			render:row: opts.render_row
+		});
+	},
+	show: function() {
+		if(this.first) {
+			this.page.list.run();
+			this.first = false;
+		}
+		page_body.change_to(this.opts.title);
+	}
+});
+
+erpnext.ToolsPage = erpnext.ListPage.extend({
+	init: function(opts) {
+		this._super({
+			title: opts.module + ' Settings',
+			query: repl('select name, description from tabDocType where \
+				module=%(module)s and ifnull(issingle,0)=1 order by name asc', opts),
+			render_row: function(parent, data) {
+				parent.innerHTML = repl('<a href="#!Form/%(name)s/%(name)s">%(name)s</a>\
+					<div class="comment">%(description)s</div>', data)
+			}
+		})
+	}
+});
\ No newline at end of file
diff --git a/erpnext/startup/startup.css b/erpnext/startup/startup.css
index 7b2b6e5..4f66519 100644
--- a/erpnext/startup/startup.css
+++ b/erpnext/startup/startup.css
@@ -1,33 +1,29 @@
-h1, h2, h3, h4 {
-	font-family: Tahoma, Sans Serif;
+h1, h2, h3, h4, h5 {
+	font-family: Tahoma, Arial, Verdana, sans-serif;
 	font-weight: bold;
 }
 
-body, span, div, td, input, textarea, button, select {
+body {
 	font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
 	font-size: 12px;
 }
 
+span, div, td, input, textarea, button, select {
+	font-family: inherit;
+}
+
 body {
 	background-color: #e2e2e2;
 }
 
-.layout_wrapper {
-	padding: 13px;
-	margin: 7px;
-	-moz-box-shadow: 1px 1px 6px #AAA;
-	-webkit-box-shadow: 1px 1px 6px #AAA;
-	box-shadow: 1px 1px 6px #AAA;
-	background-color: #FFF;
+.erpnext-footer {
+	margin: 3px auto;
+	color: #888;
+	text-align: center;
 }
 
-#birthday_area {
-	display: none;
-	padding: 4px;
-	margin-bottom: 8px;
-	background-color: #FDD;
-	padding: 4px;
-	color: #644;
+.erpnext-footer a, .erpnext-footer a:hover, .erpnext-footer a:visited {
+	color: #666;
 }
 
 .module-icons {
diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js
index 5a66ec6..cbb03a1 100644
--- a/erpnext/startup/startup.js
+++ b/erpnext/startup/startup.js
@@ -1,461 +1,47 @@
-if(user == 'Guest'){
-  $dh(page_body.left_sidebar);
-}
-
 var current_module;
 var is_system_manager = 0;
 var module_content_dict = {};
 var user_full_nm = {};
 
-// check if session user is system manager
-if(inList(user_roles,'System Manager')) is_system_manager = 1;
+wn.provide('erpnext.startup');
 
-function startup_setup() {
-	pscript.is_erpnext_saas = cint(locals['Control Panel']['Control Panel'].sync_with_gateway)
-
-
-	if(get_url_arg('embed')) {
-		// hide header, footer
-		$dh(page_body.banner_area);
-		$dh(page_body.wntoolbar);
-		$dh(page_body.footer);
-		return;
-	}
-
-	if(user=='Guest' && !get_url_arg('akey')) {
-		if(pscript.is_erpnext_saas) {
-			window.location.href = 'https://www.erpnext.com';
-			return;
-		}
-	}
-
-	// page structure
-	// --------------
-	$td(page_body.wntoolbar.body_tab,0,0).innerHTML = '<i><b>erp</b>next</i>';
-	$y($td(page_body.wntoolbar.body_tab,0,0), {width:'140px', color:'#FFF', paddingLeft:'8px', paddingRight:'8px', fontSize:'14px'})
-	$dh(page_body.banner_area);
-
-	// sidebar
-	// -------
-	pscript.startup_make_sidebar();
-
-	// border to the body
-	// ------------------
-	$dh(page_body.footer);
-
-	// setup toolbar
-	pscript.startup_setup_toolbar();
+erpnext.startup.set_globals = function() {
+	pscript.is_erpnext_saas = cint(wn.control_panel.sync_with_gateway)
+	if(inList(user_roles,'System Manager')) is_system_manager = 1;
 }
 
-// ====================================================================
-
-pscript.startup_make_sidebar = function() {
-	$y(page_body.left_sidebar, {width:(100/6)+'%', paddingTop:'8px'});
-
-	var callback = function(r,rt) {
-		// menu
-		var ml = r.message;
-
-		// login-file
-		if(r.login_url){
-			login_file = 'http://' + r.login_url;
-		}
-		else if(pscript.is_erpnext_saas) {
-			login_file = 'https://www.erpnext.com';
-		}
-
-		// clear
-		page_body.left_sidebar.innerHTML = '';
-
-		for(var m=0; m<ml.length; m++){
-			if(ml[m]) {
-				new SidebarItem(ml[m]);
-			}
-		}
-		if(in_list(user_roles, 'System Manager')) {
-			var div = $a(page_body.left_sidebar, 'div', 'link_type', {padding:'8px', fontSize:'11px'});
-			$(div).html('[edit]').click(pscript.startup_set_module_order)
-		}
-		nav_obj.observers.push({notify:function(t,dt,dn) { pscript.select_sidebar_menu(t, dt, dn); }});
-
-		// select current
-		var no = nav_obj.ol[nav_obj.ol.length-1];
-		if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
-			pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
-	}
-	$c_obj('Home Control', 'get_modules', '', callback);
-}
-
-// ====================================================================
-// Menu observer
-// ====================================================================
-
-cur_menu_pointer = null;
-var menu_item_map = {'Form':{}, 'Page':{}, 'Report':{}, 'List':{}}
-
-pscript.select_sidebar_menu = function(t, dt, dn) {
-	// get menu item
-	if(menu_item_map[t][dt]) {
-		// select
-		menu_item_map[t][dt].select();
-	} else {
-		// none found :-( Unselect
-		if(cur_menu_pointer)
-			cur_menu_pointer.deselect();
-	}
-}
-
-// ====================================================================
-// Menu pointer
-// ====================================================================
-
-var body_background = '#e2e2e2';
-
-MenuPointer = function(parent, label) {
-
-	this.wrapper = $a(parent, 'div', '', {padding:'0px', cursor:'pointer', margin:'2px 0px'});
-	$br(this.wrapper, '3px');
-
-	this.tab = make_table($a(this.wrapper, 'div'), 1, 2, '100%', ['', '11px'], {height:'22px',
-		verticalAlign:'middle', padding:'0px'}, {borderCollapse:'collapse', tableLayout:'fixed'});
-
-	$y($td(this.tab, 0, 0), {padding:'0px 4px', color:'#444', whiteSpace:'nowrap'});
-
-	// triangle border (?)
-	this.tab.triangle_div = $a($td(this.tab, 0, 1), 'div','', {
-		borderColor: body_background + ' ' + body_background + ' ' + body_background + ' ' + 'transparent',
-		borderWidth:'11px', borderStyle:'solid', height:'0px', width:'0px', marginRight:'-11px'});
-
-	this.label_area = $a($td(this.tab, 0, 0), 'span', '', '', label);
-
-	$(this.wrapper)
-		.hover(
-			function() { if(!this.selected)$bg(this, '#eee'); } ,
-			function() { if(!this.selected)$bg(this, body_background); }
-		)
-
-	$y($td(this.tab, 0, 0), {borderBottom:'1px solid #ddd'});
-
-}
-
-// ====================================================================
-
-MenuPointer.prototype.select = function(grey) {
-	$y($td(this.tab, 0, 0), {color:'#fff', borderBottom:'0px solid #000'});
-	//$gr(this.wrapper, '#F84', '#F63');
-	$gr(this.wrapper, '#888', '#666');
-	this.selected = 1;
-
-	if(cur_menu_pointer && cur_menu_pointer != this)
-		cur_menu_pointer.deselect();
-
-	cur_menu_pointer = this;
-}
-
-// ====================================================================
-
-MenuPointer.prototype.deselect = function() {
-	$y($td(this.tab, 0, 0), {color:'#444', borderBottom:'1px solid #ddd'});
-	$gr(this.wrapper, body_background, body_background);
-	this.selected = 0;
-}
-
-
-// ====================================================================
-// Sidebar Item
-// ====================================================================
-
-var cur_sidebar_item = null;
-
-SidebarItem = function(det) {
-	var me = this;
-	this.det = det;
-	this.wrapper = $a(page_body.left_sidebar, 'div', '', {marginRight:'12px'});
-
-	this.body = $a(this.wrapper, 'div');
-	this.tab = make_table(this.body, 1, 2, '100%', ['24px', null], {verticalAlign:'middle'}, {tableLayout:'fixed'});
-
-	// icon
-	var ic = $a($td(this.tab, 0, 0), 'div', 'module-icons module-icons-' + det.module_label.toLowerCase(), {marginLeft:'3px', marginBottom:'-2px'});
-
-	// pointer table
-	this.pointer = new MenuPointer($td(this.tab, 0, 1), det.module_label);
-	$y($td(this.pointer.tab, 0, 0), {fontWeight:'bold'});
-
-	// for page type
-	if(det.module_page) {
-		menu_item_map.Page[det.module_page] = this.pointer;
-	}
-
-	// items area
-	this.items_area = $a(this.wrapper, 'div');
-
-	this.body.onclick = function() { me.onclick(); }
-}
-
-// ====================================================================
-
-SidebarItem.prototype.onclick = function() {
-	var me = this;
-
-	if(this.det.module_page) {
-		// page type
-		this.pointer.select();
-
-		$item_set_working(me.pointer.label_area);
-		loadpage(this.det.module_page, function() { $item_done_working(me.pointer.label_area); });
-
-	} else {
-		// show sub items
-		this.toggle();
-	}
-}
-
-// ====================================================================
-
-SidebarItem.prototype.collapse = function() {
-	$(this.items_area).slideUp();
-	this.is_open = 0;
-	$fg(this.pointer.label_area, '#444')
-}
-
-// ====================================================================
-
-SidebarItem.prototype.toggle = function() {
-	if(this.loading) return;
-
-	if(this.is_open) {
-		this.collapse();
-	} else {
-		if(this.loaded) $(this.items_area).slideDown();
-		else this.show_items();
-		this.is_open = 1;
-		$fg(this.pointer.label_area, '#000')
-		//this.pointer.select(1);
-
-		// close existing open
-		if(cur_sidebar_item && cur_sidebar_item != this) {
-			cur_sidebar_item.collapse();
-		}
-		cur_sidebar_item = this;
-	}
-}
-
-// ====================================================================
-
-SidebarItem.prototype.show_items = function() {
-	this.loading = 1;
-	var me = this;
-
-	$item_set_working(this.pointer.label_area);
-	var callback = function(r,rt){
-		me.loaded = 1;
-		me.loading = 0;
-		var smi = null;
-		var has_reports = 0;
-		var has_tools = 0;
-
-		// widget code
-		$item_done_working(me.pointer.label_area);
-
-		if(r.message.il) {
-			me.il = r.message.il;
-
-			// forms
-			for(var i=0; i<me.il.length;i++){
-				if(me.il[i].doc_type == 'Forms') {
-					if(in_list(profile.can_read, me.il[i].doc_name)) {
-						var smi = new SidebarModuleItem(me, me.il[i]);
-
-						menu_item_map['Form'][me.il[i].doc_name] = smi.pointer;
-						menu_item_map['List'][me.il[i].doc_name] = smi.pointer;
-					}
-				}
-				if(me.il[i].doc_type=='Reports') has_reports = 1;
-				if(in_list(['Single DocType', 'Pages', 'Setup Forms'], me.il[i].doc_type)) has_tools = 1;
-			}
-			// reports
-			if(has_reports) {
-				var smi = new SidebarModuleItem(me, {doc_name:'Reports', doc_type:'Reports'});
-
-				// add to menu-item mapper
-				menu_item_map['Page'][me.det.module_label + ' Reports'] = smi.pointer;
-			}
-
-			// tools
-			if(has_tools) {
-				var smi = new SidebarModuleItem(me, {doc_name:'Tools', doc_type:'Tools'});
-
-				// add to menu-item mapper
-				menu_item_map['Page'][me.det.module_label + ' Tools'] = smi.pointer;
-			}
-
-			// custom reports
-			if(r.message.custom_reports.length) {
-				me.il = add_lists(r.message.il, r.message.custom_reports);
-				var smi = new SidebarModuleItem(me, {doc_name:'Custom Reports', doc_type:'Custom Reports'});
-
-				// add to menu-item mapper
-				menu_item_map['Page'][me.det.module_label + ' Custom Reports'] = smi.pointer;
-			}
-		}
-		
-		
-		$(me.items_area).slideDown();
-
-		// high light
-		var no = nav_obj.ol[nav_obj.ol.length-1];
-		if(no && menu_item_map[decodeURIComponent(no[0])][decodeURIComponent(no[1])])
-			pscript.select_sidebar_menu(decodeURIComponent(no[0]), decodeURIComponent(no[1]));
-
-	}
-
-	$c_obj('Home Control', 'get_module_details', me.det.name, callback);
-}
-
-// ====================================================================
-// Show Reports
-// ====================================================================
-
-SidebarItem.prototype.show_section = function(sec_type) {
-	var me = this;
-	var label = this.det.module_label + ' ' + sec_type;
-	var type_map = {'Reports':'Reports', 'Custom Reports':'Custom Reports', 'Pages':'Tools', 'Single DocType':'Tools', 'Setup Forms':'Tools'}
-
-	if(page_body.pages[label]) {
-		loadpage(label, null, 1);
-	} else {
-		// make the reports page
-		var page = page_body.add_page(label);
-		this.wrapper = $a(page,'div','layout_wrapper');
-
-
-		// head
-		this.head = new PageHeader(this.wrapper, label);
-
-		// body
-		this.body1 = $a(this.wrapper, 'div', '', {marginTop:'16px'});
-
-		// add a report link
-		var add_link = function(det) {
-			var div = $a(me.body1, 'div', '', {marginBottom:'6px'});
-			var span = $a(div, 'span', 'link_type');
-
-			// tag the span
-			span.innerHTML = det.display_name; span.det = det;
-			if(sec_type=='Reports' || sec_type=='Custom Reports') {
-				// Reports
-				// -------
-				span.onclick = function() { loadreport(this.det.doc_name, this.det.display_name); }
-
-			} else {
-				// Tools
-				// -----
-
-				if(det.doc_type=='Pages') {
-					// Page
-					if(det.click_function) {
-						span.onclick = function() { eval(this.det.click_function) }
-						span.click_function = det.click_function;
-					} else {
-						span.onclick = function() { loadpage(this.det.doc_name); }
-					}
-				} else if(det.doc_type=='Setup Forms') {
-					// Doc Browser
-					span.onclick = function() { loaddocbrowser(this.det.doc_name); }
-				} else {
-					// Single
-					span.onclick = function() { loaddoc(this.det.doc_name, this.det.doc_name); }
-				}
-			}
-		}
-
-		// item list
-		for(var i=0; i<me.il.length;i++){
-			if(type_map[me.il[i].doc_type] == sec_type) {
-				add_link(me.il[i]);
-			}
-		}
-		loadpage(label, null, 1);
-	}
-}
-
-
-// ====================================================================
-// Sidebar module item
-// ====================================================================
-
-SidebarModuleItem = function(si, det) {
-	this.det = det;
-	var me= this;
-
-	this.pointer = new MenuPointer(si.items_area, get_doctype_label(det.doc_name));
-	$y(si.items_area, {marginLeft:'32px'})
-	$y($td(this.pointer.tab, 0, 0), {fontSize:'11px'});
-
-	this.pointer.wrapper.onclick = function() {
-		if(me.det.doc_type=='Forms')
-			loaddocbrowser(det.doc_name);
-		else
-			si.show_section(me.det.doc_type);
-	}
-}
-
-
-// ====================================================================
-// Drag & Drop order selection
-// ====================================================================
-
-pscript.startup_set_module_order = function() {
-	var update_order= function(ml) {
-		mdict = {};
-		for(var i=0; i<ml.length; i++) {
-			mdict[ml[i][3][3]] = {'module_seq':ml[i][1], 'is_hidden':(ml[i][2] ? 'No' : 'Yes')}
-		}
-		$c_obj('Home Control', 'set_module_order', JSON.stringify(mdict), function(r,rt) { pscript.startup_make_sidebar(); } )
-	}
-
-	var callback = function(r, rt) {
-		var ml = [];
-		for(var i=0; i<r.message.length; i++) {
-			var det = r.message[i];
-			ml.push([det[1], det[2], (det[3]!='No' ? 0 : 1), det[0]]);
-		}
-		new ListSelector('Set Module Sequence', 'Select items and set the order you want them to appear'+
-			'<br><b>Note:</b> <i>These changes will apply to all users!</i>', ml, update_order, 1);
-	}
-	$c_obj('Home Control', 'get_module_order', '', callback)
-
-}
-
-// ====================================================================
-
-pscript.startup_setup_toolbar = function() {
-  var menu_tab = page_body.wntoolbar.menu_table_right;
-	// help
-	// ----
-	$td(menu_tab,0,0).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">Help</a>';
+erpnext.startup.start = function() {
+	$('#startup_div').html('Starting up...').toggle(true);
 	
-	$td(menu_tab,0,1).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://groups.google.com/group/erpnext-user-forum" target="_blank">Forum</a>';
+	erpnext.startup.set_globals();
 	
-	if(pscript.is_erpnext_saas){
-		// Live Chat Help
-		// --------------
-		$td(menu_tab,0,2).innerHTML = '<a style="font-weight: bold; color: #FFF" href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">Chat</a>';
-		
-		// Manage account
-		// --------------
-		if(is_system_manager) {
-			$td(menu_tab,0,3).innerHTML = '<a style="font-weight: bold; color: #FFF;" href="#!billing">Billing</a>';
+	if(user == 'Guest'){
+		$dh(page_body.left_sidebar);
+		wn.require('erpnext/website/css/website.css');
+		wn.require('erpnext/website/js/topbar.js');
+		if(wn.boot.custom_css) {
+			set_style(wn.boot.custom_css);
 		}
-	}
-	else{
-		$dh($td(menu_tab,0,2));
-		$dh($td(menu_tab,0,3));
-	}
+		if(wn.boot.website_settings.title_prefix) {
+			wn.title_prefix = wn.boot.website_settings.title_prefix;
+		}
+	} else {
+		// modules
+		wn.require('erpnext/startup/modules.js');
+		pscript.startup_make_sidebar();
 
-	$y(cell, page_body.wntoolbar.right_table_style);
+		// setup toolbar
+		wn.require('erpnext/startup/toolbar.js');
+		erpnext.toolbar.setup();
+		wn.require('erpnext/startup/feature_setup.js');
 
+		// border to the body
+		// ------------------
+		$('footer').html('<div class="erpnext-footer">\
+			Powered by <a href="https://erpnext.com">ERPNext</a></div>');
+	}
+	
+	$('#startup_div').toggle(false);
 }
 
 // chart of accounts
@@ -496,224 +82,5 @@
 	if(callback) this.callback = function(){ callback(); }
 }
 
-
-// get plural
-// ====================================================================
-
-get_plural = function(str){
-	if(str.charAt(str.length-1).toLowerCase() == 'y')	return str.substr(0, str.length-1) + 'ies'
-	else return str + 's';
-}
-
-// set user fullname
-// ====================================================================
-pscript.set_user_fullname = function(ele,username,get_latest){
-
-	var set_it = function(){
-		if(ele)
-			ele.innerHTML = user_full_nm[username];
-	}
-
-	if(get_latest){
-		$c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); });
-	}
-	else{
-		if(user_full_nm[username]){
-			set_it();
-		}
-
-		else
-			$c_obj('Home Control','get_user_fullname',username, function(r,rt){ user_full_nm[username] = r.message; set_it(); });
-	}
-}
-
-// ====================================================================
-startup_setup();
-
-/* features setup "Dictionary", "Script"
-Dictionary Format
-	'projects': {
-		'Sales Order': {
-			'fields':['project_name'],
-			'sales_order_details':['projected_qty']
-		},
-		'Purchase Order': {
-			'fields':['project_name']
-		}
-	}
-// ====================================================================*/
-pscript.feature_dict = {
-	'fs_projects': {
-		'Bill Of Materials': {'fields':['project_name']},
-		'Delivery Note': {'fields':['project_name']},
-		'Payable Voucher': {'fields':['project_name']},
-		'Production Order': {'fields':['project_name']},
-		'Purchase Order': {'fields':['project_name']},
-		'Purchase Receipt': {'fields':['project_name']},
-		'Receivable Voucher': {'fields':['project_name']},
-		'Sales Order': {'fields':['project_name']},
-		'Stock Entry': {'fields':['project_name']},
-		'Timesheet': {'timesheet_details':['project_name']}
-	},
-	'fs_packing_details': {
-		'Delivery Note': {'fields':['packing_details','print_packing_slip','packing_checked_by','packed_by','pack_size','shipping_mark'],'delivery_note_details':['no_of_packs','pack_gross_wt','pack_nett_wt','pack_no','pack_unit']},
-		'Sales Order': {'fields':['packing_details']}
-	},
-	'fs_discounts': {
-		'Delivery Note': {'delivery_note_details':['adj_rate']},
-		'Quotation': {'quotation_details':['adj_rate']},
-		'Receivable Voucher': {'entries':['adj_rate']},
-		'Sales Order': {'sales_order_details':['adj_rate','ref_rate']}
-	},
-	'fs_purchase_discounts': {
-		'Purchase Order': {'po_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
-		'Purchase Receipt': {'purchase_receipt_details':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']},
-		'Payable Voucher': {'entries':['purchase_ref_rate', 'discount_rate', 'import_ref_rate']}
-	},
-	'fs_brands': {
-		'Delivery Note': {'delivery_note_details':['brand']},
-		'Indent': {'indent_details':['brand']},
-		'Item': {'fields':['brand']},
-		'Purchase Order': {'po_details':['brand']},
-		'Payable Voucher': {'entries':['brand']},
-		'Quotation': {'quotation_details':['brand']},
-		'Receivable Voucher': {'entries':['brand']},
-		'Sales BOM': {'fields':['new_item_brand']},
-		'Sales Order': {'sales_order_details':['brand']},
-		'Serial No': {'fields':['brand']}
-	},
-	'fs_after_sales_installations': {
-		'Delivery Note': {'fields':['installation_status','per_installed'],'delivery_note_details':['installed_qty']}
-	},
-	'fs_item_batch_nos': {
-		'Delivery Note': {'delivery_note_details':['batch_no']},
-		'Item': {'fields':['has_batch_no']},
-		'Purchase Receipt': {'purchase_receipt_details':['batch_no']},
-		'QA Inspection Report': {'fields':['batch_no']},
-		'Sales and Pruchase Return Wizard': {'return_details':['batch_no']},
-		'Receivable Voucher': {'entries':['batch_no']},
-		'Stock Entry': {'mtn_details':['batch_no']},
-		'Stock Ledger Entry': {'fields':['batch_no']}
-	},
-	'fs_item_serial_nos': {
-		'Customer Issue': {'fields':['serial_no']},
-		'Delivery Note': {'delivery_note_details':['serial_no'],'packing_details':['serial_no']},
-		'Installation Note': {'installed_item_details':['serial_no']},
-		'Item': {'fields':['has_serial_no']},
-		'Maintenance Schedule': {'item_maintenance_details':['serial_no'],'maintenance_schedule_details':['serial_no']},
-		'Maintenance Visit': {'maintenance_visit_details':['serial_no']},
-		'Purchase Receipt': {'purchase_receipt_details':['serial_no']},
-		'QA Inspection Report': {'fields':['item_serial_no']},
-		'Sales and Pruchase Return Wizard': {'return_details':['serial_no']},
-		'Receivable Voucher': {'entries':['serial_no']},
-		'Stock Entry': {'mtn_details':['serial_no']},
-		'Stock Ledger Entry': {'fields':['serial_no']}
-	},
-	'fs_item_group_in_details': {
-		'Delivery Note': {'delivery_note_details':['item_group']},
-		'Enquiry': {'enquiry_details':['item_group']},
-		'Indent': {'indent_details':['item_group']},
-		'Item': {'fields':['item_group']},
-		'Manage Account': {'fields':['default_item_group']},
-		'Purchase Order': {'po_details':['item_group']},
-		'Purchase Receipt': {'purchase_receipt_details':['item_group']},
-		'Purchase Voucher': {'entries':['item_group']},
-		'Quotation': {'quotation_details':['item_group']},
-		'Receivable Voucher': {'entries':['item_group']},
-		'Sales BOM': {'fields':['serial_no']},
-		'Sales Order': {'sales_order_details':['item_group']},
-		'Serial No': {'fields':['item_group']},
-		'Sales Partner': {'partner_target_details':['item_group']},
-		'Sales Person': {'target_details':['item_group']},
-		'Territory': {'target_details':['item_group']}
-	},
-	'fs_page_break': {
-		'Delivery Note': {'delivery_note_details':['page_break'],'packing_details':['page_break']},
-		'Indent': {'indent_details':['page_break']},
-		'Purchase Order': {'po_details':['page_break']},
-		'Purchase Receipt': {'purchase_receipt_details':['page_break']},
-		'Purchase Voucher': {'entries':['page_break']},
-		'Quotation': {'quotation_details':['page_break']},
-		'Receivable Voucher': {'entries':['page_break']},
-		'Sales Order': {'sales_order_details':['page_break']}
-	},
-	'fs_exports': {
-		'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate']},
-		'POS Setting': {'fields':['conversion_rate','currency']},
-		'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','export_amount','export_rate']},
-		'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','export_amount','export_rate']},
-		'Item': {'ref_rate_details':['ref_currency']},
-		'Sales BOM': {'fields':['currency']},
-		'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}
-	},
-	'fs_imports': {
-		'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']},
-		'Purchase Order': {'fields':['Note HTML','conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'po_details':['import_amount','import_rate']},
-		'Purchase Receipt': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'purchase_receipt_details':['import_amount','import_rate']},
-		'Supplier Quotation': {'fields':['conversion_rate','currency']}
-	},
-	'fs_item_advanced': {
-		'Item': {'fields':['item_customer_details']}
-	},
-	'fs_sales_extras': {
-		'Address': {'fields':['sales_partner']},
-		'Contact': {'fields':['sales_partner']},
-		'Customer': {'fields':['sales_team']},
-		'Delivery Note': {'fields':['sales_team','Packing List']},
-		'Item': {'fields':['item_customer_details']},
-		'Receivable Voucher': {'fields':['sales_team']},
-		'Sales Order': {'fields':['sales_team','Packing List']}
-	},
-	'fs_more_info': {
-		'Customer': {'fields':['More Info']},
-		'Delivery Note': {'fields':['More Info']},
-		'Enquiry': {'fields':['More Info']},
-		'Indent': {'fields':['More Info']},
-		'Lead': {'fields':['More Info']},
-		'Payable Voucher': {'fields':['More Info']},
-		'Purchase Order': {'fields':['More Info']},
-		'Purchase Receipt': {'fields':['More Info']},
-		'Quotation': {'fields':['More Info']},
-		'Receivable Voucher': {'fields':['More Info']},
-		'Sales Order': {'fields':['More Info']},
-		'Serial No': {'fields':['More Info']},
-		'Supplier': {'fields':['More Info']}
-	},
-	'fs_quality': {
-		'Item': {'fields':['Item Inspection Criteria','inspection_required']},
-		'Purchase Receipt': {'purchase_receipt_details':['qa_no']}
-	},
-	'fs_manufacturing': {
-		'Item': {'fields':['Manufacturing']}
-	},
-	'fs_pos': {
-		'Receivable Voucher': {'fields':['is_pos']}
-	},
-	'fs_recurring_invoice': {
-		'Receivable Voucher': {'fields': ['Recurring Invoice']}
-	}
-}
-
-$(document).bind('form_refresh', function() {
-	for(sys_feat in sys_defaults)
-	{
-		if(sys_defaults[sys_feat]=='0' && (sys_feat in pscript.feature_dict)) //"Features to hide" exists
-		{
-			if(cur_frm.doc.doctype in  pscript.feature_dict[sys_feat])
-			{
-				for(fort in pscript.feature_dict[sys_feat][cur_frm.doc.doctype])
-				{
-					if(fort=='fields')
-						hide_field(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort]);
-					else if(cur_frm.fields_dict[fort])
-					{
-						for(grid_field in pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort])
-							cur_frm.fields_dict[fort].grid.set_column_disp(pscript.feature_dict[sys_feat][cur_frm.doc.doctype][fort][grid_field], false);
-					}
-					else
-						msgprint('Grid "'+fort+'" does not exists');
-				}
-			}
-		}
-	}
-})
+// start
+erpnext.startup.start();
\ No newline at end of file
diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/toolbar.js
new file mode 100644
index 0000000..49738ce
--- /dev/null
+++ b/erpnext/startup/toolbar.js
@@ -0,0 +1,27 @@
+/* toolbar settings */
+wn.provide('erpnext.toolbar');
+
+erpnext.toolbar.setup = function() {
+	// profile
+	$('#toolbar-user').append('<li><a href="#profile-settings">Profile Settings</a></li>')
+
+	// help
+	$('.topbar .secondary-nav').append('<li class="dropdown">\
+		<a class="dropdown-toggle" href="#" onclick="return false;">Help</a>\
+		<ul class="dropdown-menu" id="toolbar-help">\
+		</ul></li>')
+
+	$('#toolbar-help').append('<li><a href="http://erpnext.blogspot.com/2011/03/erpnext-help.html" target="_blank">\
+		Documentation</a></li>')
+
+	$('#toolbar-help').append('<li><a href="http://groups.google.com/group/erpnext-user-forum" target="_blank">\
+		Forum</a></li>')
+
+	$('#toolbar-help').append('<li><a href="http://www.providesupport.com?messenger=iwebnotes" target="_blank">\
+		Live Chat (Office Hours)</a></li>')
+
+	// billing
+	if(pscript.is_erpnext_saas && is_system_manager) {
+		$('#toolbar-user').append('<li><a href="#billing">Billing</a></li>')
+	}
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt
index db04bcf..d37114d 100644
--- a/erpnext/stock/doctype/item/item.txt
+++ b/erpnext/stock/doctype/item/item.txt
@@ -616,34 +616,6 @@
 	# DocField
 	{
 		'doctype': 'DocField',
-		'fieldname': 'manufacturer',
-		'fieldtype': 'Data',
-		'label': 'Manufacturer',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'manufacturer_part_no',
-		'fieldtype': 'Data',
-		'label': 'Manufacturer Part Number',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'item_supplier_details',
-		'fieldtype': 'Table',
-		'label': 'Item Supplier Details',
-		'options': 'Item Supplier',
-		'permlevel': 0
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
 		'fieldtype': 'Section Break',
 		'label': 'Sales Details',
 		'oldfieldtype': 'Section Break',
@@ -929,4 +901,4 @@
 		'permlevel': 0,
 		'print_hide': 1
 	}
-]
\ No newline at end of file
+]
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py
index 7031ccc..68b1c55 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.py
+++ b/erpnext/support/doctype/support_ticket/support_ticket.py
@@ -71,6 +71,8 @@
 		d = Document('Support Ticket Response')
 		d.from_email = from_email or webnotes.user.name
 		d.parent = self.doc.name
+		d.parenttype = "Support Ticket"
+		d.parentfield = "responses"
 		d.mail = response
 		d.content_type = content_type
 		d.save(1)
diff --git a/erpnext/utilities/doctype/production_tips_common/production_tips_common.js b/erpnext/utilities/doctype/production_tips_common/production_tips_common.js
deleted file mode 100644
index 4dfc00a3..0000000
--- a/erpnext/utilities/doctype/production_tips_common/production_tips_common.js
+++ /dev/null
@@ -1,71 +0,0 @@
-// Global dictionary of next steps for doctypes
-// ============================================
-pscript.tip_prod_dict = {'Production Order':['Material Transfer', 'Backflush']};
-
-
-// Set tips depending on conditions
-// ================================
-cur_frm.cscript.get_tips = function(doc, cdt, cdn){
-  var next_step_list = pscript.tip_prod_dict[cur_frm.doctype] ? pscript.tip_prod_dict[cur_frm.doctype] : 0;
-  
-  if(cur_frm.doctype!='Production Planning Tool'){
-    // new doc
-    if(doc.__islocal){
-      if(doc.status=='Cancelled' || doc.amended_from)
-        cur_frm.set_tip("You can now make changes in this " + cur_frm.doctype + " and save it by clicking on the <div style='font-weight:bold; display:inline'>Save</div> button in the above toolbar.");
-      else{ 
-        cur_frm.set_tip("To create " + cur_frm.doctype + " please start by entering all the mandatory fields (marked <div style='color:Red; display:inline'> Red</div>).");
-        if(cur_frm.doctype=='Stock Entry') cur_frm.append_tip("If your purpose is Production Order, please go to <div style='font-weight:bold; display:inline'>Items</div> tab and click <div style='font-weight:bold; display:inline'>Get Items</div> to fetch the items.");
-        cur_frm.append_tip("You can then save this form by clicking on the <div style='font-weight:bold; display:inline'>Save</div> button in the above toolbar.");
-      }
-    }
-    
-    // doc exists
-    else if(!doc.__islocal){
-      // execute when doc is saved
-      if(doc.docstatus==0 && cur_frm.doctype!='Production Planning Tool')
-        cur_frm.set_tip("You have saved your " + cur_frm.doctype + ". You can make this draft permanent by clicking on <div style='font-weight:bold; display:inline'>Submit</div> button above.");
-        
-      // execute if doc is submitted
-      else if(doc.docstatus==1){
-        cur_frm.set_tip("You have submitted this " + cur_frm.doctype + ".");
-        for(var i=0; i<next_step_list.length; i++){
-          if(i==0)  cur_frm.append_tip("To proceed select the <div style='font-weight:bold; display:inline'>Next Steps</div> tab below. To transfer raw materials to Finished Goods Warehouse click on <div style='font-weight:bold; display:inline'>" + next_step_list[i] +"</div>.");
-          else  cur_frm.append_tip("To update the quantity of finished goods and raw materials in their respective warehouses click on <div style='font-weight:bold; display:inline'>" + next_step_list[i] + "</div>.");
-        }
-        cur_frm.append_tip("(To amend this "+ cur_frm.doctype + " click on the <div style='font-weight:bold; display:inline'>Cancel</div> button above.)");
-      }
-      
-      // execute when doc is amended
-      else if(doc.docstatus==2){
-        cur_frm.set_tip("To make this " + cur_frm.doctype + " editable click on the <div style='font-weight:bold; display:inline'>Amend</div> button above.");
-      }
-    }
-  }
-}
-  
-
-// Execute if current doctype is Production Planning Tool
-// ======================================================
-cur_frm.cscript.get_PPT_tips = function(doc, cdt, cdn)
-{
-  cur_frm.set_tip('Welcome to Production Planning Wizard. This helps you to raise production order and see your raw material status as you plan your production.');
-  cur_frm.append_tip("To start fetch all open Production Orders and Sales Orders by clicking on the <div style='font-weight:bold; display:inline'>Get Open Documents</div> button in the <div style='font-weight:bold; display:inline'>Against Document</div> tab below");
-  
-  cur_frm.cscript['Get Open Documents'] = function(doc, cdt, cdn){
-    cur_frm.set_tip("To include the required orders in the Production Plan check mark the <div style='font-weight:bold; display:inline'>Include In Plan</div> cell below.");
-    cur_frm.append_tip("Next you can go to the <div style='font-weight:bold; display:inline'>Items</div> tab and click on <div style='font-weight:bold; display:inline'>Get Items</div> button to fetch the items of the selected orders.");
-  }
-  
-  cur_frm.cscript['Get Items'] = function(doc, cdt, cdn){
-    cur_frm.set_tip("Now to raise a Production Order just click on <div style='font-weight:bold; display:inline'>Raise Production Ordre</div> button below the table.");
-    cur_frm.append_tip("In order to see the Raw Material Report click on <div style='font-weight:bold; display:inline'>Get Raw Material Report</div> button below the table.");
-  }
-}
-
-
-// Executes when doc is edit status of doc is changed
-// ==================================================
-cur_frm.cscript.edit_status_changed = function(doc, cdt, cdn){
-  cur_frm.cscript.get_tips();
-}
diff --git a/erpnext/utilities/doctype/production_tips_common/production_tips_common.txt b/erpnext/utilities/doctype/production_tips_common/production_tips_common.txt
deleted file mode 100644
index 13209ad..0000000
--- a/erpnext/utilities/doctype/production_tips_common/production_tips_common.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# DocType, Production Tips Common
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2010-08-08 17:09:14',
-		'docstatus': 0,
-		'modified': '2010-09-20 14:06:57',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all DocType
-	{
-		'colour': 'White:FFF',
-		'doctype': 'DocType',
-		'issingle': 1,
-		'module': 'Utilities',
-		'name': '__common__',
-		'section_style': 'Simple',
-		'server_code_error': ' ',
-		'version': 37
-	},
-
-	# DocType, Production Tips Common
-	{
-		'doctype': 'DocType',
-		'name': 'Production Tips Common'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/profile_control/profile_control.py b/erpnext/utilities/doctype/profile_control/profile_control.py
index 189d8b1..b8db231 100644
--- a/erpnext/utilities/doctype/profile_control/profile_control.py
+++ b/erpnext/utilities/doctype/profile_control/profile_control.py
@@ -22,66 +22,9 @@
     self.doc, self.doclist = d,dl
     self.last_profile = None
   
-  # Sync Profile with Gateway
-  # -------------------------
-  def sync_with_gateway(self,pid):
-    p = Document('Profile',pid)
-
-    # login to gateway
-    from webnotes.utils.webservice import FrameworkServer
-    fw = FrameworkServer('www.erpnext.com','/','__system@webnotestech.com','password',https=1)
-
-    account_id = sql("select value from tabSingles where doctype='Control Panel' and field='account_id'")[0][0]
-    
-    # call add profile
-    ret = fw.runserverobj('Profile Control','Profile Control','add_profile_gateway',str([p.first_name, p.middle_name, p.last_name, p.email, p.name, account_id]))
-    
-    if ret.get('exc'):
-      msgprint(ret['exc'])
-      raise Exception
-  
   def get_role_permission(self,role):
     perm = sql("select distinct t1.`parent`, t1.`read`, t1.`write`, t1.`create`, t1.`submit`,t1.`cancel`,t1.`amend` from `tabDocPerm` t1, `tabDocType` t2 where t1.`role` ='%s' and t1.docstatus !=2 and t1.permlevel = 0 and t1.`read` = 1 and t2.module != 'Recycle Bin' and t1.parent=t2.name "%role)
     return perm or ''
-  
-  
-  # Check if password is expired
-  # --------------------------------
-  def has_pwd_expired(self):
-    if session['user'] != 'Administrator' and session['user'].lower() != 'demo':
-      last_pwd_date = None
-      try:
-        last_pwd_date = sql("select password_last_updated from tabProfile where name=%s",session['user'])[0][0] or ''
-      except:
-        return 'No'
-      if cstr(last_pwd_date) == '':
-        sql("update tabProfile set password_last_updated = '%s' where name='%s'"% (nowdate(),session['user']))
-        return 'No'
-      else:
-        date_diff = (getdate(nowdate()) - last_pwd_date).days
-        expiry_period = sql("select value from tabSingles where doctype='Control Panel' and field='password_expiry_days'")
-        if expiry_period and cint(expiry_period[0][0]) and cint(expiry_period[0][0]) < date_diff:
-          return 'Yes'
-        return 'No'
-              
-  def reset_password(self,pwd):
-    if sql("select name from tabProfile where password=PASSWORD(%s) and name=%s", (pwd,session['user'])):
-      return 'Password cannot be same as old password'
-    sql("update tabProfile set password=PASSWORD(%s),password_last_updated=%s where name = %s", (pwd,nowdate(),session['user']))
-    return 'ok'
-  
-#-------------------------------------------------------------------------------------------------------
-  #functions for manage user page
-  #-----------Enable/Disable Profile-----------------------------------------------------------------------------------------------    
-  def change_login(self,args):
-    args = eval(args)
-    
-    if cint(args['set_disabled'])==0:
-      sql("update `tabProfile` set enabled=1 where name='%s'"%args['user'])
-    else:
-      sql("update `tabProfile` set enabled=0 where name='%s'"%args['user'])
-    
-    return 'ok'
 
 #------------return role list -------------------------------------------------------------------------------------------------
   # All roles of Role Master
@@ -113,75 +56,3 @@
       pr.parentfield = 'userroles'
       pr.save(1)
       
-
-
-  # Add new member
-  # ---------------
-  def add_profile(self,arg):
-    
-    # Check credit balance
-    get_obj('WN ERP Client Control').check_credit_balance()
-    
-    arg=eval(arg)
-    pr=Document('Profile')
-    for d in arg.keys():
-      if d!='role':
-        pr.fields[d] = arg[d]
-   
-    pr.enabled=0
-    pr.user_type='System User'
-    pr.save(1)
-    pr_obj = get_obj('Profile',pr.name)
-    if (pr.name):
-      msg="New member is added"
-      pr_obj.on_update()
-    else:
-      msg="Profile not created"
-    
-    return cstr(msg)
-
-  # to find currently login user 
-  def current_login(self):
-    cl_list=sql("select distinct user from tabSessions")
-    if cl_list:
-      cl_list=[x[0] for x in cl_list]
-    
-    return cl_list
-
-
-  # Remove Profile
-  # ---------------
-  def remove_profile(self, user):
-    # delete profile
-    webnotes.model.delete_doc('Profile',user)
-    
-    # Update WN ERP Client Control
-    sql("update tabSingles set value = value - 1 where field = 'total_users' and doctype = 'WN ERP Client Control'")
-
-    # login to gateway
-    from webnotes.utils.webservice import FrameworkServer
-    fw = FrameworkServer('www.erpnext.com','/','__system@webnotestech.com','password',https=1)
-
-    account_id = sql("select value from tabSingles where doctype='Control Panel' and field='account_id'")[0][0]
-
-    # call remove profile
-    ret = fw.runserverobj('Profile Control','Profile Control','remove_app_sub',str([user, account_id, session['user']]))
-    
-    if ret.get('exc'):
-      msgprint(ret['exc'])
-      raise Exception
-
-    return "User Removed Successfully"
-
-
-  # Create Profile
-  # ---------------
-  def create_profile(self, email):
-    if sql("select name from tabProfile where name = %s", email):
-      sql("update tabProfile set docstatus = 0 where name = %s", email)
-    else:
-      pr = Document('Profile')
-      pr.email = email
-      pr.enabled=0
-      pr.user_type='System User'
-      pr.save(1)
diff --git a/erpnext/utilities/doctype/sso_control/sso_control.py b/erpnext/utilities/doctype/sso_control/sso_control.py
deleted file mode 100644
index bfc0e43..0000000
--- a/erpnext/utilities/doctype/sso_control/sso_control.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Please edit this list and import only required elements
-import webnotes
-
-from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
-from webnotes.model import db_exists
-from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
-from webnotes.model.doclist import getlist, copy_doclist
-from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
-from webnotes import session, form, is_testing, msgprint, errprint
-
-set = webnotes.conn.set
-sql = webnotes.conn.sql
-get_value = webnotes.conn.get_value
-in_transaction = webnotes.conn.in_transaction
-convert_to_lists = webnotes.conn.convert_to_lists
-	
-# -----------------------------------------------------------------------------------------
-
-
-class DocType:
-  def __init__(self, d, dl):
-    self.doc, self.doclist = d, dl
-
-  def logout_sso(self):
-    import webnotes
-    import webnotes.utils.webservice
-
-    if session['data'].get('login_from'):
-      sso = webnotes.utils.webservice.FrameworkServer(session['data'].get('login_from'), '/', '__system@webnotestech.com', 'password')
-      sso.runserverobj('SSO Control', 'SSO Control', 'logout_user', session['user'])
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/sso_control.txt b/erpnext/utilities/doctype/sso_control/sso_control.txt
deleted file mode 100644
index ee0224e..0000000
--- a/erpnext/utilities/doctype/sso_control/sso_control.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# DocType, SSO Control
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2010-08-08 17:09:24',
-		'docstatus': 0,
-		'modified': '2010-12-20 19:44:29',
-		'modified_by': 'umair@iwebnotes.com',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all DocType
-	{
-		'colour': 'White:FFF',
-		'doctype': 'DocType',
-		'issingle': 1,
-		'module': 'Utilities',
-		'name': '__common__',
-		'section_style': 'Simple',
-		'server_code_error': ' ',
-		'version': 1
-	},
-
-	# DocType, SSO Control
-	{
-		'doctype': 'DocType',
-		'name': 'SSO Control'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/wn_erp_client_control/__init__.py b/erpnext/utilities/doctype/wn_erp_client_control/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/erpnext/utilities/doctype/wn_erp_client_control/__init__.py
+++ /dev/null
diff --git a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.py b/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.py
deleted file mode 100644
index 288f305..0000000
--- a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.py
+++ /dev/null
@@ -1,141 +0,0 @@
-# Please edit this list and import only required elements
-import webnotes
-
-from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
-from webnotes.model import db_exists
-from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
-from webnotes.model.doclist import getlist, copy_doclist
-from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
-from webnotes import session, form, is_testing, msgprint, errprint
-
-set = webnotes.conn.set
-sql = webnotes.conn.sql
-get_value = webnotes.conn.get_value
-in_transaction = webnotes.conn.in_transaction
-convert_to_lists = webnotes.conn.convert_to_lists
-	
-# -----------------------------------------------------------------------------------------
-
-
-class DocType:
-  def __init__(self, doc, doclist):
-    self.doc, self.doclist = doc, doclist
-
-
-  # Check End of Trial Period
-  # -------------------------
-  def trial_payment_reminders(self):
-    if cint(self.doc.is_trial_account)==1:
-      # Trial Period Expiry
-      trial_end_date = add_days(self.doc.account_start_date, 30)
-      days = date_diff(trial_end_date, nowdate())
-      # check if trial period has expired
-      if days < 10 and days >= 0 and has_common(['System Manager'],webnotes.user.get_roles()):
-        return "Your Trial Period expires on '%s'. Please buy credits online using Manage Account." % (formatdate(trial_end_date))
-      
-      # trial period has already expired
-      elif days < 0 and days >= -6:
-        extended_days = 7 + days
-        return "Your Trial Period has expired on %s. However, your account will be live for %s days. Please contact your System Manager to buy credits." % (formatdate(trial_end_date),cstr(extended_days))
-      elif not has_common(['Administrator'],webnotes.user.get_roles()) and days < -6:
-        return "Stopped"
-    
-    # Account is not a trial account
-    else:
-      return self.account_expiry_reminder()
-      
-
-  # Account Expiry Reminder  
-  # -----------------------
-  def account_expiry_reminder(self):
-    import webnotes.utils
-    from datetime import datetime
-    # Payment Reminder in case of not enough balance
-    cr_reqd = cint(self.doc.total_users)
-    days_left = cint(self.calc_days())
-    # check if account balance is sufficient
-    if cint(self.doc.credit_balance)<(cr_reqd):
-      
-      # Difference between last payment date and current date
-      if self.doc.last_deduction_date: last_payment = date_diff(nowdate(),self.doc.last_deduction_date)
-      else: last_payment = -1
-
-      # 7 days extension
-      remaining_days = days_left - 24
-      if last_payment > 30 or last_payment == -1:
-        if remaining_days < 8 and remaining_days >= 1:
-          return "Your account will be de-activated in " + cstr(remaining_days) + " days. Please contact your System Manager to buy credits."
-        elif remaining_days==0:
-          return "Your account will be disabled from tomorrow. Please contact your System Manager to buy credits."
-        elif not has_common(['Administrator'],webnotes.user.get_roles()):
-          return "Stopped"
-
-      # check if user account is extended for seven days
-      if cint(self.doc.is_trial_account)==0:
-        if days_left < 10 and days_left >= 0:
-          return "You have only %s Credits in your account. Buy credits before %s." % (cint(self.doc.credit_balance),formatdate(self.next_bill_sdate))
-
-
-
-  # Calculate days between current date and billing cycle end date
-  # --------------------------------------------------------------
-  def calc_days(self):
-    if self.doc.billing_cycle_date:
-      next_bill_month = cint(nowdate().split('-')[1])
-      if cint(nowdate().split('-')[2]) > cint(self.doc.billing_cycle_date.split('-')[2]):
-        next_bill_month = cint(nowdate().split('-')[1]) + 1
-      next_bill_year = nowdate().split('-')[0]
-      if next_bill_month > 12:
-        next_bill_month = next_bill_month % 12
-        next_bill_year += 1
-      self.next_bill_sdate = cstr(next_bill_year)+'-'+cstr(next_bill_month)+'-'+(self.calc_next_day(next_bill_year,next_bill_month))
-      #msgprint("next_bill_month :::" + self.next_bill_sdate)
-      return date_diff(self.next_bill_sdate, nowdate())
-
-
-  # Calculate next billing date day
-  # --------------------------------
-  def calc_next_day(self, next_year, next_month):
-    bill_cycle_day = cstr(self.doc.billing_cycle_date).split('-')[2]
-    if cint(next_month) == 2 and next_year%4==0 and (next_year%100!=0 or next_year%400==0) and cint(bill_cycle_day) > 28:
-      bill_cycle_day = '28'
-    elif cint(bill_cycle_day) == 31 and cint(next_month) in (4,6,9,11):
-      bill_cycle_day = '30'
-    return bill_cycle_day
-
-
-  # Update acc credits and balance (making payment from gateway)
-  # -------------------------------------------------------------
-  def update_acc_bal(self,args):
-    args = eval(args)
-    self.doc.credit_balance = cint(self.doc.credit_balance) + cint(args.get('net_cr'))
-    self.doc.total_users = cint(self.doc.total_users) + cint(args.get('total_users'))
-    if cint(self.doc.is_trial_account) == 1:
-      if not self.doc.account_start_date:
-        self.doc.account_start_date = nowdate()
-      self.doc.is_trial_account = 0
-      self.doc.billing_cycle_date = nowdate()
-      self.doc.last_deduction_date = nowdate()
-    self.doc.save()
-
-
-  # Check Credit Balance
-  # ---------------------
-  def check_credit_balance(self):
-    if cint(self.doc.is_trial_account) == 0:
-      if cint(self.doc.credit_balance) < 1:
-        msgprint("You do not have enough credits to add new user. Please buy credits.")
-        raise Exception
-      else:
-        self.doc.credit_balance = cint(self.doc.credit_balance) - 1
-        msgprint("Your one credit is consumed. Balance Credits : %s" % (self.doc.credit_balance))
-    self.doc.total_users = cint(self.doc.total_users) + 1
-    self.doc.save()
-
-
-  # Monthly Deduction
-  # ------------------
-  def monthly_deduction(self, cr_ded):
-    self.doc.credit_balance = cint(self.doc.credit_balance) - cint(cr_ded)
-    self.doc.last_deduction_date = nowdate()
-    self.doc.save()
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.txt b/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.txt
deleted file mode 100644
index 1ab4ed8..0000000
--- a/erpnext/utilities/doctype/wn_erp_client_control/wn_erp_client_control.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-# DocType, WN ERP Client Control
-[
-
-	# These values are common in all dictionaries
-	{
-		'creation': '2010-08-08 17:09:30',
-		'docstatus': 0,
-		'modified': '2010-09-20 14:06:57',
-		'modified_by': 'Administrator',
-		'owner': 'Administrator'
-	},
-
-	# These values are common for all DocType
-	{
-		'colour': 'White:FFF',
-		'doctype': 'DocType',
-		'issingle': 1,
-		'istable': 0,
-		'module': 'Utilities',
-		'name': '__common__',
-		'read_only': 1,
-		'section_style': 'Simple',
-		'server_code_error': ' ',
-		'show_in_menu': 1,
-		'version': 137
-	},
-
-	# These values are common for all DocField
-	{
-		'doctype': 'DocField',
-		'name': '__common__',
-		'parent': 'WN ERP Client Control',
-		'parentfield': 'fields',
-		'parenttype': 'DocType',
-		'permlevel': 0
-	},
-
-	# These values are common for all DocPerm
-	{
-		'doctype': 'DocPerm',
-		'name': '__common__',
-		'parent': 'WN ERP Client Control',
-		'parentfield': 'permissions',
-		'parenttype': 'DocType',
-		'read': 1,
-		'role': 'System Manager'
-	},
-
-	# DocType, WN ERP Client Control
-	{
-		'doctype': 'DocType',
-		'name': 'WN ERP Client Control'
-	},
-
-	# DocPerm
-	{
-		'create': 1,
-		'doctype': 'DocPerm',
-		'idx': 1,
-		'permlevel': 0,
-		'write': 1
-	},
-
-	# DocPerm
-	{
-		'doctype': 'DocPerm',
-		'idx': 2,
-		'permlevel': 1
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'account_start_date',
-		'fieldtype': 'Date',
-		'idx': 1,
-		'label': 'Account Start Date'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'billing_cycle_date',
-		'fieldtype': 'Date',
-		'idx': 2,
-		'label': 'Billing Cycle Date'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'total_users',
-		'fieldtype': 'Int',
-		'idx': 3,
-		'label': 'Total Users'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'credit_balance',
-		'fieldtype': 'Int',
-		'idx': 4,
-		'label': 'Credit Balance'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'is_trial_account',
-		'fieldtype': 'Check',
-		'idx': 5,
-		'label': 'Is Trial Account'
-	},
-
-	# DocField
-	{
-		'doctype': 'DocField',
-		'fieldname': 'last_deduction_date',
-		'fieldtype': 'Date',
-		'idx': 6,
-		'label': 'Last Credit Deduction Date'
-	}
-]
\ No newline at end of file
diff --git a/erpnext/utilities/page/trash/trash.html b/erpnext/utilities/page/trash/trash.html
index 0fdca75..b17e475 100644
--- a/erpnext/utilities/page/trash/trash.html
+++ b/erpnext/utilities/page/trash/trash.html
@@ -1,2 +1,4 @@
-<div id="trash_header">&nbsp;</div>
-<div id="trash_div" style="margin: 0px;">&nbsp;</div>
\ No newline at end of file
+<div class="layout_wrapper">
+<div id="trash_header"></div>
+<div id="trash_div" style="margin: 0px;"></div>
+</div>
\ No newline at end of file
diff --git a/erpnext/website/Module Def/Website/Website.txt b/erpnext/website/Module Def/Website/Website.txt
new file mode 100644
index 0000000..e423869
--- /dev/null
+++ b/erpnext/website/Module Def/Website/Website.txt
@@ -0,0 +1,142 @@
+# Module Def, Website
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-23 17:05:32',
+		'docstatus': 0,
+		'modified': '2012-02-02 13:23:41',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Module Def Role
+	{
+		'doctype': 'Module Def Role',
+		'name': '__common__',
+		'parent': 'Website',
+		'parentfield': 'roles',
+		'parenttype': 'Module Def'
+	},
+
+	# These values are common for all Module Def Item
+	{
+		'doctype': 'Module Def Item',
+		'name': '__common__',
+		'parent': 'Website',
+		'parentfield': 'items',
+		'parenttype': 'Module Def'
+	},
+
+	# These values are common for all Module Def
+	{
+		'disabled': 'No',
+		'doctype': u'Module Def',
+		'is_hidden': 'No',
+		'module_label': 'Website',
+		'module_name': 'Website',
+		'name': '__common__'
+	},
+
+	# Module Def, Website
+	{
+		'doctype': u'Module Def',
+		'name': 'Website'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Web Page',
+		'doc_name': 'Web Page',
+		'doc_type': 'Forms',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Product',
+		'doc_name': 'Product',
+		'doc_type': 'Forms',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Blog',
+		'doc_name': 'Blog',
+		'doc_type': 'Forms',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Style Settings',
+		'doc_name': 'Style Settings',
+		'doc_type': 'Single DocType',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Website Settings',
+		'doc_name': 'Website Settings',
+		'doc_type': 'Single DocType',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Home Settings',
+		'doc_name': 'Home Settings',
+		'doc_type': 'Single DocType',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'About Us Settings',
+		'doc_name': 'About Us Settings',
+		'doc_type': 'Single DocType',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Contact Us Settings',
+		'doc_name': 'Contact Us Settings',
+		'doc_type': 'Single DocType',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Products Settings',
+		'doc_name': 'Products Settings',
+		'doc_type': 'Single DocType',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Role
+	{
+		'doctype': 'Module Def Role',
+		'role': 'System Manager'
+	},
+
+	# Module Def Role
+	{
+		'doctype': 'Module Def Role',
+		'role': 'System Manager'
+	},
+
+	# Module Def Role
+	{
+		'doctype': 'Module Def Role',
+		'role': 'Website Manager'
+	},
+
+	# Module Def Role
+	{
+		'doctype': 'Module Def Role',
+		'role': 'Website Manager'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/Role/Website Manager/Website Manager.txt b/erpnext/website/Role/Website Manager/Website Manager.txt
new file mode 100644
index 0000000..ad1ad9a
--- /dev/null
+++ b/erpnext/website/Role/Website Manager/Website Manager.txt
@@ -0,0 +1,26 @@
+# Role, Website Manager
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-24 10:18:47',
+		'docstatus': 0,
+		'modified': '2012-02-06 15:22:27',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
+	},
+
+	# These values are common for all Role
+	{
+		'doctype': 'Role',
+		'module': u'Website',
+		'name': '__common__',
+		'role_name': u'Website Manager'
+	},
+
+	# Role, Website Manager
+	{
+		'doctype': 'Role',
+		'name': u'Website Manager'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/__init__.py
diff --git a/erpnext/website/css/website.css b/erpnext/website/css/website.css
new file mode 100644
index 0000000..cdea087
--- /dev/null
+++ b/erpnext/website/css/website.css
@@ -0,0 +1,86 @@
+#body_div {
+	width: 900px;
+	margin: auto;
+}
+
+.layout_wrapper {
+	padding: 20px;
+}
+
+h1 {
+	margin-bottom: 15px;
+}
+
+footer {
+	width: 900px;
+	margin: auto;
+}
+header .topbar .container {
+	width: 900px;
+	margin: auto;
+}
+
+.web-head-section {
+	margin-bottom: 20px
+}
+
+.web-content input[type="text"], .web-content input[type="password"], .web-content select {
+	min-width: 180px;
+}
+
+.web-main-section {
+	width: 65%;
+	float: left;
+	margin-bottom: 20px;
+}
+
+.web-side-section {
+	width: 30%;
+	float: right;
+	margin-bottom: 20px;
+	margin-right: 15px;
+	color: #606060;
+	overflow-x: hidden;
+}
+
+footer {
+	color: #777;	
+}
+
+.web-footer {
+	color: inherit;
+	text-align: center;
+	margin: 10px;
+	line-height: 1.7;
+}
+
+.web-footer div, .web-footer a {
+	font-size: 11px;
+}
+
+.web-footer-menu {
+	margin-bottom: 7px;
+}
+footer a, footer a:visited {
+	color: #777;
+}
+
+footer a:hover {
+	background-color: #777;
+	color: #fff;
+}
+
+.web-footer-menu ul {
+	list-style: none;
+	margin: 0px;
+}
+
+.web-footer-menu ul li {
+	display: inline;
+	padding: 2px 15px;
+	border-right: 1px solid #999;
+}
+
+.web-footer-menu ul li:last-child {
+	border-right: 0px solid #777 !important;
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/__init__.py
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/about_us_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/about_us_settings/__init__.py
diff --git a/erpnext/website/doctype/about_us_settings/about_us_settings.py b/erpnext/website/doctype/about_us_settings/about_us_settings.py
new file mode 100644
index 0000000..770f1d2
--- /dev/null
+++ b/erpnext/website/doctype/about_us_settings/about_us_settings.py
@@ -0,0 +1,24 @@
+"""
+generate html
+"""
+import webnotes
+
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+		
+	def on_update(self):
+		"""make home html"""
+		from website.utils import make_template
+		import os
+		path = os.path.join(os.path.dirname(__file__), 'template.html')
+		
+		self.doc.about_team = webnotes.conn.sql("""select * from `tabAbout Us Team` 
+			where parent='About Us Settings' order by idx""", as_dict=1)
+		
+		import markdown2
+		for t in self.doc.about_team:
+			t['bio'] = markdown2.markdown(t.get('bio') or '')
+		
+		webnotes.conn.set_value('Page', 'about', 'title', self.doc.headline)
+		webnotes.conn.set_value('Page', 'about', 'content', make_template(self.doc, path))
diff --git a/erpnext/website/doctype/about_us_settings/about_us_settings.txt b/erpnext/website/doctype/about_us_settings/about_us_settings.txt
new file mode 100644
index 0000000..5ecae16
--- /dev/null
+++ b/erpnext/website/doctype/about_us_settings/about_us_settings.txt
@@ -0,0 +1,106 @@
+# DocType, About Us Settings
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 10:13:16',
+		'docstatus': 0,
+		'modified': '2012-01-27 11:36:44',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': '1327641155',
+		'allow_attach': 1,
+		'colour': 'White:FFF',
+		'doctype': 'DocType',
+		'issingle': 1,
+		'max_attachments': 10,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 4
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'About Us Settings',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# These values are common for all DocPerm
+	{
+		'create': 1,
+		'doctype': 'DocPerm',
+		'name': '__common__',
+		'parent': 'About Us Settings',
+		'parentfield': 'permissions',
+		'parenttype': 'DocType',
+		'permlevel': 0,
+		'read': 1,
+		'role': 'Website Manager',
+		'write': 1
+	},
+
+	# DocType, About Us Settings
+	{
+		'doctype': 'DocType',
+		'name': 'About Us Settings'
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'headline',
+		'fieldtype': 'Data',
+		'label': 'Headline'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'main_section',
+		'fieldtype': 'Code',
+		'label': 'Main Section'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'team',
+		'fieldtype': 'Table',
+		'label': 'Team',
+		'options': 'About Us Team'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'side_section',
+		'fieldtype': 'Code',
+		'label': 'Side Section'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'file_list',
+		'fieldtype': 'Text',
+		'hidden': 1,
+		'label': 'File List',
+		'no_copy': 1,
+		'print_hide': 1
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/doctype/about_us_settings/template.html b/erpnext/website/doctype/about_us_settings/template.html
new file mode 100644
index 0000000..47ef402
--- /dev/null
+++ b/erpnext/website/doctype/about_us_settings/template.html
@@ -0,0 +1,36 @@
+<div class="layout_wrapper">
+	<div class="web-content" id="content-about-us">
+		{% if doc.headline %}
+			<h1>{{ doc.headline }}</h1>
+		{% endif %}
+		<div class="web-main-section">
+			{{ doc.main_section_html }}
+			
+			{% if doc.about_team %}
+				<h2>Team</h2>
+				<table style="width: 90%">
+					<tbody>
+						{% for p in doc.about_team %}
+							<tr>
+								<td style="width: 110px">
+									<img src="files/{{ p.image }}" 
+										style="width: 100px; margin-right: 10px; 
+											margin-bottom: 15px;" />
+								</td>
+								<td>
+									<h4>{{ p.person_name }}</h4>
+									<div class="comment">{{ p.designation }}</div>
+									<div style="margin-bottom: 15px">{{ p.bio }}</div>
+								</td>
+							</tr>
+						{% endfor %}
+					</tbody>
+				</table>
+			{% endif %}
+		</div>
+		<div class="web-side-section">
+			{{ doc.side_section_html }}
+		</div>
+		<div style="clear: both"></div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/about_us_team/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/about_us_team/__init__.py
diff --git a/erpnext/website/doctype/about_us_team/about_us_team.txt b/erpnext/website/doctype/about_us_team/about_us_team.txt
new file mode 100644
index 0000000..bbbf47d
--- /dev/null
+++ b/erpnext/website/doctype/about_us_team/about_us_team.txt
@@ -0,0 +1,74 @@
+# DocType, About Us Team
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 10:14:18',
+		'docstatus': 0,
+		'modified': '2012-01-27 11:54:18',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'colour': 'White:FFF',
+		'doctype': 'DocType',
+		'istable': 1,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 5
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'About Us Team',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# DocType, About Us Team
+	{
+		'doctype': 'DocType',
+		'name': 'About Us Team'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'person_name',
+		'fieldtype': 'Data',
+		'label': 'Person Name'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'designation',
+		'fieldtype': 'Data',
+		'label': 'Designation'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'image',
+		'fieldtype': 'Select',
+		'label': 'Image',
+		'options': 'attach_files:'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'bio',
+		'fieldtype': 'Text',
+		'label': 'Bio (markdown)',
+		'width': '300px'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/blog/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/blog/__init__.py
diff --git a/erpnext/website/doctype/blog/blog.py b/erpnext/website/doctype/blog/blog.py
new file mode 100644
index 0000000..c0e70a6
--- /dev/null
+++ b/erpnext/website/doctype/blog/blog.py
@@ -0,0 +1,38 @@
+"""
+record of files
+
+naming for same name files: file.gif, file-1.gif, file-2.gif etc
+"""
+
+import webnotes
+import website.utils
+
+class DocType():
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+		
+	def autoname(self):
+		"""save file by its name"""
+		self.doc.name = website.utils.page_name(self.doc.title)
+	
+	def validate(self):
+		"""write/update 'Page' with the blog"""		
+		p = website.utils.add_page(self.doc.title)
+		
+		from jinja2 import Template
+		import markdown2
+		import os
+		
+		self.doc.content_html = markdown2.markdown(self.doc.content or '')
+		
+		with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
+			p.content = Template(f.read()).render(doc=self.doc)
+		
+		with open(os.path.join(os.path.dirname(__file__), 'blog_page.js'), 'r') as f:
+			p.script = Template(f.read()).render(doc=self.doc)
+				
+		p.save()
+		
+		website.utils.add_guest_access_to_page(p.name)
+
+			
\ No newline at end of file
diff --git a/erpnext/website/doctype/blog/blog.txt b/erpnext/website/doctype/blog/blog.txt
new file mode 100644
index 0000000..2471c2d
--- /dev/null
+++ b/erpnext/website/doctype/blog/blog.txt
@@ -0,0 +1,110 @@
+# DocType, Blog
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 12:24:03',
+		'docstatus': 0,
+		'modified': '2012-02-07 12:59:01',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': u'1327647244',
+		'colour': u'White:FFF',
+		'doctype': 'DocType',
+		'module': u'Website',
+		'name': '__common__',
+		'section_style': u'Simple',
+		'show_in_menu': 0,
+		'version': 2
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': u'DocField',
+		'name': '__common__',
+		'parent': u'Blog',
+		'parentfield': u'fields',
+		'parenttype': u'DocType'
+	},
+
+	# These values are common for all DocPerm
+	{
+		'doctype': u'DocPerm',
+		'name': '__common__',
+		'parent': u'Blog',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
+		'read': 1
+	},
+
+	# DocType, Blog
+	{
+		'doctype': 'DocType',
+		'name': u'Blog'
+	},
+
+	# DocPerm
+	{
+		'create': 1,
+		'doctype': u'DocPerm',
+		'permlevel': 0,
+		'role': u'Website Manager',
+		'write': 1
+	},
+
+	# DocPerm
+	{
+		'create': 1,
+		'doctype': u'DocPerm',
+		'permlevel': 0,
+		'role': u'Blogger',
+		'write': 1
+	},
+
+	# DocPerm
+	{
+		'doctype': u'DocPerm',
+		'permlevel': 1,
+		'role': u'All'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'title',
+		'fieldtype': u'Data',
+		'label': u'Title',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'published',
+		'fieldtype': u'Check',
+		'label': u'Published',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'content',
+		'fieldtype': u'Code',
+		'label': u'Content',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'content_html',
+		'fieldtype': u'Text',
+		'label': u'Preview',
+		'permlevel': 1
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/doctype/blog/blog_page.js b/erpnext/website/doctype/blog/blog_page.js
new file mode 100644
index 0000000..1df9b54
--- /dev/null
+++ b/erpnext/website/doctype/blog/blog_page.js
@@ -0,0 +1,71 @@
+// js inside blog page
+
+pscript['onload_{{ doc.name }}'] = function(wrapper) {
+	// sidebar
+	var side = $(wrapper).find('.web-side-section')
+		.append('<h4>Recent Posts</h4>').get(0);
+		
+	wrapper.recent_list = new wn.widgets.Listing({
+		parent: side,
+		query: 'select name, title, left(content, 100) as content from tabBlog\
+			where ifnull(published,1)=1',
+		hide_refresh: true,
+		render_row: function(parent, data) {
+			if(data.content.length==100) data.content += '...';
+			parent.innerHTML = repl('<a href="#!%(name)s">%(title)s</a>\
+				<div class="comment">%(content)s</div><br>', data);
+		},
+		page_length: 5
+	});
+	wrapper.recent_list.run();
+	
+	
+	// comments
+	$(wrapper).find('.web-main-section').append('<h3>Comments</h3>');
+
+	wrapper.comment_list = new wn.widgets.Listing({
+		parent: $(wrapper).find('.web-main-section').get(0),
+		query: 'select comment, comment_by_fullname, comment_date\
+			from `tabComment Widget Record` where comment_doctype="Page"\
+			and comment_docname="{{ doc.name }}"',
+		no_result_message: 'Be the first one to comment',
+		render_row: function(parent, data) {
+			data.comment_date = dateutil.str_to_user(data.comment_date);
+			$(parent).html(repl("<div style='color:#777'>\
+				On %(comment_date)s %(comment_by_fullname)s said:\
+				</div>\
+				<p style='margin-left: 20px;'>%(comment)s</p><br>", data))
+		},
+		hide_refresh: true
+	});
+	wrapper.comment_list.run();
+	
+	// add comment
+	$(wrapper).find('.web-main-section').append('<br><button class="btn add-comment">\
+		Add Comment</button>');
+	$(wrapper).find('button.add-comment').click(function(){
+		d = new wn.widgets.Dialog({
+			title: 'Add Comment',
+			fields: [
+				{fieldname:'comment_by_fullname', label:'Your Name', reqd:1, fieldtype:'Data'},
+				{fieldname:'comment_by', label:'Email Id', reqd:1, fieldtype:'Data'},
+				{fieldname:'comment', label:'Comment', reqd:1, fieldtype:'Text'},
+				{fieldname:'post', label:'Post', fieldtype:'Button'}
+			]
+		});
+		d.fields_dict.post.input.onclick = function() {
+			var btn = this;
+			var args = d.get_values();
+			if(!args) return;
+			args.comment_doctype = 'Page';
+			args.comment_docname = '{{ doc.name }}';
+			$(btn).set_working();
+			$c('webnotes.widgets.form.comments.add_comment', args, function(r) {
+				$(btn).done_working();
+				d.hide();
+				wrapper.comment_list.refresh();
+			})
+		}
+		d.show();
+	})
+}
\ No newline at end of file
diff --git a/erpnext/website/doctype/blog/template.html b/erpnext/website/doctype/blog/template.html
new file mode 100644
index 0000000..f70bacb
--- /dev/null
+++ b/erpnext/website/doctype/blog/template.html
@@ -0,0 +1,19 @@
+<div class="layout_wrapper">
+	<div class="web-content" id="blog-{{ doc.name }}">
+		<h1>Blog</h1>
+		<div class="web-main-section">
+			<h2>{{ doc.title }}</h2>
+			<br>
+			{{ doc.content_html }}
+		</div>
+		<div class="web-side-section">
+			<p><a href="#!blog">All Blogs</a></p>
+			<h4>Subscribe</h4>
+			<p>
+				<img src="images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
+				<a href="rss.xml" target="_blank">RSS Feed</a>
+			</p>
+		</div>
+		<div style="clear: both"></div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/blog_subscriber/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/blog_subscriber/__init__.py
diff --git a/erpnext/website/doctype/blog_subscriber/blog_subscriber.txt b/erpnext/website/doctype/blog_subscriber/blog_subscriber.txt
new file mode 100644
index 0000000..1b4a987
--- /dev/null
+++ b/erpnext/website/doctype/blog_subscriber/blog_subscriber.txt
@@ -0,0 +1,29 @@
+# DocType, Blog Subscriber
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 17:18:33',
+		'docstatus': 0,
+		'modified': '2012-01-27 17:18:33',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'colour': 'White:FFF',
+		'doctype': 'DocType',
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 1
+	},
+
+	# DocType, Blog Subscriber
+	{
+		'doctype': 'DocType',
+		'name': 'Blog Subscriber'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/contact_us_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/contact_us_settings/__init__.py
diff --git a/erpnext/website/doctype/contact_us_settings/contact_us_settings.py b/erpnext/website/doctype/contact_us_settings/contact_us_settings.py
new file mode 100644
index 0000000..d2fc3c4
--- /dev/null
+++ b/erpnext/website/doctype/contact_us_settings/contact_us_settings.py
@@ -0,0 +1,17 @@
+"""
+generate html
+"""
+import webnotes
+
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+		
+	def on_update(self):
+		"""make home html"""
+		from website.utils import make_template
+		import os
+		path = os.path.join(os.path.dirname(__file__), 'template.html')
+		
+		webnotes.conn.set_value('Page', 'contact', 'title', self.doc.headline)
+		webnotes.conn.set_value('Page', 'contact', 'content', make_template(self.doc, path))
diff --git a/erpnext/website/doctype/contact_us_settings/contact_us_settings.txt b/erpnext/website/doctype/contact_us_settings/contact_us_settings.txt
new file mode 100644
index 0000000..ff43a0a
--- /dev/null
+++ b/erpnext/website/doctype/contact_us_settings/contact_us_settings.txt
@@ -0,0 +1,100 @@
+# DocType, Contact Us Settings
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-25 16:01:33',
+		'docstatus': 0,
+		'modified': '2012-01-25 16:01:33',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'colour': 'White:FFF',
+		'doctype': 'DocType',
+		'document_type': 'Other',
+		'issingle': 1,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 1
+	},
+
+	# These values are common for all DocField
+	{
+		'colour': 'White:FFF',
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'Contact Us Settings',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# These values are common for all DocPerm
+	{
+		'create': 1,
+		'doctype': 'DocPerm',
+		'name': '__common__',
+		'parent': 'Contact Us Settings',
+		'parentfield': 'permissions',
+		'parenttype': 'DocType',
+		'permlevel': 0,
+		'read': 1,
+		'write': 1
+	},
+
+	# DocType, Contact Us Settings
+	{
+		'doctype': 'DocType',
+		'name': 'Contact Us Settings'
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'role': 'Website Manager'
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'role': 'System Manager'
+	},
+
+	# DocField
+	{
+		'default': 'Contact Us',
+		'doctype': 'DocField',
+		'fieldname': 'headline',
+		'fieldtype': 'Data',
+		'label': 'Headline'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'send_email_notification',
+		'fieldtype': 'Check',
+		'label': 'Send Email Notification'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'main_section',
+		'fieldtype': 'Code',
+		'label': 'Main Section'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'side_section',
+		'fieldtype': 'Code',
+		'label': 'Side Section'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/doctype/contact_us_settings/template.html b/erpnext/website/doctype/contact_us_settings/template.html
new file mode 100644
index 0000000..6453784
--- /dev/null
+++ b/erpnext/website/doctype/contact_us_settings/template.html
@@ -0,0 +1,24 @@
+<div class="layout_wrapper">
+	<div class="web-content" id="content-contact-us">
+		{% if doc.headline %}
+			<h1>{{ doc.headline }}</h1>
+		{% endif %}
+		<div class="web-main-section">
+			<label>Your Name*</label>
+			<div><input name="contact-name" type="text"/></div>
+			<br>
+			<label>Email*</label>
+			<div><input name="contact-email" type="text"/></div>
+			<br>
+			<label>Message*</label>
+			<div><textarea name="contact-message" style="height: 200px"></textarea></div>
+			<br>
+			<div><button class="btn primary">Send</button></div>
+			{{ doc.main_section_html }}
+		</div>
+		<div class="web-side-section">
+			{{ doc.side_section_html }}
+		</div>
+		<div style="clear: both"></div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/product/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/product/__init__.py
diff --git a/erpnext/website/doctype/product/product.js b/erpnext/website/doctype/product/product.js
new file mode 100644
index 0000000..c0b507e
--- /dev/null
+++ b/erpnext/website/doctype/product/product.js
@@ -0,0 +1,6 @@
+$.extend(cur_frm.cscript, {
+	onload: function() {
+		cur_frm.add_fetch('item', 'description', 'short_description');
+		cur_frm.add_fetch('item', 'item_name', 'title');
+	}
+});
\ No newline at end of file
diff --git a/erpnext/website/doctype/product/product.py b/erpnext/website/doctype/product/product.py
new file mode 100644
index 0000000..5880d34
--- /dev/null
+++ b/erpnext/website/doctype/product/product.py
@@ -0,0 +1,39 @@
+import webnotes
+
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+		
+	def validate(self):
+		"""make page for this product"""
+		import website.utils
+		
+		p = website.utils.add_page("Product " + self.doc.title)
+		
+		from jinja2 import Template
+		import markdown2
+		import os
+		
+		self.doc.long_description_html = markdown2.markdown(self.doc.long_description or '')
+		
+		with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
+			p.content = Template(f.read()).render(doc=self.doc)
+		
+		with open(os.path.join(os.path.dirname(__file__), 'product_page.js'), 'r') as f:
+			p.script = Template(f.read()).render(doc=self.doc)
+		
+		p.save()
+		
+		website.utils.add_guest_access_to_page(p.name)
+		self.doc.page_name = p.name
+		del self.doc.fields['long_description_html']
+		self.make_item_group_active()
+
+
+	def make_item_group_active(self):
+		"""show item group in website"""
+		if self.doc.published:
+			from webnotes.model.doc import Document
+			ig = Document('Item Group', webnotes.conn.get_value('Item', self.doc.item, 'item_group'))
+			ig.show_in_website = 1
+			ig.save()
diff --git a/erpnext/website/doctype/product/product.txt b/erpnext/website/doctype/product/product.txt
new file mode 100644
index 0000000..6258691
--- /dev/null
+++ b/erpnext/website/doctype/product/product.txt
@@ -0,0 +1,251 @@
+# DocType, Product
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-30 16:21:29',
+		'docstatus': 0,
+		'modified': '2012-02-06 16:15:29',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': u'1327997783',
+		'allow_attach': 1,
+		'autoname': u'field:item',
+		'colour': u'White:FFF',
+		'description': u'A Product is shown on the website and is linked to an item.',
+		'doctype': 'DocType',
+		'max_attachments': 5,
+		'module': u'Website',
+		'name': '__common__',
+		'section_style': u'Simple',
+		'show_in_menu': 0,
+		'version': 11
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': u'DocField',
+		'name': '__common__',
+		'parent': u'Product',
+		'parentfield': u'fields',
+		'parenttype': u'DocType'
+	},
+
+	# These values are common for all DocPerm
+	{
+		'doctype': u'DocPerm',
+		'name': '__common__',
+		'parent': u'Product',
+		'parentfield': u'permissions',
+		'parenttype': u'DocType',
+		'read': 1,
+		'role': u'Website Manager'
+	},
+
+	# DocType, Product
+	{
+		'doctype': 'DocType',
+		'name': u'Product'
+	},
+
+	# DocPerm
+	{
+		'create': 1,
+		'doctype': u'DocPerm',
+		'permlevel': 0,
+		'write': 1
+	},
+
+	# DocPerm
+	{
+		'doctype': u'DocPerm',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'item',
+		'fieldtype': u'Link',
+		'label': u'Item',
+		'options': u'Item',
+		'permlevel': 0,
+		'reqd': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'title',
+		'fieldtype': u'Data',
+		'label': u'Title',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'published',
+		'fieldtype': u'Check',
+		'label': u'Published',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Select Price List for the web. Leave blank to hide price.',
+		'doctype': u'DocField',
+		'fieldname': u'price_list',
+		'fieldtype': u'Link',
+		'label': u'Price List',
+		'options': u'Price List',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Select shipping warehouse to show "In Stock" or "Out of Stock". To hide, leave blank',
+		'doctype': u'DocField',
+		'fieldname': u'warehouse',
+		'fieldtype': u'Link',
+		'label': u'Warehouse',
+		'options': u'Warehouse',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Column Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Image for listing (Width: 100px) (Attach First)',
+		'doctype': u'DocField',
+		'fieldname': u'thumbnail_image',
+		'fieldtype': u'Select',
+		'label': u'Thumbnail Image',
+		'options': u'attach_files:',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Image for listing (Width: 300px) (Attach First)',
+		'doctype': u'DocField',
+		'fieldname': u'full_image',
+		'fieldtype': u'Select',
+		'label': u'Full Image',
+		'options': u'attach_files:',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'short_description',
+		'fieldtype': u'Text',
+		'label': u'Short Description',
+		'permlevel': 0,
+		'reqd': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'description': u'Full description (formatted as markdown)',
+		'doctype': u'DocField',
+		'fieldname': u'long_description',
+		'fieldtype': u'Code',
+		'label': u'Long Description',
+		'permlevel': 0,
+		'reqd': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldtype': u'Section Break',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'page_name',
+		'fieldtype': u'Data',
+		'label': u'Page Name',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'price',
+		'fieldtype': u'Currency',
+		'hidden': 0,
+		'label': u'Price',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'colour': u'White:FFF',
+		'doctype': u'DocField',
+		'fieldname': u'sales',
+		'fieldtype': u'Currency',
+		'label': u'Sales',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'stock',
+		'fieldtype': u'Currency',
+		'label': u'Stock',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'currency',
+		'fieldtype': u'Link',
+		'label': u'Currency',
+		'options': u'Currency',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'file_list',
+		'fieldtype': u'Text',
+		'hidden': 1,
+		'label': u'File List',
+		'no_copy': 1,
+		'permlevel': 0,
+		'print_hide': 1
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/doctype/product/product_page.js b/erpnext/website/doctype/product/product_page.js
new file mode 100644
index 0000000..7d031ef
--- /dev/null
+++ b/erpnext/website/doctype/product/product_page.js
@@ -0,0 +1,13 @@
+wn.require('erpnext/website/js/product_category.js');
+
+pscript["onload_{{ doc.page_name }}"] = function(wrapper) {
+	erpnext.make_product_categories(wrapper);
+	$(wrapper).find('.product-inquiry').click(function() {
+		loadpage('contact', function() {
+			$('#content-contact-us [name="contact-message"]').val("Hello,\n\n\
+			Please send me more information on {{ doc.title }} (Item Code:{{ doc.item }})\n\n\
+			My contact details are:\n\nThank you!\
+			");
+		})
+	})
+}
\ No newline at end of file
diff --git a/erpnext/website/doctype/product/template.html b/erpnext/website/doctype/product/template.html
new file mode 100644
index 0000000..8c7f918
--- /dev/null
+++ b/erpnext/website/doctype/product/template.html
@@ -0,0 +1,28 @@
+<div class="layout_wrapper">
+	<div class="web-content" id="content-product-{{ doc.name }}">
+		<h1>{{ doc.title }}</h1>
+		<div class="web-main-section">
+			<div style="float: left;">
+				<image src="files/{{ doc.full_image }}" style="width: 300px; 
+					margin-left: 15px;" />
+				{{ doc.long_description_html }}
+				<button class="btn primary product-inquiry" 
+					data-product="{{ doc.name }}"
+					data-description="{{ doc.short_description }}">Send Inquiry</button>
+			</div>
+		</div>
+		<div class="web-side-section">
+			<div class="info-box round">
+				<p><b>Item Code:</b> {{ doc.item }}</p>
+				<p>{{ doc.short_description }}</p>
+				<p><button class="btn primary product-inquiry" 
+					data-product="{{ doc.name }}"
+					data-description="{{ doc.short_description }}">Send Inquiry</button>
+				</p>
+			</div>
+			<br>
+			<h4>More Categories</h4>
+		</div>
+		<div style="clear: both"></div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/product_group/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/product_group/__init__.py
diff --git a/erpnext/website/doctype/product_group/product_group.txt b/erpnext/website/doctype/product_group/product_group.txt
new file mode 100644
index 0000000..b26ec13
--- /dev/null
+++ b/erpnext/website/doctype/product_group/product_group.txt
@@ -0,0 +1,57 @@
+# DocType, Product Group
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-30 12:17:12',
+		'docstatus': 0,
+		'modified': '2012-01-30 12:17:12',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'colour': 'White:FFF',
+		'doctype': 'DocType',
+		'istable': 1,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 1
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'Product Group',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# DocType, Product Group
+	{
+		'doctype': 'DocType',
+		'name': 'Product Group'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'item_group',
+		'fieldtype': 'Link',
+		'label': 'Item Group',
+		'options': 'Item Group'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'label',
+		'fieldtype': 'Data',
+		'label': 'Label'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/products_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/products_settings/__init__.py
diff --git a/erpnext/website/doctype/products_settings/products_settings.py b/erpnext/website/doctype/products_settings/products_settings.py
new file mode 100644
index 0000000..195f37f
--- /dev/null
+++ b/erpnext/website/doctype/products_settings/products_settings.py
@@ -0,0 +1,15 @@
+import webnotes
+
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+	
+	def on_update(self):
+		tmp = None
+		for d in self.doclist:
+			if d.doctype=="Product Group":
+				import json
+				tmp = json.dumps({"item_group": d.item_group, "label":d.label})
+				break
+				
+		webnotes.conn.set_default("default_product_category", tmp)
\ No newline at end of file
diff --git a/erpnext/website/doctype/products_settings/products_settings.txt b/erpnext/website/doctype/products_settings/products_settings.txt
new file mode 100644
index 0000000..9e60f95
--- /dev/null
+++ b/erpnext/website/doctype/products_settings/products_settings.txt
@@ -0,0 +1,72 @@
+# DocType, Products Settings
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-30 12:15:00',
+		'docstatus': 0,
+		'modified': '2012-01-30 13:50:53',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': '1327906116',
+		'colour': 'White:FFF',
+		'description': 'Products are automatically updated from the item master. To add products to the website, go to the <a href="#!List/Item">Item master</a> and check "Show in Website" in the "Website Details"\n\n',
+		'doctype': 'DocType',
+		'issingle': 1,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 3
+	},
+
+	# These values are common for all DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Product Groups that are listed on the website. The first product group from this list will be listed by default on the "Products Page"',
+		'doctype': 'DocField',
+		'fieldname': 'groups',
+		'fieldtype': 'Table',
+		'label': 'Groups',
+		'name': '__common__',
+		'options': 'Product Group',
+		'parent': 'Products Settings',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# These values are common for all DocPerm
+	{
+		'create': 1,
+		'doctype': 'DocPerm',
+		'name': '__common__',
+		'parent': 'Products Settings',
+		'parentfield': 'permissions',
+		'parenttype': 'DocType',
+		'permlevel': 0,
+		'read': 1,
+		'role': 'Website Manager',
+		'write': 1
+	},
+
+	# DocType, Products Settings
+	{
+		'doctype': 'DocType',
+		'name': 'Products Settings'
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/related_page/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/related_page/__init__.py
diff --git a/erpnext/website/doctype/related_page/related_page.txt b/erpnext/website/doctype/related_page/related_page.txt
new file mode 100644
index 0000000..67a30b7
--- /dev/null
+++ b/erpnext/website/doctype/related_page/related_page.txt
@@ -0,0 +1,49 @@
+# DocType, Related Page
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-02-01 16:16:47',
+		'docstatus': 0,
+		'modified': '2012-02-06 12:24:29',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'colour': u'White:FFF',
+		'doctype': 'DocType',
+		'istable': 1,
+		'module': u'Website',
+		'name': '__common__',
+		'section_style': u'Simple',
+		'show_in_menu': 0,
+		'version': 3
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'page',
+		'fieldtype': u'Link',
+		'label': u'Page',
+		'name': '__common__',
+		'options': u'Page',
+		'parent': u'Related Page',
+		'parentfield': u'fields',
+		'parenttype': u'DocType',
+		'permlevel': 0
+	},
+
+	# DocType, Related Page
+	{
+		'doctype': 'DocType',
+		'name': u'Related Page'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/style_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/style_settings/__init__.py
diff --git a/erpnext/website/doctype/style_settings/custom_template.css b/erpnext/website/doctype/style_settings/custom_template.css
new file mode 100644
index 0000000..e6eeeb3
--- /dev/null
+++ b/erpnext/website/doctype/style_settings/custom_template.css
@@ -0,0 +1,31 @@
+body {
+{% if doc.background_image %}
+	background: url("files/{{ doc.background_image }}") repeat !important;
+{% elif doc.background_color %}
+	background-color: #{{ doc.background_color }};
+{% endif %}	
+{% if doc.font %}
+	font-family: {{ doc.font }} !important;
+{% endif %}
+{% if doc.font_size %}
+	font-size: {{ doc.font_size }} !important;
+{% endif %}
+}
+
+{% if doc.footer_font_color %}
+footer {
+	color: {{ doc.footer_font_color }};
+}
+footer a, footer a:visited, footer a:hover {
+	color: {{ doc.footer_font_color }};
+}
+.web-footer-menu ul li {
+	border-right: 1px solid {{ doc.footer_font_color }};
+}
+{% endif %}
+
+{% if doc.heading_font %}
+h1, h2, h3, h4, h5 {
+	font-family: {{ doc.heading_font}} !important;
+}	
+{% endif %}
diff --git a/erpnext/website/doctype/style_settings/style_settings.js b/erpnext/website/doctype/style_settings/style_settings.js
new file mode 100644
index 0000000..95c4143
--- /dev/null
+++ b/erpnext/website/doctype/style_settings/style_settings.js
@@ -0,0 +1,6 @@
+wn.require('lib/js/lib/jscolor/jscolor.js');
+
+cur_frm.cscript.onload_post_render = function() {
+	cur_frm.fields_dict.background_color.input.className = 'color';
+	jscolor.bind();
+}
\ No newline at end of file
diff --git a/erpnext/website/doctype/style_settings/style_settings.py b/erpnext/website/doctype/style_settings/style_settings.py
new file mode 100644
index 0000000..4aefbf6
--- /dev/null
+++ b/erpnext/website/doctype/style_settings/style_settings.py
@@ -0,0 +1,17 @@
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+		
+	def validate(self):
+		"""make custom css"""
+		from jinja2 import Template
+		
+		with open('erpnext/website/doctype/style_settings/custom_template.css', 'r') as f:
+			temp = Template(f.read())
+		
+		self.doc.custom_css = temp.render(doc = self.doc)
+		
+		from webnotes.session_cache import clear_cache
+		clear_cache('Guest')
+		
+		
\ No newline at end of file
diff --git a/erpnext/website/doctype/style_settings/style_settings.txt b/erpnext/website/doctype/style_settings/style_settings.txt
new file mode 100644
index 0000000..f07a947
--- /dev/null
+++ b/erpnext/website/doctype/style_settings/style_settings.txt
@@ -0,0 +1,156 @@
+# DocType, Style Settings
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-02-02 09:57:25',
+		'docstatus': 0,
+		'modified': '2012-02-02 10:47:38',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': '1328159294',
+		'allow_attach': 1,
+		'colour': 'White:FFF',
+		'description': 'Set your background color, font and image (tiled)',
+		'doctype': 'DocType',
+		'issingle': 1,
+		'max_attachments': 1,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 9
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'Style Settings',
+		'parentfield': 'fields',
+		'parenttype': 'DocType'
+	},
+
+	# These values are common for all DocPerm
+	{
+		'doctype': 'DocPerm',
+		'name': '__common__',
+		'parent': 'Style Settings',
+		'parentfield': 'permissions',
+		'parenttype': 'DocType',
+		'read': 1,
+		'role': 'Website Manager'
+	},
+
+	# DocType, Style Settings
+	{
+		'doctype': 'DocType',
+		'name': 'Style Settings'
+	},
+
+	# DocPerm
+	{
+		'create': 1,
+		'doctype': 'DocPerm',
+		'permlevel': 0,
+		'write': 1
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Solid background color (default light gray)',
+		'doctype': 'DocField',
+		'fieldname': 'background_color',
+		'fieldtype': 'Data',
+		'label': 'Background Color',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'If image is selected, color will be ignored (attach first)',
+		'doctype': 'DocField',
+		'fieldname': 'background_image',
+		'fieldtype': 'Select',
+		'label': 'Background Image',
+		'options': 'attach_files:',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'font',
+		'fieldtype': 'Select',
+		'label': 'Font',
+		'options': '\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'font_size',
+		'fieldtype': 'Select',
+		'label': 'Font Size',
+		'options': '\n12px\n13px\n14px',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'heading_font',
+		'fieldtype': 'Select',
+		'label': 'Heaing Font',
+		'options': '\nLucida Grande\nVerdana\nArial\nGeorgia\nTahoma',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Select a white footer foreground color if you have a dark background',
+		'doctype': 'DocField',
+		'fieldname': 'footer_font_color',
+		'fieldtype': 'Select',
+		'label': 'Footer Font Color',
+		'options': '\nwhite',
+		'permlevel': 0
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Auto generated',
+		'doctype': 'DocField',
+		'fieldname': 'custom_css',
+		'fieldtype': 'Code',
+		'label': 'Custom CSS',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'file_list',
+		'fieldtype': 'Text',
+		'hidden': 1,
+		'label': 'File List',
+		'no_copy': 1,
+		'permlevel': 0,
+		'print_hide': 1
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/top_bar_item/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/top_bar_item/__init__.py
diff --git a/erpnext/website/doctype/top_bar_item/top_bar_item.txt b/erpnext/website/doctype/top_bar_item/top_bar_item.txt
new file mode 100644
index 0000000..3ff23b3
--- /dev/null
+++ b/erpnext/website/doctype/top_bar_item/top_bar_item.txt
@@ -0,0 +1,73 @@
+# DocType, Top Bar Item
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-24 10:24:19',
+		'docstatus': 0,
+		'modified': '2012-02-07 10:35:19',
+		'modified_by': u'Administrator',
+		'owner': u'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'colour': u'White:FFF',
+		'doctype': 'DocType',
+		'istable': 1,
+		'module': u'Website',
+		'name': '__common__',
+		'section_style': u'Simple',
+		'show_in_menu': 0,
+		'version': 4
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': u'DocField',
+		'name': '__common__',
+		'parent': u'Top Bar Item',
+		'parentfield': u'fields',
+		'parenttype': u'DocType',
+		'permlevel': 0
+	},
+
+	# DocType, Top Bar Item
+	{
+		'doctype': 'DocType',
+		'name': u'Top Bar Item'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'label',
+		'fieldtype': u'Data',
+		'label': u'Label'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'custom_page',
+		'fieldtype': u'Link',
+		'label': u'Page',
+		'options': u'Page'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'url',
+		'fieldtype': u'Data',
+		'label': u'URL'
+	},
+
+	# DocField
+	{
+		'doctype': u'DocField',
+		'fieldname': u'parent_label',
+		'fieldtype': u'Select',
+		'label': u'Parent Label'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/web_page/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/web_page/__init__.py
diff --git a/erpnext/website/doctype/web_page/template.html b/erpnext/website/doctype/web_page/template.html
new file mode 100644
index 0000000..faacca1
--- /dev/null
+++ b/erpnext/website/doctype/web_page/template.html
@@ -0,0 +1,24 @@
+<div class="layout_wrapper">
+	<div class="web-content" id="content-{{ doc.name }}">
+		{% if doc.head_section %}
+		<div class="web-head-section">
+			{{ doc.head_section_html }}
+		</div>
+		{% endif %}
+		<div class="web-main-section">
+			{{ doc.main_section_html }}
+			{% if doc.next_page_html %}
+				{{ doc.next_page_html }}
+			{% endif %}
+		</div>
+		<div class="web-side-section">
+			{{ doc.side_section_html }}
+			{% if doc.see_also %}
+				<h4>See Also</h4>
+				{{ doc.see_also }}
+			{% endif %}
+		</div>
+		<div style="clear: both">
+		</div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/website/doctype/web_page/web_page.py b/erpnext/website/doctype/web_page/web_page.py
new file mode 100644
index 0000000..8f7c38f
--- /dev/null
+++ b/erpnext/website/doctype/web_page/web_page.py
@@ -0,0 +1,55 @@
+import webnotes
+import website.utils
+
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+	
+	def autoname(self):
+		"""name from title"""
+		self.doc.name = website.utils.page_name(self.doc.title)
+
+	def validate(self):
+		"""make page for this product"""					
+		p = website.utils.add_page(self.doc.title)
+		
+		from jinja2 import Template
+		import os
+	
+		website.utils.markdown(self.doc, ['head_section','main_section', 'side_section'])
+		
+		self.add_page_links()
+		
+		with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
+			p.content = Template(f.read()).render(doc=self.doc)
+
+		p.save()
+		
+		website.utils.add_guest_access_to_page(p.name)
+		self.cleanup_temp()
+			
+	def add_page_links(self):
+		"""add links for next_page and see_also"""
+		if self.doc.next_page:
+			self.doc.next_page_html = """<div class="info-box round">
+			<p style="text-align: right"><b>Next:</b>
+				<a href="#!%(name)s">%(title)s</a></p></div>""" % {"name":self.doc.next_page, \
+						"title": webnotes.conn.get_value("Page", self.doc.next_page, "title")}
+
+		self.doc.see_also = ''
+		for d in self.doclist:
+			if d.doctype=='Related Page':
+				tmp = {"page":d.page, "title":webnotes.conn.get_value('Page', d.page, 'title')}
+				self.doc.see_also += """<li><a href="#!%(page)s">%(title)s</a></li>""" % tmp
+		
+		if self.doc.see_also:
+			self.doc.see_also = '<ul>%s</ul>' % self.doc.see_also
+		
+	def cleanup_temp(self):
+		"""cleanup temp fields"""
+		fl = ['main_section_html', 'side_section_html', 'see_also', \
+			'next_page_html', 'head_section_html']
+		for f in fl:
+			if f in self.doc.fields:
+				del self.doc.fields[f]
+	
\ No newline at end of file
diff --git a/erpnext/website/doctype/web_page/web_page.txt b/erpnext/website/doctype/web_page/web_page.txt
new file mode 100644
index 0000000..0bacc43
--- /dev/null
+++ b/erpnext/website/doctype/web_page/web_page.txt
@@ -0,0 +1,142 @@
+# DocType, Web Page
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-31 15:18:49',
+		'docstatus': 0,
+		'modified': '2012-02-02 13:15:36',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': '1328093379',
+		'allow_attach': 1,
+		'colour': 'White:FFF',
+		'description': 'A custom page is a simple page with the layout - headline, main section, side section\n\nEditing:\n\n- Editing is in [markdown format](http://daringfireball.net/projects/markdown/syntax)\n- You can also add images and embed html code\n\nAccessing the page:\n\n- The page can be accessed as #![page-name] after the main url\n\nIdeal for pages like FAQ, Terms, Help etc.\n\n',
+		'doctype': 'DocType',
+		'max_attachments': 5,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 6
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'Web Page',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# These values are common for all DocPerm
+	{
+		'doctype': 'DocPerm',
+		'name': '__common__',
+		'parent': 'Web Page',
+		'parentfield': 'permissions',
+		'parenttype': 'DocType',
+		'read': 1,
+		'role': 'Website Manager'
+	},
+
+	# DocType, Web Page
+	{
+		'doctype': 'DocType',
+		'name': 'Web Page'
+	},
+
+	# DocPerm
+	{
+		'create': 1,
+		'doctype': 'DocPerm',
+		'permlevel': 0,
+		'write': 1
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'permlevel': 1
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Title / headline of your page',
+		'doctype': 'DocField',
+		'fieldname': 'title',
+		'fieldtype': 'Data',
+		'label': 'Title',
+		'reqd': 1
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Section that will span 2 columns, formatted as markdown. If no head, leave blank. If you are displaying a banner, it must be 860px',
+		'doctype': 'DocField',
+		'fieldname': 'head_section',
+		'fieldtype': 'Text',
+		'label': 'Head Section'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Content in markdown format that appears on the main side of your page',
+		'doctype': 'DocField',
+		'fieldname': 'main_section',
+		'fieldtype': 'Code',
+		'label': 'Main Section'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Content in markdown format that appears on the right side',
+		'doctype': 'DocField',
+		'fieldname': 'side_section',
+		'fieldtype': 'Code',
+		'label': 'Side Section'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Link for next page appears at the bottom of the page',
+		'doctype': 'DocField',
+		'fieldname': 'next_page',
+		'fieldtype': 'Link',
+		'label': 'Next Page',
+		'options': 'Page'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Related pages appear on the right side of the link and are linked both ways.',
+		'doctype': 'DocField',
+		'fieldname': 'related_pages',
+		'fieldtype': 'Table',
+		'label': 'Related Pages',
+		'options': 'Related Page'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'file_list',
+		'fieldtype': 'Text',
+		'hidden': 1,
+		'label': 'File List',
+		'no_copy': 1,
+		'print_hide': 1
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/doctype/website_settings/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/doctype/website_settings/__init__.py
diff --git a/erpnext/website/doctype/website_settings/website_settings.py b/erpnext/website/doctype/website_settings/website_settings.py
new file mode 100644
index 0000000..0cbc97d
--- /dev/null
+++ b/erpnext/website/doctype/website_settings/website_settings.py
@@ -0,0 +1,20 @@
+class DocType:
+	def __init__(self, d, dl):
+		self.doc, self.doclist = d, dl
+		
+	def validate(self):
+		"""clear cache"""
+		# set home page
+		import webnotes
+		from webnotes.model.doc import Document
+		
+		webnotes.conn.sql("""delete from `tabDefault Home Page` where role='Guest'""")
+		
+		d = Document('Default Home Page')
+		d.parent = 'Control Panel'
+		d.role = 'Guest'
+		d.home_page = self.doc.home_page
+		d.save()
+		
+		from webnotes.session_cache import clear_cache
+		clear_cache('Guest')
\ No newline at end of file
diff --git a/erpnext/website/doctype/website_settings/website_settings.txt b/erpnext/website/doctype/website_settings/website_settings.txt
new file mode 100644
index 0000000..aaa7327
--- /dev/null
+++ b/erpnext/website/doctype/website_settings/website_settings.txt
@@ -0,0 +1,160 @@
+# DocType, Website Settings
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-02-02 13:19:50',
+		'docstatus': 0,
+		'modified': '2012-02-02 13:31:24',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all DocType
+	{
+		'_last_update': '1328169455',
+		'allow_attach': 1,
+		'colour': 'White:FFF',
+		'doctype': 'DocType',
+		'document_type': 'Other',
+		'issingle': 1,
+		'max_attachments': 1,
+		'module': 'Website',
+		'name': '__common__',
+		'section_style': 'Simple',
+		'show_in_menu': 0,
+		'version': 3
+	},
+
+	# These values are common for all DocField
+	{
+		'doctype': 'DocField',
+		'name': '__common__',
+		'parent': 'Website Settings',
+		'parentfield': 'fields',
+		'parenttype': 'DocType',
+		'permlevel': 0
+	},
+
+	# These values are common for all DocPerm
+	{
+		'create': 1,
+		'doctype': 'DocPerm',
+		'name': '__common__',
+		'parent': 'Website Settings',
+		'parentfield': 'permissions',
+		'parenttype': 'DocType',
+		'permlevel': 0,
+		'read': 1,
+		'write': 1
+	},
+
+	# DocType, Website Settings
+	{
+		'doctype': 'DocType',
+		'name': 'Website Settings'
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'role': 'System Manager'
+	},
+
+	# DocPerm
+	{
+		'doctype': 'DocPerm',
+		'role': 'Website Manager'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldtype': 'Section Break',
+		'label': 'Top Bar'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'The name of your company / website as you want to appear on browser title bar. All pages will have this as the prefix to the title.',
+		'doctype': 'DocField',
+		'fieldname': 'title_prefix',
+		'fieldtype': 'Data',
+		'label': 'Title Prefix'
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'The "Web Page" that is the website home page',
+		'doctype': 'DocField',
+		'fieldname': 'home_page',
+		'fieldtype': 'Link',
+		'label': 'Home Page',
+		'options': 'Web Page',
+		'reqd': 1
+	},
+
+	# DocField
+	{
+		'colour': 'White:FFF',
+		'description': 'Brand is what appears on the top-right of the toolbar. If it is an image, make sure it\nhas a transparent background and use the &lt;img /&gt; tag',
+		'doctype': 'DocField',
+		'fieldname': 'brand_html',
+		'fieldtype': 'Text',
+		'label': 'Brand HTML'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'top_bar_items',
+		'fieldtype': 'Table',
+		'label': 'Top Bar Items',
+		'options': 'Top Bar Item'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldtype': 'Section Break',
+		'label': 'Footer'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'address',
+		'fieldtype': 'Text',
+		'label': 'Address'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'copyright',
+		'fieldtype': 'Data',
+		'label': 'Copyright'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'footer_items',
+		'fieldtype': 'Table',
+		'label': 'Footer Items',
+		'options': 'Top Bar Item'
+	},
+
+	# DocField
+	{
+		'doctype': 'DocField',
+		'fieldname': 'file_list',
+		'fieldtype': 'Text',
+		'hidden': 1,
+		'label': 'File List',
+		'no_copy': 1,
+		'print_hide': 1
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/js/product_category.js b/erpnext/website/js/product_category.js
new file mode 100644
index 0000000..5296029
--- /dev/null
+++ b/erpnext/website/js/product_category.js
@@ -0,0 +1,23 @@
+// make sidelisting of categories
+erpnext.product_item_group = {}
+
+erpnext.make_product_categories = function(wrapper) {
+	wrapper.category_list = new wn.widgets.Listing({
+		parent: $(wrapper).find('.web-side-section').get(0),
+		query: 'select label, count(t2.name) as items, t1.item_group \
+			from `tabProduct Group` t1, `tabProduct` t2, tabItem t3\
+			where t1.parent="Products Settings" \
+			and t2.item = t3.name \
+			and t3.item_group = t1.item_group \
+			and ifnull(t2.published, 0)=1 \
+			group by t1.item_group \
+			order by t1.idx',
+		hide_refresh: true,
+		render_row: function(parent, data) {
+			parent.innerHTML = repl('<a href="#!products/%(label)s">%(label)s</a> (%(items)s)', 
+				data);
+			erpnext.product_item_group[data.label] = data.item_group;
+		}
+	});
+	wrapper.category_list.run();	
+}
diff --git a/erpnext/website/js/topbar.js b/erpnext/website/js/topbar.js
new file mode 100644
index 0000000..cffc825
--- /dev/null
+++ b/erpnext/website/js/topbar.js
@@ -0,0 +1,75 @@
+wn.provide('erpnext.topbar');
+wn.require('lib/css/bootstrap/bootstrap-topbar.css');
+wn.require('lib/js/bootstrap/bootstrap-dropdown.js');
+
+/*
+<li class="dropdown">\
+	<a class="dropdown-toggle" href="#" onclick="return false;"></a>\
+	<ul class="dropdown-menu" id="toolbar-user">\
+	</ul>\
+</li>\
+*/
+
+erpnext.topbar.TopBar = Class.extend({
+	init: function() {
+		this.make();
+		$('.brand').html(wn.boot.website_settings.brand_html);
+		this.make_items();
+	},
+	make: function() {
+		$('header').append('<div class="topbar">\
+			<div class="topbar-inner">\
+			<div class="container">\
+				<a class="brand">[brand]</a>\
+				<ul class="nav">\
+				</ul>\
+				<img src="lib/images/ui/spinner.gif" id="spinner"/>\
+				<ul class="nav secondary-nav">\
+					<li><a href="#!Login Page">Login</a></li>\
+				</ul>\
+			</div>\
+			</div>\
+			</div>');
+		$('.brand').attr('href', '#!' + (wn.boot.website_settings.home_page || 'Login Page'))
+	},
+	make_items: function() {
+		var items = wn.boot.website_menus
+		for(var i=0;i<items.length;i++) {
+			var item = items[i];
+			if(!item.parent_label && item.parentfield=='top_bar_items') {
+				item.route = item.url || item.custom_page;
+				$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
+					data-label="%(label)s">%(label)s</a></li>', item))
+			}
+		}
+	}
+});
+
+erpnext.topbar.topbar = new erpnext.topbar.TopBar();
+
+// footer
+erpnext.Footer = Class.extend({
+	init: function() {
+		$('footer').html(repl('<div class="web-footer">\
+			<div class="web-footer-menu"><ul></ul></div>\
+			<div class="web-footer-address">%(address)s</div>\
+			<div class="web-footer-copyright">&copy; %(copyright)s</div>\
+			<div class="web-footer-powered">Powered by \
+				<a href="https://erpnext.com">erpnext.com</a></div>\
+		</div>', wn.boot.website_settings));
+		this.make_items();
+	},
+	make_items: function() {
+		var items = wn.boot.website_menus
+		for(var i=0;i<items.length;i++) {
+			var item = items[i];
+			if(!item.parent_label && item.parentfield=='footer_items') {
+				item.route = item.url || item.custom_page;
+				$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
+					data-label="%(label)s">%(label)s</a></li>', item))
+			}
+		}
+	}
+});
+
+erpnext.footer = new erpnext.Footer();
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/__init__.py
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/about/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/about/__init__.py
diff --git a/erpnext/website/page/about/about.txt b/erpnext/website/page/about/about.txt
new file mode 100644
index 0000000..a106513
--- /dev/null
+++ b/erpnext/website/page/about/about.txt
@@ -0,0 +1,43 @@
+# Page, about
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 11:37:57',
+		'docstatus': 0,
+		'modified': '2012-01-27 13:26:42',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Page
+	{
+		'doctype': 'Page',
+		'module': 'Website',
+		'name': '__common__',
+		'page_name': 'about',
+		'standard': 'Yes',
+		'title': 'About Us'
+	},
+
+	# These values are common for all Page Role
+	{
+		'doctype': 'Page Role',
+		'name': '__common__',
+		'parent': 'about',
+		'parentfield': 'roles',
+		'parenttype': 'Page',
+		'role': 'Guest'
+	},
+
+	# Page, about
+	{
+		'doctype': 'Page',
+		'name': 'about'
+	},
+
+	# Page Role
+	{
+		'doctype': 'Page Role'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/blog/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/blog/__init__.py
diff --git a/erpnext/website/page/blog/blog.html b/erpnext/website/page/blog/blog.html
new file mode 100644
index 0000000..79ea7f0
--- /dev/null
+++ b/erpnext/website/page/blog/blog.html
@@ -0,0 +1,22 @@
+<div class="layout_wrapper">
+	<div class="web-content" id="content-blog">
+		<h1>Blog</h1>
+		<br>
+		<div class="web-main-section">
+		</div>
+		<div class="web-side-section">
+			<!-- for later
+			<h4>Get Updates</h4>
+			<p>
+			<input name="blog-subscribe">
+			<button class="btn" id="blog-subscribe">Subscribe</button>
+			</p>-->
+			<h4>Subscribe</h4>
+			<p>
+			<img src="images/feed.png" style="margin-right: 4px; margin-bottom: -4px">
+			<a href="rss.xml" target="_blank">RSS Feed</a>
+			</p>
+		</div>
+		<div style="clear: both"></div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/website/page/blog/blog.js b/erpnext/website/page/blog/blog.js
new file mode 100644
index 0000000..6be1d07
--- /dev/null
+++ b/erpnext/website/page/blog/blog.js
@@ -0,0 +1,38 @@
+
+pscript.onload_blog = function(wrapper) {
+	wrapper.blog_list = new wn.widgets.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 \
+			from tabProfile, tabBlog\
+		 	where ifnull(published,1)=1 and tabBlog.owner = tabProfile.name',
+		hide_refresh: true,
+		render_row: function(parent, data) {
+			if(data.content.length==300) data.content += '...';
+			data.date = prettyDate(data.modified);
+			parent.innerHTML = repl('<h4><a href="#!%(name)s">%(title)s</a></h4>\
+				<div class="help">By %(first_name)s %(last_name)s on %(date)s</div>\
+				<p><div class="comment">%(content)s</div></p><br>', data);
+		},
+		page_length: 10
+	});
+	wrapper.blog_list.run();
+	
+	// subscribe button
+	$('#blog-subscribe').click(function() {
+		var email = $(wrapper).find('input[name="blog-subscribe"]').val();
+		if(!validate_email(email)) {
+			msgprint('Please enter a valid email!');
+		}
+		wn.call({
+			module:'website',
+			page:'blog',
+			method:'subscribe',
+			args:email,
+			btn: this,
+			callback: function() {
+				$(wrapper).find('input[name="blog-subscribe"]').val('');
+			}
+		});		
+	})
+}
\ No newline at end of file
diff --git a/erpnext/website/page/blog/blog.py b/erpnext/website/page/blog/blog.py
new file mode 100644
index 0000000..6e7a62e
--- /dev/null
+++ b/erpnext/website/page/blog/blog.py
@@ -0,0 +1,11 @@
+import webnotes
+def subscribe(arg):
+	"""subscribe to blog (blog_subscriber)"""
+	if webnotes.conn.sql("""select name from `tabBlog Subscriber` where name=%s""", arg):
+		webnotes.msgprint("Already a subscriber. Thanks!")
+	else:
+		from webnotes.model.doc import Document
+		d = Document('Blog Subscriber')
+		d.name = arg
+		d.save()
+		webnotes.msgprint("Thank you for subscribing!")
\ No newline at end of file
diff --git a/erpnext/website/page/blog/blog.txt b/erpnext/website/page/blog/blog.txt
new file mode 100644
index 0000000..4443ec8
--- /dev/null
+++ b/erpnext/website/page/blog/blog.txt
@@ -0,0 +1,44 @@
+# Page, blog
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 15:47:52',
+		'docstatus': 0,
+		'modified': '2012-01-27 15:47:52',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Page
+	{
+		'doctype': 'Page',
+		'module': 'Website',
+		'name': '__common__',
+		'page_name': 'blog',
+		'standard': 'Yes',
+		'title': 'Blog'
+	},
+
+	# These values are common for all Page Role
+	{
+		'__islocal': 1,
+		'doctype': 'Page Role',
+		'name': '__common__',
+		'parent': 'blog',
+		'parentfield': 'roles',
+		'parenttype': 'Page',
+		'role': 'Guest'
+	},
+
+	# Page, blog
+	{
+		'doctype': 'Page',
+		'name': 'blog'
+	},
+
+	# Page Role
+	{
+		'doctype': 'Page Role'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/contact/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/contact/__init__.py
diff --git a/erpnext/website/page/contact/contact.js b/erpnext/website/page/contact/contact.js
new file mode 100644
index 0000000..e05023b
--- /dev/null
+++ b/erpnext/website/page/contact/contact.js
@@ -0,0 +1,30 @@
+pscript.onload_contact = function(wrapper) {
+	$('#content-contact-us .btn.primary').click(function() {
+		var me = this;
+		var args = {};
+		args.name = $('#content-contact-us [name="contact-name"]').val();
+		args.email = $('#content-contact-us [name="contact-email"]').val();
+		args.message = $('#content-contact-us [name="contact-message"]').val();
+		
+		if(!validate_email(args.email)) {
+			msgprint('Please enter a valid email id');
+			return;
+		}
+		
+		if(args.name && args.email && args.message) {
+			$(this).set_working();
+			$c_page('website', 'contact', 'send', args, function(r) {
+				$('#content-contact-us [name*="contact"]').val('');
+				$(me).done_working();
+			});
+		} else {
+			msgprint("Please enter info in all the fields.")
+		}
+	});
+	
+	$('#content-contact-us :input').keyup(function(ev) {
+		if(ev.which == 13) {
+			$('#content-contact-us .btn.primary').click();
+		}
+	});
+}
\ No newline at end of file
diff --git a/erpnext/website/page/contact/contact.py b/erpnext/website/page/contact/contact.py
new file mode 100644
index 0000000..a6566a9
--- /dev/null
+++ b/erpnext/website/page/contact/contact.py
@@ -0,0 +1,15 @@
+import json, webnotes
+
+def send(args):
+	"""create support ticket"""
+	args = json.loads(args)
+	
+	from webnotes.model.doc import Document
+	d = Document('Support Ticket')
+	d.raised_by = args['email']
+	d.description = 'From: ' + args['name'] + '\n\n' + args['message']
+	d.subject = 'Website Query'
+	d.status = 'Open'
+	d.owner = 'Guest'
+	d.save(1)
+	webnotes.msgprint("Thank you for your query. We will respond as soon as we can.")
\ No newline at end of file
diff --git a/erpnext/website/page/contact/contact.txt b/erpnext/website/page/contact/contact.txt
new file mode 100644
index 0000000..6051c6f
--- /dev/null
+++ b/erpnext/website/page/contact/contact.txt
@@ -0,0 +1,42 @@
+# Page, contact
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-25 16:02:15',
+		'docstatus': 0,
+		'modified': '2012-01-25 16:02:15',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Page
+	{
+		'doctype': 'Page',
+		'module': 'Website',
+		'name': '__common__',
+		'page_name': 'contact',
+		'standard': 'Yes'
+	},
+
+	# These values are common for all Page Role
+	{
+		'doctype': 'Page Role',
+		'name': '__common__',
+		'parent': 'contact',
+		'parentfield': 'roles',
+		'parenttype': 'Page',
+		'role': 'Guest'
+	},
+
+	# Page, contact
+	{
+		'doctype': 'Page',
+		'name': 'contact'
+	},
+
+	# Page Role
+	{
+		'doctype': 'Page Role'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/page/products/README.md b/erpnext/website/page/products/README.md
new file mode 100644
index 0000000..e40b446
--- /dev/null
+++ b/erpnext/website/page/products/README.md
@@ -0,0 +1,27 @@
+## Products
+
+Contains
+
+- List of Products tagged by Item master
+	- image
+	- short description (md)
+	- pricing info (if public) (public pricelist)
+	- stock info (website warehouse)
+- Search
+- Sidebar contains categories (# of items in each category)
+
+When Item is Saved, a page for that item is created with
+
+- Large image
+- Smaller images
+- Long Description
+- Pricing info
+- Stock info
+- Contact Button (instead of Buy / Add to cart)
+
+### Steps
+
+- update item master
+- update item category (show in web + priority) (or in a products settings page)
+- # of public items in each category
+- validation - item cannot have show in item if parent does not have it
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/products/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/products/__init__.py
diff --git a/erpnext/website/page/products/products.html b/erpnext/website/page/products/products.html
new file mode 100644
index 0000000..d12004e
--- /dev/null
+++ b/erpnext/website/page/products/products.html
@@ -0,0 +1,12 @@
+<div class="layout_wrapper" id="content-products">
+	<div class="web-main-section">
+		<h1 class="products-category"></h1>
+		<div class="products-search">
+			<input name="products-search" /><button class="btn" style="margin-left: 7px">Search</button>
+		</div>
+	</div>
+	<div class="web-side-section">
+		<h3>Categories</h3>
+	</div>
+	<div style="clear:both;">
+</div>
\ No newline at end of file
diff --git a/erpnext/website/page/products/products.js b/erpnext/website/page/products/products.js
new file mode 100644
index 0000000..6284d18
--- /dev/null
+++ b/erpnext/website/page/products/products.js
@@ -0,0 +1,88 @@
+erpnext.products = {}
+
+wn.require('erpnext/website/js/product_category.js');
+
+pscript.onload_products = function(wrapper) {
+	sys_defaults.default_product_category = JSON.parse(sys_defaults.default_product_category);
+	erpnext.products.wrapper = wrapper;	
+
+	// make lists
+	erpnext.make_product_categories(wrapper);
+	erpnext.products.make_product_list(wrapper);
+	
+	// button
+	$(wrapper).find('.products-search .btn').click(function() {
+		wrapper.mainlist.run();
+	});
+	
+	$(wrapper).find('.products-search input').keypress(function(ev) {
+		if(ev.which==13) $(wrapper).find('.products-search .btn').click();
+	});
+}
+
+pscript.onshow_products = function(wrapper) {
+	// show default product category
+	erpnext.products.set_group();
+}
+
+erpnext.products.get_group = function() {
+	var route = window.location.hash.split('/');
+	if(route.length>1) {
+		// from url
+		var grp = erpnext.product_item_group[route[1]];
+		var label = route[1];
+	} else {
+		// default
+		var grp = sys_defaults.default_product_category.item_group;
+		var label = sys_defaults.default_product_category.label;
+	}
+	erpnext.products.cur_group = grp;
+	return {grp:grp, label:label};
+}
+
+erpnext.products.make_product_list = function(wrapper) {
+	wrapper.mainlist = new wn.widgets.Listing({
+		parent: $(wrapper).find('.web-main-section').get(0),
+		run_btn: $(wrapper).find('.products-search .btn').get(0),
+		hide_refresh: true,
+		get_query: function() {
+			var srch = $('input[name="products-search"]').val()
+			var search_cond = 'and (t1.short_description like "%%(srch)s%"\
+				or t1.title like "%%(srch)s%")';
+			args = {
+				search_cond: srch ? repl(search_cond, {srch:srch}) : '',
+				cat: erpnext.products.cur_group
+			};
+			return repl('select t1.name, t1.title, t1.thumbnail_image, \
+				t1.page_name, t1.short_description \
+				from tabProduct t1, tabItem t2 \
+				where t1.item = t2.name \
+				and ifnull(t1.published,0)=1 \
+				and t2.item_group="%(cat)s" \
+				%(search_cond)s', args)
+		},
+		render_row: function(parent, data) {
+			parent.innerHTML = repl('<div style="float:left; width: 115px;">\
+				<img src="files/%(thumbnail_image)s" style="width:100px;"></div>\
+				<div style="float:left; width: 400px">\
+					<b><a href="#!%(page_name)s">%(title)s</a></b>\
+					<p>%(short_description)s</p></div>\
+				<div style="clear: both; margin-bottom: 15px; border-bottom: 1px solid #AAA"></div>', data);
+		}
+	});
+	
+}
+
+erpnext.products.set_group = function() {
+	var cat = erpnext.products.get_group();
+	if(!cat.grp) {
+		// still nothing
+		setTimeout('erpnext.products.set_group()', 1000);
+		return;		
+	}
+	// get erpnext.products.default_category
+	var wrapper = erpnext.products.wrapper;
+	
+	$(wrapper).find('h1').html(cat.label);
+	wrapper.mainlist.run();
+}
diff --git a/erpnext/website/page/products/products.txt b/erpnext/website/page/products/products.txt
new file mode 100644
index 0000000..f00a05b
--- /dev/null
+++ b/erpnext/website/page/products/products.txt
@@ -0,0 +1,43 @@
+# Page, products
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-30 10:49:01',
+		'docstatus': 0,
+		'modified': '2012-01-30 10:49:01',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Page
+	{
+		'doctype': 'Page',
+		'module': 'Website',
+		'name': '__common__',
+		'page_name': 'products',
+		'standard': 'Yes',
+		'title': 'Products'
+	},
+
+	# These values are common for all Page Role
+	{
+		'doctype': 'Page Role',
+		'name': '__common__',
+		'parent': 'products',
+		'parentfield': 'roles',
+		'parenttype': 'Page',
+		'role': 'Guest'
+	},
+
+	# Page, products
+	{
+		'doctype': 'Page',
+		'name': 'products'
+	},
+
+	# Page Role
+	{
+		'doctype': 'Page Role'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sso_control/__init__.py b/erpnext/website/page/unsubscribe/__init__.py
similarity index 100%
copy from erpnext/utilities/doctype/sso_control/__init__.py
copy to erpnext/website/page/unsubscribe/__init__.py
diff --git a/erpnext/website/page/unsubscribe/unsubscribe.html b/erpnext/website/page/unsubscribe/unsubscribe.html
new file mode 100644
index 0000000..7b2b68e
--- /dev/null
+++ b/erpnext/website/page/unsubscribe/unsubscribe.html
@@ -0,0 +1,13 @@
+<div class="layout_wrapper">
+	<div class="web-content">
+		<h1>Unsubscribe</h1>
+		<br>
+		<div class="web-main-section">
+			<input name="unsubscribe">
+			<button class="btn" id="btn-unsubscribe">Unsubscribe</button>
+		</div>
+		<div class="web-side-section">
+		</div>
+		<div style="clear: both"></div>
+	</div>
+</div>
\ No newline at end of file
diff --git a/erpnext/website/page/unsubscribe/unsubscribe.js b/erpnext/website/page/unsubscribe/unsubscribe.js
new file mode 100644
index 0000000..7cbed37
--- /dev/null
+++ b/erpnext/website/page/unsubscribe/unsubscribe.js
@@ -0,0 +1,21 @@
+pscript.onload_unsubscribe = function(wrapper) {
+	var email = window.location.hash.split('/').splice(-1);
+	$(wrapper).find('input[name="unsubscribe"]').val(email)
+	
+	$('#btn-unsubscribe').click(function() {
+		var email = $(wrapper).find('input[name="unsubscribe"]').val();
+		if(email) {
+			var btn = this;
+			wn.call({
+				module:'website',
+				page:'unsubscribe',
+				method:'unsubscribe',
+				args:email,
+				btn: this,
+				callback: function() {
+					$(wrapper).find('input[name="unsubscribe"]').val('');
+				}
+			});
+		}
+	});
+}
\ No newline at end of file
diff --git a/erpnext/website/page/unsubscribe/unsubscribe.py b/erpnext/website/page/unsubscribe/unsubscribe.py
new file mode 100644
index 0000000..57d1d47
--- /dev/null
+++ b/erpnext/website/page/unsubscribe/unsubscribe.py
@@ -0,0 +1,8 @@
+def unsubscribe(arg):
+	"""unsubscribe from lists"""
+	import webnotes
+	lists = [['Blog Subscriber', 'name']]
+	for l in lists:
+		webnotes.conn.sql("""delete from `tab%s` where %s=%s""" % (l[0], l[1], '%s'), arg)
+		
+	webnotes.msgprint('Unsubscribed!')
\ No newline at end of file
diff --git a/erpnext/website/page/unsubscribe/unsubscribe.txt b/erpnext/website/page/unsubscribe/unsubscribe.txt
new file mode 100644
index 0000000..2cc3b58
--- /dev/null
+++ b/erpnext/website/page/unsubscribe/unsubscribe.txt
@@ -0,0 +1,43 @@
+# Page, unsubscribe
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 17:19:02',
+		'docstatus': 0,
+		'modified': '2012-01-27 17:19:02',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Page
+	{
+		'doctype': 'Page',
+		'module': 'Website',
+		'name': '__common__',
+		'page_name': 'unsubscribe',
+		'standard': 'Yes',
+		'title': 'Unsubscribe'
+	},
+
+	# These values are common for all Page Role
+	{
+		'doctype': 'Page Role',
+		'name': '__common__',
+		'parent': 'unsubscribe',
+		'parentfield': 'roles',
+		'parenttype': 'Page',
+		'role': 'Guest'
+	},
+
+	# Page, unsubscribe
+	{
+		'doctype': 'Page',
+		'name': 'unsubscribe'
+	},
+
+	# Page Role
+	{
+		'doctype': 'Page Role'
+	}
+]
\ No newline at end of file
diff --git a/erpnext/website/utils.py b/erpnext/website/utils.py
new file mode 100644
index 0000000..66be4d2
--- /dev/null
+++ b/erpnext/website/utils.py
@@ -0,0 +1,54 @@
+import webnotes
+from webnotes.model.doc import Document
+
+def make_template(doc, path, convert_fields = ['main_section', 'side_section']):
+	"""make template"""
+	import os, jinja2
+	
+	markdown(doc, convert_fields)
+	
+	# write template
+	with open(path, 'r') as f:
+		temp = jinja2.Template(f.read())
+	
+	return temp.render(doc = doc.fields)
+
+def markdown(doc, fields):
+	"""convert fields to markdown"""
+	import markdown2
+	# markdown
+	for f in fields:
+		doc.fields[f + '_html'] = markdown2.markdown(doc.fields[f] or '', \
+			extras=["wiki-tables"])
+
+
+def page_name(title):
+	"""make page name from title, and check that there is no duplicate"""
+	import re
+	name = title.lower()
+	name = re.sub('[~!@#$%^&*()<>,."\']', '', name)
+	return '-'.join(name.split()[:4])
+	
+def add_page(title):
+	"""add a custom page with title"""
+	name = page_name(title)
+	if webnotes.conn.sql("""select name from tabPage where name=%s""", name):
+		p = Document('Page', name)
+	else:
+		p = Document('Page')
+		
+	p.title = title
+	p.name = p.page_name = name
+	p.module = 'Website'
+	p.standard = 'No'
+
+	return p
+	
+def add_guest_access_to_page(page):
+	"""add Guest in Page Role"""
+	if not webnotes.conn.sql("""select parent from `tabPage Role`
+		where role='Guest' and parent=%s""", page):
+		d = Document('Page Role')
+		d.parent = page
+		d.role = 'Guest'
+		d.save()
diff --git a/images/feed.png b/images/feed.png
new file mode 100755
index 0000000..315c4f4
--- /dev/null
+++ b/images/feed.png
Binary files differ
diff --git a/index.cgi b/index.cgi
index 3d61c56..3ec31e7 100755
--- a/index.cgi
+++ b/index.cgi
@@ -9,33 +9,35 @@
 sys.path.append('erpnext')
 
 import webnotes
+import webnotes.handler
+import webnotes.auth
 
-webnotes.form = cgi.FieldStorage()
+def init():
+	# make the form_dict
+	webnotes.form = cgi.FieldStorage(keep_blank_values=True)
+	for key in webnotes.form.keys():
+		webnotes.form_dict[key] = webnotes.form.getvalue(key)
 
-# make the form_dict
-for key in webnotes.form.keys():
-	webnotes.form_dict[key] = webnotes.form.getvalue(key)
+	# init request
+	try:
+		webnotes.http_request = webnotes.auth.HTTPRequest()
+	except Exception, e:
+		if webnotes.response['message']=='Authentication Failed':
+			pass
+		else:
+			raise e
 
-# url comes with sid, redirect to html, sid set and all
-if 'sid' in webnotes.form_dict:
-	import webnotes.auth
-	import webnotes.widgets.page_body
+def respond():
+	import webnotes
+	if 'cmd' in webnotes.form_dict:
+		webnotes.handler.handle()
+	else:
+		import webnotes.cms.index
+		print "Content-Type: text/html"
+		webnotes.handler.print_cookies()
+		print
+		print webnotes.cms.index.get()
 
-	webnotes.auth.HTTPRequest()
-
-	print "Content-Type: text/html"
-
-	# print cookies, if there ar additional cookies defined during the request, add them here
-	if webnotes.cookies or webnotes.add_cookies:
-		for c in webnotes.add_cookies.keys():
-			webnotes.cookies[c] = webnotes.add_cookies[c]
-		
-		print webnotes.cookies
-
-	print
-	print webnotes.widgets.page_body.redirect_template % ('Redirecting...', 'index.html')
-
-else:
-	# pass on to legacy handler
-	import webnotes.handler
-
+if __name__=="__main__":
+	init()
+	respond()
diff --git a/index.html b/index.html
deleted file mode 100644
index 150a2cf..0000000
--- a/index.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<head>
-	<meta charset="utf-8">
-	<title>ERPNext</title>
-	<meta name="author" content="">
-	<script type="text/javascript">window._version_number="146"
-
-wn={}
-wn.provide=function(namespace){var nsl=namespace.split('.');var l=nsl.length;var parent=window;for(var i=0;i<l;i++){var n=nsl[i];if(!parent[n]){parent[n]={}}
-parent=parent[n];}}
-wn.provide('wn.settings');wn.provide('wn.ui');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)}}}
-wn.versions={check:function(){if(localStorage){if(window._version_number==-1||parseInt(localStorage._version_number)!=parseInt(window._version_number)){localStorage.clear();}
-localStorage.setItem('_version_number',window._version_number);}}}
-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];},html_src:function(src){if(src.indexOf('/')!=-1){var t=src.split('/').slice(0,-1);t.push('src');t=t.join('/')+'/'+a.split('/').slice(-1)[0];}else{var t='src/'+src;}
-return t;},load:function(src){var t=wn.assets.extn(src)=='html'?wn.assets.html_src(src):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);}
-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);},html:function(txt,src){var page=wn.dom.add($('.outer .inner').get(0),'div','content',null,txt);page.setAttribute("_src",src);},cgi:function(txt,src){wn.dom.eval(txt)}}}
-wn.require=function(items){if(typeof items==="string"){items=[items];}
-var l=items.length;for(var i=0;i<l;i++){var src=items[i];if(!(src in wn.assets.executed_)){wn.assets.execute(src);}}}
-wn.provide('wn.dom');wn.dom.by_id=function(id){return document.getElementById(id);}
-wn.dom.eval=function(txt){var el=document.createElement('script');el.appendChild(document.createTextNode(txt));document.getElementsByTagName('head')[0].appendChild(el);}
-wn.dom.add=function(parent,newtag,className,cs,innerHTML,onclick){if(parent&&parent.substr)parent=wn.dom.by_id(parent);var c=document.createElement(newtag);if(parent)
-parent.appendChild(c);if(className){if(newtag.toLowerCase()=='img')
-c.src=className
-else
-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.page={set:function(src){var new_selection=$('.inner div.content[_src="'+src+'"]');if(!new_selection.length){wn.assets.execute(src);new_selection=$('.inner div.content[_src="'+src+'"]');}
-$('.inner .current_page').removeClass('current_page');new_selection.addClass('current_page');var title=$('nav ul li a[href*="'+src+'"]').attr('title')||'No Title'
-state=window.location.hash;if(state!=src){window.location.hash=state;}
-else{document.title=title;}}}
-var JSON;if(!JSON){JSON={};}
-(function(){"use strict";function f(n){return n<10?'0'+n:n;}
-if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+
-f(this.getUTCMonth()+1)+'-'+
-f(this.getUTCDate())+'T'+
-f(this.getUTCHours())+':'+
-f(this.getUTCMinutes())+':'+
-f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};}
-var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
-function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
-if(typeof rep==='function'){value=rep.call(holder,key,value);}
-switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
-gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
-v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
-if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
-v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
-if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
-rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
-return str('',{'':value});};}
-if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
-return reviver.call(holder,key,value);}
-text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+
-('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
-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');};}}());wn.versions.check();wn.require("lib/js/lib/jquery.min.js");wn.require("lib/js/lib/history/history.min.js");$(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));}});</script>
-</head>
-<body>
-	<div id="startup_div" style="padding: 8px; font-size: 14px;"></div>
-
-	<!-- Main Starts -->
-	<div id="body_div"> 
-
-		<!--static (no script) content-->
-		<div class="no_script" style='font-family: verdana, sans'>
-			Loading...
-		</div>
-	</div>
-	<script>wn.require('js/app.js');</script>
-	<div id="dialog_back"></div>
-</body>
diff --git a/js/app.js b/js/app.js
index 5a8597d..cba6a84 100644
--- a/js/app.js
+++ b/js/app.js
@@ -1,8 +1,17 @@
+wn.app = {
+	name: 'ERPNext',
+	license: 'GNU/GPL - Usage Condition: All "erpnext" branding must be kept as it is',
+	source: 'https://github.com/webnotes/erpnext',
+	publisher: 'Web Notes Technologies Pvt Ltd, Mumbai',
+	copyright: '&copy; Web Notes Technologies Pvt Ltd',
+	version: '2.' + window._version_number
+}
+
+wn.modules_path = 'erpnext';
 wn.settings.no_history = true;
 
 wn.require('lib/js/lib/jquery.min.js');
 wn.require('lib/js/legacy/tiny_mce_33/jquery.tinymce.js');
-wn.require('lib/js/wn/ui/status_bar.js');
 
 // for datepicker
 wn.require('lib/js/legacy/jquery/jquery-ui.min.js')
@@ -11,4 +20,8 @@
 
 $(document).bind('ready', function() {
 	startup();
-});
\ No newline at end of file
+});
+
+$(document).bind('toolbar_setup', function() {
+	$('.brand').html('<b>erp</b>next');	
+})
\ No newline at end of file
diff --git a/rss.xml b/rss.xml
new file mode 100755
index 0000000..f69724b
--- /dev/null
+++ b/rss.xml
@@ -0,0 +1,18 @@
+#!/usr/bin/python
+
+import cgi, cgitb, os, sys
+cgitb.enable()
+
+# import libs
+sys.path.append('lib/py')
+
+import webnotes
+import webnotes.auth
+
+if __name__=='__main__':
+	webnotes.http_request = webnotes.auth.HTTPRequest()
+	from webnotes.cms import feed
+	xml = feed.generate()
+	print 'Content-Type: text/xml'
+	print
+	print xml
\ No newline at end of file
diff --git a/sitemap.xml b/sitemap.xml
new file mode 100755
index 0000000..04e565b
--- /dev/null
+++ b/sitemap.xml
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+
+import cgi, cgitb, os, sys
+cgitb.enable()
+
+# import libs
+sys.path.append('lib/py')
+
+import webnotes
+import webnotes.auth
+
+if __name__=='__main__':
+	webnotes.http_request = webnotes.auth.HTTPRequest()
+	domain = os.environ.get('HTTP_HOST')
+	protocol = os.environ.get('HTTPS') and 'https://' or 'http://'
+	from webnotes.cms import sitemap
+	print 'Content-Type: text/xml'
+	print
+	print sitemap.generate(protocol + domain + '/')
\ No newline at end of file
diff --git a/templates/index.html b/templates/index.html
deleted file mode 100644
index af0b8e5..0000000
--- a/templates/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<head>
-	<meta charset="utf-8">
-	<title>ERPNext</title>
-	<meta name="author" content="">
-	<script type="text/javascript">%s</script>
-</head>
-<body>
-	<div id="startup_div" style="padding: 8px; font-size: 14px;"></div>
-
-	<!-- Main Starts -->
-	<div id="body_div"> 
-
-		<!--static (no script) content-->
-		<div class="no_script" style='font-family: verdana, sans'>
-			Loading...
-		</div>
-	</div>
-	<script>wn.require('js/app.js');</script>
-	<div id="dialog_back"></div>
-</body>
diff --git a/version.num b/version.num
index bc768da..4f36264 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-146
\ No newline at end of file
+360
\ No newline at end of file
diff --git a/wnf.py b/wnf.py
new file mode 100755
index 0000000..355474f
--- /dev/null
+++ b/wnf.py
@@ -0,0 +1,134 @@
+#!/usr/bin/env python
+
+import os, sys
+
+def replace_code(start, txt1, txt2, extn):
+	"""replace all txt1 by txt2 in files with extension (extn)"""
+	import os, re
+	for wt in os.walk(start, followlinks=1):
+		for fn in wt[2]:
+			if fn.split('.')[-1]==extn:
+				fpath = os.path.join(wt[0], fn)
+				with open(fpath, 'r') as f:
+					content = f.read()
+				
+				if re.search(txt1, content):
+					a = raw_input('Change in %s [y/n]?' % fpath)
+					if a=='y':
+						with open(fpath, 'w') as f:
+							f.write(re.sub(txt1, txt2, content))
+				
+						print 'updated in %s' % fpath
+
+def setup_options():
+	from optparse import OptionParser
+	parser = OptionParser()
+	parser.add_option("-b", "--build", default=False, action="store_true",
+						help="minify + concat js files")
+	parser.add_option("-c", "--clear", default=False, action="store_true",
+						help="increment version")
+	parser.add_option("--replace", nargs=3, default=False, 
+						metavar = "search replace_by extension",
+						help="file search-replace")
+	parser.add_option("--status", default=False, action="store_true",
+						help="git status")
+	parser.add_option("--pull", nargs=2, default=False,
+						metavar = "remote branch",
+						help="git pull (both repos)")
+	parser.add_option("--push", nargs=3, default=False, 
+						metavar = "remote branch comment",
+						help="git commit + push (both repos) [remote] [branch] [comment]")
+	parser.add_option("-l", "--latest",
+						action="store_true", dest="run_latest", default=False,
+						help="Apply the latest patches")
+	parser.add_option("-p", "--patch", nargs=1, dest="patch_list", metavar='patch_module',
+						action="append",
+						help="Apply patch")
+	parser.add_option("-f", "--force",
+						action="store_true", dest="force", default=False,
+						help="Force Apply all patches specified using option -p or --patch")
+	parser.add_option("-d", "--db",
+						dest="db_name",
+						help="Apply the patches on given db")
+	parser.add_option('--reload_doc', nargs=3, metavar = "module doctype docname",
+						help="reload doc")
+	
+	return parser.parse_args()
+	
+def run():
+	sys.path.append('lib')
+	sys.path.append('lib/py')
+	import webnotes
+	import webnotes.defs
+	sys.path.append(webnotes.defs.modules_path)
+
+	(options, args) = setup_options()
+
+
+	from webnotes.db import Database
+	import webnotes.modules.patch_handler
+
+	# connect
+	if options.db_name is not None:
+		webnotes.connect(options.db_name)
+
+	# build
+	if options.build:
+		import build.project
+		build.project.build()		
+
+	elif options.clear:
+		from build.project import increment_version
+		print "Version:" + str(increment_version())
+	
+	# code replace
+	elif options.replace:
+		replace_code('.', options.replace[0], options.replace[1], options.replace[2])
+	
+	# git
+	elif options.status:
+		os.system('git status')
+		os.chdir('lib')
+		os.system('git status')
+	
+	elif options.pull:
+		os.system('git pull %s %s' % (options.pull[0], options.pull[1]))
+		os.chdir('lib')
+		os.system('git pull %s %s' % (options.pull[0], options.pull[1]))
+
+	elif options.push:
+		os.system('git commit -a -m "%s"' % options.push[2])
+		os.system('git push %s %s' % (options.push[0], options.push[1]))
+		os.chdir('lib')
+		os.system('git commit -a -m "%s"' % options.push[2])
+		os.system('git push %s %s' % (options.push[0], options.push[1]))
+	
+	# patch
+	elif options.patch_list:
+		# clear log
+		webnotes.modules.patch_handler.log_list = []
+		
+		# run individual patches
+		for patch in options.patch_list:
+			webnotes.modules.patch_handler.run_single(\
+				patchmodule = patch, force = options.force)
+		
+		print '\n'.join(webnotes.modules.patch_handler.log_list)
+	
+		# reload
+	elif options.reload_doc:
+		webnotes.modules.patch_handler.reload_doc(\
+			{"module":options.reload_doc[0], "dt":options.reload_doc[1], "dn":options.reload_doc[2]})		
+		print '\n'.join(webnotes.modules.patch_handler.log_list)
+
+	# run all pending
+	elif options.run_latest:
+		webnotes.modules.patch_handler.run_all()
+		print '\n'.join(webnotes.modules.patch_handler.log_list)
+	
+	# print messages
+	if webnotes.message_log:
+		print '\n'.join(webnotes.message_log)
+
+if __name__=='__main__':
+	run()