Merge branch 'latest' of github.com:webnotes/erpnext into latest

Conflicts:
	erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py
index 87d0373..e0b93c8 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/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/page/event_updates/event_updates.js b/erpnext/home/page/event_updates/event_updates.js
index 87c7f5c..078dfc2 100644
--- a/erpnext/home/page/event_updates/event_updates.js
+++ b/erpnext/home/page/event_updates/event_updates.js
@@ -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;
 
diff --git a/erpnext/patches/jan_mar_2012/website.py b/erpnext/patches/jan_mar_2012/website.py
index ad60cc5..ee1f251 100644
--- a/erpnext/patches/jan_mar_2012/website.py
+++ b/erpnext/patches/jan_mar_2012/website.py
@@ -1,9 +1,12 @@
 # website patch
 
 import webnotes
+from webnotes.model.doc import Document
+
 def execute():	
-	cleanup_file_data()
+	add_website_manager()
 	return
+	cleanup_file_data()
 	update_patch_log()
 	from webnotes.modules import reload_doc
 	reload_doc('website', 'Module Def', 'Website')
@@ -13,6 +16,17 @@
 	reload_doc('website', 'doctype', 'top_bar_item')
 	reload_doc('website', 'page', 'home')
 
+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)
+
 def cleanup_file_data():
 	webnotes.conn.commit()
 	webnotes.conn.sql("""alter table `tabFile Data` drop column blob_content""")
diff --git a/erpnext/startup/modules.js b/erpnext/startup/modules.js
index 3dd7b3e..b5356d9 100644
--- a/erpnext/startup/modules.js
+++ b/erpnext/startup/modules.js
@@ -145,8 +145,10 @@
 		// 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); });
+		$(me.pointer.label_area).set_working();
+		loadpage(this.det.module_page, function() { 
+			$(me.pointer.label_area).done_working(); 
+		});
 
 	} else {
 		// show sub items
@@ -190,7 +192,7 @@
 	this.loading = 1;
 	var me = this;
 
-	$item_set_working(this.pointer.label_area);
+	$(this.pointer.label_area).set_working();
 	var callback = function(r,rt){
 		me.loaded = 1;
 		me.loading = 0;
@@ -199,7 +201,7 @@
 		var has_tools = 0;
 
 		// widget code
-		$item_done_working(me.pointer.label_area);
+		$(me.pointer.label_area).done_working();
 
 		if(r.message.il) {
 			me.il = r.message.il;
diff --git a/erpnext/startup/startup.css b/erpnext/startup/startup.css
index f7aff1c..24d3800 100644
--- a/erpnext/startup/startup.css
+++ b/erpnext/startup/startup.css
@@ -1,5 +1,5 @@
 h1, h2, h3, h4 {
-	font-family: Tahoma, Sans Serif;
+	font-family: Tahoma, Arial, Verdana, sans-serif;
 	font-weight: bold;
 }
 
diff --git a/erpnext/website/Module Def/Website/Website.txt b/erpnext/website/Module Def/Website/Website.txt
index 7e67c3c..1d5985b 100644
--- a/erpnext/website/Module Def/Website/Website.txt
+++ b/erpnext/website/Module Def/Website/Website.txt
@@ -5,7 +5,7 @@
 	{
 		'creation': '2012-01-23 17:05:32',
 		'docstatus': 0,
-		'modified': '2012-01-24 15:57:51',
+		'modified': '2012-01-27 10:14:58',
 		'modified_by': 'Administrator',
 		'owner': 'Administrator'
 	},
@@ -21,6 +21,7 @@
 
 	# These values are common for all Module Def Item
 	{
+		'doc_type': 'Single DocType',
 		'doctype': 'Module Def Item',
 		'name': '__common__',
 		'parent': 'Website',
@@ -48,7 +49,6 @@
 	{
 		'display_name': 'Top Bar Settings',
 		'doc_name': 'Top Bar Settings',
-		'doc_type': 'Single DocType',
 		'doctype': 'Module Def Item'
 	},
 
@@ -56,7 +56,20 @@
 	{
 		'display_name': 'Home Settings',
 		'doc_name': 'Home Settings',
-		'doc_type': 'Forms',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'Contact Us Settings',
+		'doc_name': 'Contact Us Settings',
+		'doctype': 'Module Def Item'
+	},
+
+	# Module Def Item
+	{
+		'display_name': 'About Us Settings',
+		'doc_name': 'About Us Settings',
 		'doctype': 'Module Def Item'
 	},
 
diff --git a/erpnext/website/css/website.css b/erpnext/website/css/website.css
index bdef882..5afb47d 100644
--- a/erpnext/website/css/website.css
+++ b/erpnext/website/css/website.css
@@ -8,6 +8,10 @@
 	margin: auto;
 }
 
+.web-content input[type="text"], .web-content input[type="password"], .web-content select {
+	min-width: 180px;
+}
+
 .web-main-section {
 	width: 65%;
 	float: left;
@@ -18,4 +22,7 @@
 	width: 30%;
 	float: right;
 	margin-bottom: 20px;
+	margin-right: 15px;
+	color: #606060;
+	overflow-x: hidden;
 }
\ No newline at end of file
diff --git a/erpnext/website/doctype/about_us_settings/__init__.py b/erpnext/website/doctype/about_us_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/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..31a26ce
--- /dev/null
+++ b/erpnext/website/doctype/about_us_settings/about_us_settings.py
@@ -0,0 +1,23 @@
+"""
+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'""", as_dict=1)
+		
+		import markdown2
+		for t in self.doc.about_team:
+			t['bio'] = markdown2.markdown(t['bio'])
+		
+		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..21d6729
--- /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-contact-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/website/doctype/about_us_team/__init__.py b/erpnext/website/doctype/about_us_team/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/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/website/doctype/contact_us_settings/__init__.py b/erpnext/website/doctype/contact_us_settings/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/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..65d50db
--- /dev/null
+++ b/erpnext/website/doctype/contact_us_settings/contact_us_settings.py
@@ -0,0 +1,16 @@
+"""
+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', '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/website/doctype/home_settings/home_settings.py b/erpnext/website/doctype/home_settings/home_settings.py
index 3ceea16..520b810 100644
--- a/erpnext/website/doctype/home_settings/home_settings.py
+++ b/erpnext/website/doctype/home_settings/home_settings.py
@@ -1,6 +1,7 @@
 """
-generate home html
+generate html
 """
+import webnotes
 
 class DocType:
 	def __init__(self, d, dl):
@@ -8,19 +9,9 @@
 		
 	def on_update(self):
 		"""make home html"""
-		import os, jinja2, markdown2
-		import webnotes
+		from website.utils import make_template
+		import os
+		path = os.path.join(os.path.dirname(__file__), 'template.html')
 		
-		# markdown
-		self.doc.main_section_html = markdown2.markdown(self.doc.main_section or '', \
-			extras=["wiki-tables"])
-		self.doc.side_section_html = markdown2.markdown(self.doc.side_section or '', \
-			extras=["wiki-tables"])
-		
-		# write template
-		with open(os.path.join(os.path.dirname(__file__), 'template.html'), 'r') as f:
-			temp = jinja2.Template(f.read())
-		
-		html = temp.render(doc = self.doc.fields)
-		webnotes.conn.set_value('Page', 'Home', 'content', html)
+		webnotes.conn.set_value('Page', 'home', 'content', make_template(self.doc, path))
 		
\ No newline at end of file
diff --git a/erpnext/website/doctype/home_settings/template.html b/erpnext/website/doctype/home_settings/template.html
index 424489a..d43f1ef 100644
--- a/erpnext/website/doctype/home_settings/template.html
+++ b/erpnext/website/doctype/home_settings/template.html
@@ -1,5 +1,5 @@
 <div class="layout_wrapper">
-	<div id="content-home">
+	<div class="web-content" id="content-home">
 		{% if doc.headline %}
 			<h1>{{ doc.headline }}</h1>
 		{% endif %}
diff --git a/erpnext/website/page/about/__init__.py b/erpnext/website/page/about/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/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..7e045de
--- /dev/null
+++ b/erpnext/website/page/about/about.txt
@@ -0,0 +1,42 @@
+# Page, about
+[
+
+	# These values are common in all dictionaries
+	{
+		'creation': '2012-01-27 11:37:57',
+		'docstatus': 0,
+		'modified': '2012-01-27 11:37:57',
+		'modified_by': 'Administrator',
+		'owner': 'Administrator'
+	},
+
+	# These values are common for all Page
+	{
+		'doctype': 'Page',
+		'module': 'Website',
+		'name': '__common__',
+		'page_name': 'about',
+		'standard': 'Yes'
+	},
+
+	# 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/website/page/contact/__init__.py b/erpnext/website/page/contact/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/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/utils.py b/erpnext/website/utils.py
new file mode 100644
index 0000000..e1802cb
--- /dev/null
+++ b/erpnext/website/utils.py
@@ -0,0 +1,14 @@
+def make_template(doc, path, convert_fields = ['main_section', 'side_section']):
+	"""make template"""
+	import os, jinja2, markdown2
+	
+	# markdown
+	for f in convert_fields:
+		doc.fields[f + '_html'] = markdown2.markdown(doc.fields[f] or '', \
+			extras=["wiki-tables"])
+	
+	# write template
+	with open(path, 'r') as f:
+		temp = jinja2.Template(f.read())
+	
+	return temp.render(doc = doc.fields)	
\ No newline at end of file
diff --git a/index.html b/index.html
index dacded5..02a2e50 100644
--- a/index.html
+++ b/index.html
@@ -3,7 +3,7 @@
 	<meta charset="utf-8">
 	<title>ERPNext</title>
 	<meta name="author" content="">
-	<script type="text/javascript">window._version_number="201";
+	<script type="text/javascript">window._version_number="215";
 
 /*
 *	lib/js/wn/class.js
diff --git a/version.num b/version.num
index 3bc92d4..58e77f3 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-201
+215
\ No newline at end of file