include button.js in all-web.js
diff --git a/public/css/wn-web.css b/public/css/wn-web.css
index 8814437..65f445c 100644
--- a/public/css/wn-web.css
+++ b/public/css/wn-web.css
@@ -1,143 +1,20 @@
-#body_div {
+body {
 
-	background: url("files/indian-textile-5.gif") repeat;
+	background-color: #9CA2AD;
 	
 
-	font-family: 'Lato', Verdana, Sans !important;
-
-
-	font-size: 14px !important;
 
 }
 
 
-.small {
-	font-size: 12px !important;
+footer {
+	color: white;
+}
+footer a, footer a:visited, footer a:hover {
+	color: white;
+}
+.web-footer-menu ul li {
+	border-right: 1px solid white;
 }
 
 
-
-
-
-h1, h2, h3, h4, h5 {
-	font-family: 'Lato', Arial, 'Helvetica Neue' !important;
-}	
-
-
-/* User CSS */
-
-hr {
-  clear: both;
-}
-
-p {
-  margin-top: 2px;
-}
-
-
-.hand {
-  font-family: Pacifico;
-  font-size: 18px;
-}
-
-h1.top {
-  text-align: center;
-}
-
-.sub-head {
-  text-align: center;
-  color: #888;
-  font-size: 18px;
-  margin: 10px 0px;
-}
-
-.layout-main, .layout-main-section {
-  padding: 50px;
-}
-
-.layout-main-section {
-  width: 60%;
-}
-
-.layout-side-section {
-  padding-top: 50px;
-}
-
-h2 {
-  //font-family: Pacifico;
-  font-size: 20px;
-  font-weight: bold;
-  color: #CC0000;
-  padding: 25px 0px 25px 0px;
-  clear: both;
-  text-align: left;
-}
-
-.center {
-  text-align: center;
-}
-
-.left {
-  width: 375px;
-  padding-right: 25px;
-  float: left;
-}
-
-.right {
-  width: 375px;
-  padding-left: 25px;
-  float: left;
-}
-
-.page-footer {
-  clear: both;
-  margin: -50px;
-  margin-top: 50px;
-  background-color: #DEE1D0; //#E7DFCA;
-  padding: 50px;
-}
-
-.page-footer input {
-  width: 140px;
-  font-size: 17px;
-  padding: 4px;
-  margin-top: 2px;
-}
-
-.page-footer .section-head {
-  padding: 0px; 
-  margin-bottom: 7px;
-}
-
-.green {
-  color: green;
-}
-
-.web-form input, .web-form textarea {
-  width: 400px;
-  font-size: 17px;
-  padding: 4px;
-}
-
-.avatar {
-  height: 75px;
-  width: 75px;
-  border-radius: 100px 100px 100px 100px;
-  overflow: hidden;
-}
-
-.link-big {
-  font-size: 140%;
-}
-
-.sticky {
-  background-color: #FFFBC4;
-  padding: 15px;
-  margin-left: 15px;
-  font-size: 12px;
-  color: #444;
-  width: 240px;
-  min-height: 120px;
-  float: right;
-  box-shadow: 2px 2px 6px #973;
-}
\ No newline at end of file
diff --git a/public/js/all-app.js b/public/js/all-app.js
index c94f64e..79b7c20 100644
--- a/public/js/all-app.js
+++ b/public/js/all-app.js
@@ -496,11 +496,11 @@
 wn.datetime.only_date=function(val){if(val==null||val=='')return null;if(val.search(':')!=-1){var tmp=val.split(' ');var d=tmp[0].split('-');}else{var d=val.split('-');}
 if(d.length==3)
 val=d[2]+'-'+d[1]+'-'+d[0];return val;}
-wn.datetime.time_to_ampm=function(v){if(!v){var d=new Date();var t=[d.getHours(),cint(d.getMinutes()/5)*5]}else{var t=v.split(':');}
+wn.datetime.time_to_ampm=function(v){if(!v){var d=new Date();var t=[d.getHours(),cint(d.getMinutes()/5)*5+'']}else{var t=v.split(':');}
 if(t.length!=2){show_alert('[set_time] Incorect time format');return;}
 if(t[1].length==1)t[1]='0'+t[1];if(cint(t[0])==0)var ret=['12',t[1],'AM'];else if(cint(t[0])<12)var ret=[cint(t[0])+'',t[1],'AM'];else if(cint(t[0])==12)var ret=['12',t[1],'PM'];else var ret=[(cint(t[0])-12)+'',t[1],'PM'];return ret;}
 wn.datetime.time_to_hhmm=function(hh,mm,am){if(am=='AM'&&hh=='12'){hh='00';}else if(am=='PM'&&hh!='12'){hh=cint(hh)+12;}
-return hh+':'+mm;}
+if(!mm)mm='00';if(!hh)hh='00';return hh+':'+mm;}
 function prettyDate(time){if(!time)return''
 var date=time;if(typeof(time)=="string")
 date=new Date((time||"").replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\.[0-9]*/,""));var diff=(((new Date()).getTime()-date.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0)
@@ -705,7 +705,7 @@
 me.last_value=val;me.run_trigger();}
 this.input.set_input=function(val){if(val==null)val='';me.input.value=val;if(me.format_input)me.format_input();}
 if(this.df.options=='Suggest'){if(this.suggest_icon)$di(this.suggest_icon);$(me.input).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':repl('SELECT DISTINCT `%(fieldname)s` FROM \
-       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});}});}}
+       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});},select:function(event,ui){me.set(ui.item.value);}});}}
 DataField.prototype.validate=function(v){if(this.df.options=='Phone'){if(v+''=='')return'';v1=''
 v=v.replace(/ /g,'').replace(/-/g,'').replace(/\(/g,'').replace(/\)/g,'');if(v&&v.substr(0,1)=='+'){v1='+';v=v.substr(1);}
 if(v&&v.substr(0,2)=='00'){v1+='00';v=v.substr(2);}
@@ -1545,7 +1545,7 @@
 me.last_value=val;me.run_trigger();}
 this.input.set_input=function(val){if(val==null)val='';me.input.value=val;if(me.format_input)me.format_input();}
 if(this.df.options=='Suggest'){if(this.suggest_icon)$di(this.suggest_icon);$(me.input).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':repl('SELECT DISTINCT `%(fieldname)s` FROM \
-       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});}});}}
+       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});},select:function(event,ui){me.set(ui.item.value);}});}}
 DataField.prototype.validate=function(v){if(this.df.options=='Phone'){if(v+''=='')return'';v1=''
 v=v.replace(/ /g,'').replace(/-/g,'').replace(/\(/g,'').replace(/\)/g,'');if(v&&v.substr(0,1)=='+'){v1='+';v=v.substr(1);}
 if(v&&v.substr(0,2)=='00'){v1+='00';v=v.substr(2);}
@@ -2334,4 +2334,4 @@
  *	conf.js
  */
 wn.provide('erpnext');erpnext.set_about=function(){wn.provide('wn.app');$.extend(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'});}
-wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' <i class="icon-home icon-white navbar-icon-home" ></i>').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
+wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' <i class="icon-home icon-white navbar-icon-home" ></i>').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
\ No newline at end of file
diff --git a/public/js/all-web.js b/public/js/all-web.js
index 10fe02d..e8cd533 100644
--- a/public/js/all-web.js
+++ b/public/js/all-web.js
@@ -383,11 +383,11 @@
 wn.datetime.only_date=function(val){if(val==null||val=='')return null;if(val.search(':')!=-1){var tmp=val.split(' ');var d=tmp[0].split('-');}else{var d=val.split('-');}
 if(d.length==3)
 val=d[2]+'-'+d[1]+'-'+d[0];return val;}
-wn.datetime.time_to_ampm=function(v){if(!v){var d=new Date();var t=[d.getHours(),cint(d.getMinutes()/5)*5]}else{var t=v.split(':');}
+wn.datetime.time_to_ampm=function(v){if(!v){var d=new Date();var t=[d.getHours(),cint(d.getMinutes()/5)*5+'']}else{var t=v.split(':');}
 if(t.length!=2){show_alert('[set_time] Incorect time format');return;}
 if(t[1].length==1)t[1]='0'+t[1];if(cint(t[0])==0)var ret=['12',t[1],'AM'];else if(cint(t[0])<12)var ret=[cint(t[0])+'',t[1],'AM'];else if(cint(t[0])==12)var ret=['12',t[1],'PM'];else var ret=[(cint(t[0])-12)+'',t[1],'PM'];return ret;}
 wn.datetime.time_to_hhmm=function(hh,mm,am){if(am=='AM'&&hh=='12'){hh='00';}else if(am=='PM'&&hh!='12'){hh=cint(hh)+12;}
-return hh+':'+mm;}
+if(!mm)mm='00';if(!hh)hh='00';return hh+':'+mm;}
 function prettyDate(time){if(!time)return''
 var date=time;if(typeof(time)=="string")
 date=new Date((time||"").replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\.[0-9]*/,""));var diff=(((new Date()).getTime()-date.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0)
@@ -554,6 +554,13 @@
 wn.widgets.Dialog.prototype=new wn.widgets.FieldGroup();wn.provide('wn.ui');wn.ui.Dialog=wn.widgets.Dialog
 $(document).bind('keydown',function(e){if(cur_dialog&&!cur_dialog.no_cancel_flag&&e.which==27){cur_dialog.hide();}});
 /*
+ *	lib/js/wn/ui/button.js
+ */
+wn.ui.Button=function(args){var me=this;$.extend(this,{make:function(){me.btn=wn.dom.add(args.parent,'button','btn btn-small '+(args.css_class||''));me.btn.args=args;me.loading_img=wn.dom.add(me.btn.args.parent,'img','',{margin:'0px 4px -2px 4px',display:'none'});me.loading_img.src='images/lib/ui/button-load.gif';me.btn.innerHTML=args.label;me.btn.user_onclick=args.onclick;$(me.btn).bind('click',function(){if(!this.disabled&&this.user_onclick)
+this.user_onclick(this);})
+me.btn.set_working=me.set_working;me.btn.done_working=me.done_working;if(me.btn.args.style)
+wn.dom.css(me.btn,args.style);},set_working:function(){me.btn.disabled='disabled';$(me.loading_img).css('display','inline');},done_working:function(){me.btn.disabled=false;$(me.loading_img).toggle(false);}});this.make();}
+/*
  *	lib/js/legacy/widgets/dialog.js
  */
 var cur_dialog;var top_index=91;function Dialog(w,h,title,content){this.make({width:w,title:title});if(content)this.make_body(content);this.onshow='';this.oncancel='';this.no_cancel_flag=0;this.display=false;this.first_button=false;}
@@ -729,4 +736,4 @@
  *	conf.js
  */
 wn.provide('erpnext');erpnext.set_about=function(){wn.provide('wn.app');$.extend(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'});}
-wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' <i class="icon-home icon-white navbar-icon-home" ></i>').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
+wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand').html((wn.boot.website_settings.brand_html||'erpnext')+' <i class="icon-home icon-white navbar-icon-home" ></i>').css('max-width','200px').css('overflow','hidden').hover(function(){$(this).find('.icon-home').addClass('navbar-icon-home-hover');},function(){$(this).find('.icon-home').removeClass('navbar-icon-home-hover');});});
\ No newline at end of file
diff --git a/public/js/fields.js b/public/js/fields.js
index d14c4ee..69434a9 100644
--- a/public/js/fields.js
+++ b/public/js/fields.js
@@ -70,7 +70,7 @@
 me.last_value=val;me.run_trigger();}
 this.input.set_input=function(val){if(val==null)val='';me.input.value=val;if(me.format_input)me.format_input();}
 if(this.df.options=='Suggest'){if(this.suggest_icon)$di(this.suggest_icon);$(me.input).autocomplete({source:function(request,response){wn.call({method:'webnotes.widgets.search.search_link',args:{'txt':request.term,'dt':me.df.options,'query':repl('SELECT DISTINCT `%(fieldname)s` FROM \
-       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});}});}}
+       `tab%(dt)s` WHERE `%(fieldname)s` LIKE "%s" LIMIT 50',{fieldname:me.df.fieldname,dt:me.df.parent})},callback:function(r){response(r.results);}});},select:function(event,ui){me.set(ui.item.value);}});}}
 DataField.prototype.validate=function(v){if(this.df.options=='Phone'){if(v+''=='')return'';v1=''
 v=v.replace(/ /g,'').replace(/-/g,'').replace(/\(/g,'').replace(/\)/g,'');if(v&&v.substr(0,1)=='+'){v1='+';v=v.substr(1);}
 if(v&&v.substr(0,2)=='00'){v1+='00';v=v.substr(2);}
diff --git a/public/js/wn-web.js b/public/js/wn-web.js
index cd6552a..17a3da4 100644
--- a/public/js/wn-web.js
+++ b/public/js/wn-web.js
@@ -1,81 +1 @@
-window.home_page = "index";
-// footer signup widget
-// automatically adds it to the .layout-main div of the page
-// adds events and also random goodies.
-
-erpnext.set_request_signup = function(page_name) {
-  
-  // goodies
-  var goodies = [
-     "ERPNext also contains a module to build your website. \
-The way it works is, when you log out, the app becomes your website. \
-This website is generated from ERPNext.",
-
-     "You can add custom fields to your transactions in ERPNext to capture specific information about your business.",
-
-     "All forms in ERPNext can be customized, if you feel there are features you do not want to use, you can hide them.",
-
-     "You can email transactions like Quotations and Invoices directly from the system. You can also set this process to become automatic",
-
-     "You can create your own Roles and assign user to those roles. You can also set detailed permissions for each role in transactions.",
-
-     "ERPNext allows you to assign any transaction like an Invoice or Customer Issue to a user. You can also add comments on any transaction."
-
-  ];
-
-
-  // add the footer
-
-  $('#page-' + page_name + ' .layout-main').append('<div class="page-footer">\
-<h2 style="padding: 0px">Try before you buy. \
-Request a 30-day Free Trial.</h2><br>\
-\
-<input name="company_name" type="text" placeholder="Company Name"> \
-<input name="sender_name" type="text" placeholder="Your Name"> \
-<input name="email" type="text" placeholder="Email"> \
-<input name="password" type="password" placeholder="Password"> \
-<button class="btn btn-success btn-small btn-request">Request</button>\
-\
-<p>Note: Free trials usually take one business day to setup. \
-Please fill out your genuine information because we verify \
-your name and company before setting up a demo to \
-ensure that spammers don\'t crash our servers. \
-If you would like to see something right now, \
-<a href="#!demo">jump to the demo.</a></p>\
-\
-<p style="font-size: 90%; margin-top: 10px;">\
-<i class="icon-hand-right"></i> <b>ERPNext Goodies:</b> <span class="goodie">'
-
-+ goodies[parseInt(Math.random() * goodies.length)]+
-
-'</goodie></p>\
-</span>');
-
-  // bind the events
-
-  $('#page-'+page_name+' .btn-request').click(function() {
-
-    var page = $('#page-' + wn.container.page.page_name);
-    var args = {
-        sender_name: page.find('[name="sender_name"]').val(),
-        company_name: page.find('[name="company_name"]').val(),
-        email: page.find('[name="email"]').val(),
-        password: page.find('[name="password"]').val()
-      }
-
-    if(!(args.sender_name && args.company_name && args.email && args.password)) {
-       msgprint("All fields are necessary. Please try again.");
-       return;
-    }
-
-
-    erpnext.send_message({
-      subject:'New Trial Request',
-      sender: page.find('[name="sender_name"]').val(),
-      message: args,
-      callback: function() {
-        page.find(':input').val('');
-      }
-    });
-  });
-}
\ No newline at end of file
+window.home_page = "home";