'alt': false, // whether is the Alt key pressed
'focus': -1 // currently selected indeks of document.links
};
-var _validate = {}; // validation functions
-
-function debug(msg) {
- box = document.getElementById('msgbox')
- box.innerHTML= box.innerHTML+'<br>'+msg
-}
function save_focus(e) {
_focus = e.name||e.id;
function(e) {
e.onclick = function() {
save_focus(e);
- if (e.getAttribute('aspect') == 'process')
- JsHttpRequest.request(this, null, 30000);
- else
- JsHttpRequest.request(this);
+ if (e.getAttribute('aspect') == 'process')
+ JsHttpRequest.request(this, null, 30000);
+ else
+ JsHttpRequest.request(this);
return false;
}
},
- 'button': function(e) {
+/* 'button': function(e) {
if (e.name) {
var func = _validate[e.name];
var old = e.onclick;
}
}
},
- '.amount': function(e) {
+*/ '.amount': function(e) {
if(e.onblur==undefined) {
e.onblur = function() {
var dec = this.getAttribute("dec");
}
},
-*/ '#msgbox': function(e) {
+*//* '#msgbox': function(e) {
// this is to avoid changing div height after ajax update in IE7
e.style.display = e.innerHTML.length ? 'block' : 'none';
}
-/* TODO
+*//* TODO
'a.date_picker': function(e) {
// this un-hides data picker for js enabled browsers
e.href = date_picker(this.getAttribute('rel'));
box.style.visibility = img ? 'visible' : 'hidden'
}
+function disp_msg(msg, cl) {
+ var box = document.getElementById('msgbox')
+ box.innerHTML= "<div class='"+(cl || 'err_msg')+"'>"+ msg+'</div>';
+// box.style.display = msg=='' ? 'none':'block';
+ if (msg!='') window.scrollTo(0,element_pos(box).y-10);
+}
+
//
// JsHttpRequest class extensions.
//
// request is directed to current location
//
JsHttpRequest.request= function(trigger, form, tout) {
+// if (trigger.type=='submit' && !validate(trigger)) return false;
tout = tout | 3000; // default timeout value
set_mark(tout>5000 ? 'progressbar.gif' : 'ajax-loader.gif');
JsHttpRequest._request(trigger, form, tout, 2);
}
JsHttpRequest._request = function(trigger, form, tout, retry) {
-
if (trigger.tagName=='A') {
var content = {};
var upload = 0;
function get_amount(doc, label) {
if(label)
- var val = document.getElementById(doc).innerHTML;
+ var val = document.getElementById(doc).innerHTML;
else
- var val = document.getElementsByName(doc)[0].value;
+ var val = typeof(doc) == "string" ?
+ document.getElementsByName(doc)[0].value : doc.value;
+
val = val.replace(new RegExp('\\'+user.ts, 'g'),'');
val = +val.replace(new RegExp('\\'+user.ds, 'g'),'.');
return isNaN(val) ? 0 : val;
border: 1px solid #FFF;
}
+div.err_msg {
+ margin: 10px;
+ padding: 3px;
+ border: 1px solid #cc3300;
+ background-color: #ffcccc;
+ color: #dd2200;
+ text-align: center;
+}
+
div.warn_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #ff9900;
background-color: #ffff00;
}
div.note_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #33cc00;
background-color: #ccffcc;
text-align: center;
}
-#msgbox {
- margin: 10px;
+#title {
+ margin-bottom: 10px;
+ width: 100%;
}
echo "</td></tr></table>";
}
echo "</td></tr></table>";
-
- if ($title && !$no_menu && !$is_index)
+ if ($no_menu)
+ echo "<br>";
+ elseif ($title && !$is_index)
{
- echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td>"
+ echo "<center><table id='title'><tr><td width='100%' class='titletext'>$title</td>"
."<td align=right>"
.(user_hints() ? "<span id='hints'></span>" : '')
."</td>"
."</tr></table></center>";
}
+
}
function menu_footer($no_menu, $is_index)
border: 1px solid #FFF;
}
+div.err_msg {
+ margin: 10px;
+ padding: 3px;
+ border: 1px solid #cc3300;
+ background-color: #ffcccc;
+ color: #dd2200;
+ text-align: center;
+}
+
div.warn_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #ff9900;
background-color: #ffff00;
}
div.note_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #33cc00;
background-color: #ccffcc;
text-align: center;
}
-#msgbox {
- margin: 10px;
+#title {
+ margin-bottom: 10px;
+ width: 100%;
}
}
echo "</td></tr></table>";
- if ($title && !$no_menu && !$is_index)
+ if ($no_menu)
+ echo "<br>";
+ elseif ($title && !$is_index)
{
- echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td>"
+ echo "<center><table id='title'><tr><td width='100%' class='titletext'>$title</td>"
."<td align=right>"
.(user_hints() ? "<span id='hints'></span>" : '')
."</td>"
}
div.err_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #cc3300;
background-color: #ffcccc;
}
div.warn_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #ff9900;
background-color: #ffff00;
}
div.note_msg {
+ margin: 10px;
padding: 3px;
border: 1px solid #33cc00;
background-color: #ccffcc;
text-align: center;
}
-#msgbox {
- margin: 10px;
+#title {
+ margin-bottom: 10px;
+ width: 100%;
}
echo "$himg<a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url($title, $sel_app)."'>" . _("Help") . "</a> ";
}
echo "$img<a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
+ echo "</td></tr><tr><td colspan=3>";
echo "</td></tr></table>";
}
echo "</td></tr></table>";
- if ($title && !$no_menu && !$is_index)
+ if ($no_menu)
+ echo "<br>";
+ elseif ($title && !$is_index)
{
- echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td>"
+ echo "<center><table id='title'><tr><td width='100%' class='titletext'>$title</td>"
."<td align=right>"
.(user_hints() ? "<span id='hints'></span>" : '')
."</td>"
."</tr></table></center>";
}
-
}
function menu_footer($no_menu, $is_index)