This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var x=String(229.123 >> 0); | |
1+parseInt(x.substring(0,1)) + "00000000000".substring(0,x.length-1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var day_by_date = function(y, m, d){ | |
return (d+=m<3?y--:y-2,Math.floor(23*m/9)+d+4+Math.floor(y/4)-Math.floor(y/100)+Math.floor(y/400))%7; | |
}; | |
['sun','mon','tue','wed','thu','fri','sat'][day_by_date(1987, 9, 10)] | |
from clindsey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DATE_REGEX = /^(\d{2})-(\d{2})-(\d{4})$/ | |
//////////////////////////////////////////////////////////////////////////////// | |
// // | |
// validateDate([object|string] oHTMLInputElement) - Validates a date value // | |
// =============================================== // | |
// You can pass in the id to an <input> Element, an actual // | |
// oHTMLInputElement or an actual date value in the form of a string // | |
// // | |
//////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// | |
// addClassName([object|string] oHTMLElement, string classNameToAdd) | |
// Adds classNameToAdd to an HTMLElement. Guaranteed not to add the same className twice. | |
// classNameToAdd can be a space separated list of classNames. | |
// You can pass in the id to an object or the actual object | |
// | |
//////////////////////////////////////////////////////////////////////////////// | |
function addClassName(oHTMLElement, classNameToAdd) { | |
if (typeof(oHTMLElement)=="string") { oHTMLElement = document.getElementById(oHTMLElement); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////// | |
// UTILITIES - Section contains general-purpose utilties // | |
// ========= // | |
//////////////////////////////////////////////////////////////////////////// | |
utilities : { | |
savedValueOf : new Object(), // savedValueOf will hold "original" values that we override/restore as needed | |
disableTextSelection : function() { | |
switch (true) { | |
case ( typeof document.onselectstart!="undefined" ) : // IE | |
this.savedValueOf["onselectstart"] = document.onselectstart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// | |
// showOrHide([object|string] oHTMLElement, boolean bShowOrHide) | |
// Shows or Hides an HTMLElement. | |
// You can pass in the id to an object or the actual object | |
// | |
//////////////////////////////////////////////////////////////////////////////// | |
function showOrHide(oHTMLElement, bShowOrHide) { | |
try { | |
if (typeof(oHTMLElement)=="string") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// EnsureMinimumNumberOfRows(element, params) - ensures a table will have a minimum | |
// ========================================== number of visible rows. | |
// Supported params are: | |
// numberOfRows - gives the minimum number of rows that will appear | |
// rowHeight - height, in pixels for added rows | |
// *NOTE: Does not support empty tables | |
//////////////////////////////////////////////////////////////////////////////// | |
function EnsureMinimumNumberOfRows(element, params) { | |
var minimumNumberOfRows = params.numberOfRows || 10, // default minimumNumberOfRows is 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// EnsureMinimumNumberOfRows(element, params) - ensures a table will have a minimum | |
// ========================================== number of visible rows. | |
// Supported params are: | |
// numberOfRows - gives the minimum number of rows that will appear | |
// rowHeight - height, in pixels for added rows | |
// *NOTE: Does not support empty tables | |
//////////////////////////////////////////////////////////////////////////////// | |
function EnsureMinimumNumberOfRows(element, params) { | |
var minimumNumberOfRows = params.numberOfRows || 10, // default minimumNumberOfRows is 10 |