1 function check_footer_bottom() {
2 min_height = document.body.clientHeight - $('#header').outerHeight() - $('#footer').outerHeight();
3 /* alert('min_height='+min_height); */
5 $('#main').css('min-height', min_height+'px');
8 $(document).ready(check_footer_bottom);
9 $(window).resize(check_footer_bottom);
14 //-------- dummy i18n.js
15 function gettext(txt) {
20 // Core javascript helper functions
22 // basic browser identification & version
23 var isOpera = (navigator.userAgent.indexOf("Opera")>=0) && parseFloat(navigator.appVersion);
24 var isIE = ((document.all) && (!isOpera)) && parseFloat(navigator.appVersion.split("MSIE ")[1].split(";")[0]);
26 // Cross-browser event handlers.
27 function addEvent(obj, evType, fn) {
28 if (obj.addEventListener) {
29 obj.addEventListener(evType, fn, false);
31 } else if (obj.attachEvent) {
32 var r = obj.attachEvent("on" + evType, fn);
39 function removeEvent(obj, evType, fn) {
40 if (obj.removeEventListener) {
41 obj.removeEventListener(evType, fn, false);
43 } else if (obj.detachEvent) {
44 obj.detachEvent("on" + evType, fn);
51 // quickElement(tagType, parentReference, textInChildNode, [, attribute, attributeValue ...]);
52 function quickElement() {
53 var obj = document.createElement(arguments[0]);
54 if (arguments[2] != '' && arguments[2] != null) {
55 var textNode = document.createTextNode(arguments[2]);
56 obj.appendChild(textNode);
58 var len = arguments.length;
59 for (var i = 3; i < len; i += 2) {
60 obj.setAttribute(arguments[i], arguments[i+1]);
62 arguments[1].appendChild(obj);
66 // ----------------------------------------------------------------------------
67 // Find-position functions by PPK
68 // See http://www.quirksmode.org/js/findpos.html
69 // ----------------------------------------------------------------------------
70 function findPosX(obj) {
72 if (obj.offsetParent) {
73 while (obj.offsetParent) {
74 curleft += obj.offsetLeft - ((isOpera) ? 0 : obj.scrollLeft);
75 obj = obj.offsetParent;
77 // IE offsetParent does not include the top-level
78 if (isIE && obj.parentElement){
79 curleft += obj.offsetLeft - obj.scrollLeft;
87 function findPosY(obj) {
89 if (obj.offsetParent) {
90 while (obj.offsetParent) {
91 curtop += obj.offsetTop - ((isOpera) ? 0 : obj.scrollTop);
92 obj = obj.offsetParent;
94 // IE offsetParent does not include the top-level
95 if (isIE && obj.parentElement){
96 curtop += obj.offsetTop - obj.scrollTop;
104 //-----------------------------------------------------------------------------
105 // Date object extensions
106 // ----------------------------------------------------------------------------
107 Date.prototype.getCorrectYear = function() {
108 // Date.getYear() is unreliable --
109 // see http://www.quirksmode.org/js/introdate.html#year
110 var y = this.getYear() % 100;
111 return (y < 38) ? y + 2000 : y + 1900;
114 Date.prototype.getTwoDigitMonth = function() {
115 return (this.getMonth() < 9) ? '0' + (this.getMonth()+1) : (this.getMonth()+1);
118 Date.prototype.getTwoDigitDate = function() {
119 return (this.getDate() < 10) ? '0' + this.getDate() : this.getDate();
122 Date.prototype.getTwoDigitHour = function() {
123 return (this.getHours() < 10) ? '0' + this.getHours() : this.getHours();
126 Date.prototype.getTwoDigitMinute = function() {
127 return (this.getMinutes() < 10) ? '0' + this.getMinutes() : this.getMinutes();
130 Date.prototype.getTwoDigitSecond = function() {
131 return (this.getSeconds() < 10) ? '0' + this.getSeconds() : this.getSeconds();
134 Date.prototype.getISODate = function() {
135 return this.getCorrectYear() + '-' + this.getTwoDigitMonth() + '-' + this.getTwoDigitDate();
138 Date.prototype.getHourMinute = function() {
139 return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute();
142 Date.prototype.getHourMinuteSecond = function() {
143 return this.getTwoDigitHour() + ':' + this.getTwoDigitMinute() + ':' + this.getTwoDigitSecond();
146 // ----------------------------------------------------------------------------
147 // String object extensions
148 // ----------------------------------------------------------------------------
149 String.prototype.pad_left = function(pad_length, pad_string) {
150 var new_string = this;
151 for (var i = 0; new_string.length < pad_length; i++) {
152 new_string = pad_string + new_string;
157 // ----------------------------------------------------------------------------
158 // Get the computed style for and element
159 // ----------------------------------------------------------------------------
160 function getStyle(oElm, strCssRule){
162 if(document.defaultView && document.defaultView.getComputedStyle){
163 strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
165 else if(oElm.currentStyle){
166 strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
167 return p1.toUpperCase();
169 strValue = oElm.currentStyle[strCssRule];