• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

HM_ScriptDOM

This is a long script, so we're going to look at it piece by piece. We'll start by looking at the first section in Example 13-1.

Example 13-1. Initial code in HM_ScriptDOM

/*HM_ScriptDOM.js
* by Peter Belesis. v4.1.3 011108
* Copyright (c) 2001 Peter Belesis. All Rights Reserved.
* Originally published and documented at
* http://www.dhtmlab.com/
* Available solely from INT Media Group. Incorporated under
* exclusive license.
* Contact licensing@internet.com for more information.
*/

HM_IE5M = HM_IE && HM_Mac;
HM_IE5W = HM_IE && !HM_Mac;
HM_NS6 = (navigator.vendor == ("Netscape6") ||
    navigator.product == ("Gecko"));
HM_IEpos = HM_IE || (HM_NS6 &&
    parseInt(navigator.productSub)>=20010710);
HM_IECSS = (HM_IE && document.compatMode) ?
    document.compatMode ==  "CSS1Compat" : false;
HM_IEDTD = (HM_IE && document.doctype) ?
    document.doctype.name.indexOf(".dtd")!=-1 : HM_IECSS;

HM_IEnoDTD = HM_IE && !HM_IEDTD;

HM_a_Parameters = [
    ["MenuWidth",          150,           "number"],
    ["FontFamily",         "Arial,sans-serif"],
    ["FontSize",           10,            "number"],
    ["FontBold",           false,         "boolean"],
    ["FontItalic",         false,         "boolean"],
    ["FontColor",          "black"],
    ["FontColorOver",      "white"],
    ["BGColor",            "white"],
    ["BGColorOver",        "black"],
    ["ItemPadding",        3,            "number"],
    ["BorderWidth",        2,             "number"],
    ["BorderColor",        "red"],
    ["BorderStyle",        "solid"],
    ["SeparatorSize",      1,             "number"],
    ["SeparatorColor",     "yellow"],
    ["ImageSrc",           null],
    ["ImageSrcOver",       null],
    ["ImageSrcLeft",       null],
    ["ImageSrcLeftOver",   null],
    ["ImageSize",          5,            "number"],
    ["ImageHorizSpace",    0,              "number"],
    ["ImageVertSpace",     0,          "number"],
    ["KeepHilite",         false,       "boolean"],
    ["ClickStart",         false,       "boolean"],
    ["ClickKill",          true,        "boolean"],
    ["ChildOverlap",       20,          "number"],
    ["ChildOffset",        10,          "number"],
    ["ChildPerCentOver",   null,        "number"],
    ["TopSecondsVisible",  .5,          "number"],
    ["ChildSecondsVisible",.3,          "number"],
    ["StatusDisplayBuild", 1,           "boolean"],
    ["StatusDisplayLink",  1,           "boolean"],
    ["UponDisplay",        null,        "delayed"],
    ["UponHide",           null,        "delayed"],
    ["RightToLeft",        false,       "boolean"],
    ["CreateTopOnly",      0,           "boolean"],
    ["ShowLinkCursor",     false,       "boolean"]
]

HM_MenuIDPrefix = "HM_Menu";
HM_ItemIDPrefix = "HM_Item";
HM_ArrayIDPrefix = "HM_Array";

Function.prototype.isFunction = true;
Function.prototype.isString = false;

String.prototype.isFunction = false;
String.prototype.isString = true;
String.prototype.isBoolean = false;
String.prototype.isNumber = false;

Number.prototype.isString = false;
Number.prototype.isFunction = false;
Number.prototype.isBoolean = false;
Number.prototype.isNumber = true;

Boolean.prototype.isString = false;
Boolean.prototype.isFunction = false;
Boolean.prototype.isBoolean = true;
Boolean.prototype.isNumber = false;

Array.prototype.itemValidation = false;
Array.prototype.isArray = true;

if(HM_IE) {
    HM_a_ElementsCreated = [];
    function HM_f_StoreElement(el)
{
       HM_a_ElementsCreated
            [HM_a_ElementsCreated.length] = el;
    }

    (HM_IEcanvas = null;
}


					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint