/***
 * Javascript code to support http://www.randallmuseum.org
 * Last updated: 23 May, 2009
 ***/



var IE = /*@cc_on!@*/false;
var IE6 = false /*@cc_on || @_jscript_version < 5.7 @*/;
var IE7 = false /*@cc_on || @_jscript_version >= 5.7 @*/;



String.prototype.trim = function() {
    a = this.replace(/^\s+/, "");
    return a.replace(/\s+$/, "");
};



init();



/* init start */
function init() {

    /* attach onload event */
    if ( typeof(window.onload) != "function" ) {
        window.onload = mainOnLoad;
    } else {
        
        var oldOnLoad = window.onload;
        window.onload = function() {
            oldOnLoad();
            mainOnLoad();
        };
    }

}
/* init end */



/* mainOnLoad start */
function mainOnLoad() {
    buildMenu();
    setSelectedMenuItem();
    //adjustHeight();
    //buildCheckButtons();
    //buildComboBoxes();
    //initMessageBoxes();
    
    if(IE6){
        iE6PngFix();
    }
}
/* mainOnLoad end */



/* buildMenu start */
function buildMenu() {
    var menu = document.getElementById("menu");
    var LIs = menu.getElementsByTagName("LI");
    
    for ( var i = 0; i < LIs.length; i ++ ) {
        
        if ( LIs[i].getElementsByTagName("LI").length > 0 ) {
            LIs[i].className += " parent";
        }
        
        if ( IE6 ) {
            LIs[i].onmouseover = function () { 
                this.className += " hover" + (this.className.indexOf("parent") != -1 ? " parenthover" : "");
            }
            LIs[i].onmouseout = function () {
                this.className = this.className.replace(/parenthover/gi, "").trim().replace(/hover/gi, "").trim();
            }
        }
    }
}
/* buildMenu end */



/* setSelectedMenuItem start */
function setSelectedMenuItem() {
    var menu = document.getElementById("menu");
    if ( !menu )
        return;
    
    var UL = menu.getElementsByTagName("UL").length > 0 ? menu.getElementsByTagName("UL")[0] : null;
    var LIs = !UL ? null : UL.childNodes;
    
    isSelected(LIs);
}
/* setSelectedMenuItem end */



/* isSelected start */
function isSelected(LIs) {
    if ( !LIs )
        return false;
    
    var href = null;
    var childUL = null;
    var childLIs = null;
    var pageUrl = window.location.href.split("?")[0];
    var isFoundAtleaseOneSelected = false;
    
    for ( var i = 0; i < LIs.length; i++ ) {
        
        if ( LIs[i].nodeName.toLowerCase() != "li" )
            continue;
        
        href = LIs[i].getElementsByTagName("A").length > 0 ? LIs[i].getElementsByTagName("A")[0].href.split("?")[0] : null;
        childUL = LIs[i].getElementsByTagName("UL").length > 0 ? LIs[i].getElementsByTagName("UL")[0] : null;
        childLIs = !childUL ? null : childUL.childNodes;
        
        if ( isSelected(childLIs) || href == pageUrl ) {
            isFoundAtleaseOneSelected = true;
            if( LIs[i].className.indexOf("selected") == -1 )
                LIs[i].className += " selected";
            
        } else {
            LIs[i].className = LIs[i].className.replace(/selected/gi, "").trim();
        }
    }
    
    return isFoundAtleaseOneSelected;
}
/* isSelected end */



/* initMessageBoxes start */
/*
function initMessageBoxes() {
    var elems = document.getElementsByTagName("*");
    
    for ( var i = 0; i < elems.length; i++ )
        if ( elems[i].className == "messagebox" )
            new MessageBox( elems[i] );
}
*/
/* initMessageBoxes end */



/* centerElement start */
/*
function centerElement(elem) {
    if( !elem )
        return;
    
    var dim = getInnerDimension();
    
    elem.style.left = ((dim["width"] - elem.offsetWidth) / 2) + "px";
    elem.style.top = ((dim["height"] - elem.offsetHeight) / 2) + "px";
    elem.style.position = "fixed";
}
*/
/* centerElement end */



/* getStyle start */
/*
function getStyle(element, styleName) {
    if( !element || !styleName )
        return null;
    
    if ( document.defaultView && document.defaultView.getComputedStyle ) {
        var styles = document.defaultView.getComputedStyle(element, "");
        if ( styles && styles.getPropertyValue(styleName) )
            return styles.getPropertyValue(styleName);
    } else if( element.currentStyle ) {
        // replace each "-[character]" by "[capital character]"
        styleName = (styleName == "float") ? "styleFloat" : styleName.replace(/(\-([a-z]){1})/g, function () { return arguments[2].toUpperCase(); } );
        if(element.currentStyle[styleName])
            return element.currentStyle[styleName];
    }
    
    return element.style[styleName] ? element.style[styleName] : null;
}
*/
/* getStyle end */



/* setStyle start */
/*
function setStyle(element, styleName, styleValue) {
    if( !element || !styleName )
        return false;
    
    if ( element.style.setProperty ) {
        element.style.setProperty( styleName, styleValue, null );
    } else if( element.style.setAttribute ) {
        // replace each "-[character]" by "[capital character]"
        styleName = (styleName == "float") ? "styleFloat" : styleName.replace(/(\-([a-z]){1})/g, function () { return arguments[2].toUpperCase(); } );
        element.style.setAttribute( styleName, styleValue );
    }
    
    return true;
}
*/
/* setStyle end */



/* getInnerDimension start */
/*
function getInnerDimension() {
    var dimension = new Array();
    dimension["width"] = 0;
    dimension["height"] = 0;
    
    if( typeof( window.innerWidth ) == "number" ) {
        dimension["width"] = window.innerWidth;
        dimension["height"] = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
        dimension["width"] = document.documentElement.clientWidth;
        dimension["height"] = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
        dimension["width"] = document.body.clientWidth;
        dimension["height"] = document.body.clientHeight;
    }
    
    return dimension;
}
*/
/* getInnerDimension end */



/* adjustHeight start */
/*
function adjustHeight(){
    var innerDimension = getInnerDimension();
    var wrapper = document.getElementById("wrapper");
    var footer = document.getElementById("footer");
    
    if( !wrapper || !footer )
        return;
    
    var pageHeight = (footer.style.position == "absolute") ? (wrapper.offsetHeight + footer.offsetHeight) : wrapper.offsetHeight;
    
    if( pageHeight <= innerDimension["height"] )
        footer.style.position = "absolute";
    else
        footer.style.position = "static";
    
    setTimeout("adjustHeight()", 100);
}
*/
/* adjustHeight end */



/* iE6PngFix start */
function iE6PngFix(){
    var elems = document.getElementsByTagName("*");
    
    for(var i = 0; i < elems.length; i++){
        if( (elems[i].nodeName.toLowerCase() == "img" && elems[i].src.indexOf(".png") != -1) ){
            elems[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src = '" + elems[i].src + "', sizingMethod='image')";
            elems[i].src = "images/clear.gif";
        }
    }
}
/* iE6PngFix end */



/* show start */
function show(elementId){
    var element = elementId && typeof(elementId)=="object" ? elementId : document.getElementById(elementId);
	if( !element )
	    return;
	element.style.display = "block";
	element.style.visibility = "visible";
}
/* show end */



/* hide start */
function hide(elementId){
    var element = elementId && typeof(elementId)=="object" ? elementId : document.getElementById(elementId);
	if( !element )
	    return;
	element.style.display = "none";
	element.style.visibility = "hidden";
}
/* hide end */



/* transparent start */
function transparent(elementId, transparentValue){
    var element = elementId && typeof(elementId)=="object" ? elementId : document.getElementById(elementId);
	
	if( !element )
	    return;
    
    if( !(transparentValue >= 0 && transparentValue <= 1) )
        return alert( "invalid transparentValue [" + transparentValue + "]" );
    
	if( !IE )
	    element.style.opacity = transparentValue;
	else
	    element.style.filter = "alpha(opacity: " + (transparentValue * 100) + ")";
}
/* transparent end */



/* tabPageSelected start */
/*
function tabPageSelected(tabControlId, selectedTapPage){
    var tabControl = document.getElementById(tabControlId);
    
    if( !tabControl || tabControl.className.indexOf("tab-control") == -1 )
        return alert("invalid tab control id [" + tabControlId + "]" );
    
    if( selectedTapPage.className.indexOf("tab-page") == -1 )
        return alert("invalid tab page");
    
    if( selectedTapPage.className.indexOf("selected") != -1 )
        return false;
    
    var childControls = tabControl.getElementsByTagName("*");
    
    for(var i = 0; i < childControls.length; i++){
        
        if( childControls[i].className.indexOf("tab-page") != -1 ) {
            
            if( childControls[i] == selectedTapPage )
                childControls[i].className += " selected";
            else 
                childControls[i].className = childControls[i].className.replace(/selected/gi, "").trim();
            
        }
    }
    
    return true;
}
*/
/* tabPageSelected end */



/* buildCheckButtons start */
function buildCheckButtons() {
    var elems = document.getElementsByTagName("input");
    
    for( var i = 0; i < elems.length; i++ ) {
        
        if( elems[i].type.toLowerCase() == "checkbox" )
            insertNewCheckButton("images/checkbox.png", "images/checkbox_checked.png", elems[i]);
        else if( elems[i].type.toLowerCase() == "radio" )
            insertNewCheckButton("images/radio.png", "images/radio_checked.png", elems[i]);
    }
    
    setCheckButtonsImageSize();
}
/* buildCheckButtons end */



/* insertNewCheckButton start */
function insertNewCheckButton(image, checkedImage, htmlInput) {
    var layout = document.createElement("div");
    var container = document.createElement("span");
    var img = document.createElement("img");
    var parent = htmlInput.parentNode;
    var isChecked = htmlInput.checked;
    var clonedButton = htmlInput.cloneNode(true);
    clonedButton.checked = isChecked;
    
    
    /** Insert the new constructed button before the original button then remove it **/
    
    container.appendChild(img);
    container.appendChild(clonedButton);
    layout.appendChild(container);
    parent.insertBefore(layout, htmlInput);
    parent.removeChild(htmlInput);
    
    
    /** Attach events **/
    
    container.onclick = function () {
        var elems = document.getElementsByTagName("input");
        for( var i = 0; i < elems.length; i++ ) {
            if( elems[i].type.toLowerCase() != "checkbox" && elems[i].type.toLowerCase() != "radio" ) {
                continue;
            }
            var image = elems[i].parentNode.getElementsByTagName("img")[0];
            image.src = !elems[i].checked ? image.alt.split(":")[0] : image.alt.split(":")[1];
            if( IE6 ) {
                iE6PngFix();
            }
        }
    };
    
    
    /** Copy the important styles like : Classification, Box, Positioning and Font Properties **/
    
    //var cssStylesArray = new Array("bottom", "clear", "cursor", "direction", "display", "filter", "float", "font", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "height", "left", "letter-spacing", "line-height", "margin-bottom", "margin-left", "margin-right", "margin-top", "max-height", "max-width", "min-height", "min-width", "opacity", "position", "right", "top", "vertical-align", "visibility", "width", "z-index");
    //for( var i = 0; i < cssStylesArray.length; i++ ) {
        //setStyle(layout, cssStylesArray[i], getStyle(clonedButton, cssStylesArray[i]));
    //}
    
    layout.style.display = "inline";
    
    /** Set the inner elements-properties and styles **/
    
    transparent(clonedButton, 0);
    
    img.alt = image + ":" + checkedImage;
    img.src = !clonedButton.checked ? image : checkedImage;
    img.style.position = "absolute";
    
    container.style.position = clonedButton.style.position = "relative";
    container.style.display = img.style.display = clonedButton.style.display = "inline-block";
    
    layout.style.padding = 
    layout.style.border = 
    layout.style.outline = 
    layout.style.background = 
    
    container.style.margin = 
    container.style.padding = 
    container.style.left = 
    container.style.top = 
    container.style.border = 
    container.style.outline = 
    container.style.background = 
    container.style.lineHeight = 
    
    img.style.margin = 
    img.style.padding = 
    img.style.left = 
    img.style.top = 
    img.style.border = 
    img.style.outline = 
    img.style.background = 
    img.style.lineHeight = 
    
    clonedButton.style.margin = 
    clonedButton.style.padding = 
    clonedButton.style.left = 
    clonedButton.style.top = 
    clonedButton.style.border = 
    clonedButton.style.outline = 
    clonedButton.style.background = 
    clonedButton.style.lineHeight = 
    "0";
}
/* insertNewCheckButton end */



/* setCheckButtonsImageSize start */
function setCheckButtonsImageSize(){
    var elems = document.getElementsByTagName("input");
    
    for( var i = 0; i < elems.length; i++ ) {
        
        if( elems[i].type.toLowerCase() != "checkbox" && elems[i].type.toLowerCase() != "radio" ) {
            continue;
        }
        
        var img = elems[i].parentNode.getElementsByTagName("img")[0];
        
        if( !img.complete ) {
            setTimeout( "setCheckButtonsImageSize()", 0);
            return;
        }
        
        var layout = elems[i].parentNode.parentNode;
        var container = elems[i].parentNode;
        var button = elems[i];
        
        layout.style.width = container.style.width = button.style.width = img.offsetWidth + "px";
        layout.style.height = container.style.height = button.style.height = img.offsetHeight + "px";
    }
}
/* setCheckButtonsImageSize end */



/* buildComboBoxes start */
function buildComboBoxes() {
    var elems = document.getElementsByTagName("select");
    
    for( var i = 0; i < elems.length; i++ ) {
        insertNewComboBox(elems[i], i);
    }
}
/* buildComboBoxes end */



/* insertNewComboBox start */
function insertNewComboBox(htmlSelect, index) {
    var layout = document.createElement("div");
    var container = document.createElement("span");
    var innerContainer = document.createElement("span");
    var textContainer = document.createElement("span");
    var dropdownContainer = document.createElement("span");
    var optionsTexts = new Array();
    var parent = htmlSelect.parentNode;
    var selectedText = htmlSelect.options.length > 0 ? htmlSelect.options[htmlSelect.selectedIndex].text : "";
    
    
    /** Insert the new constructed combox before the original combox **/
    
    for( var i = 0; i < htmlSelect.options.length ; i++ ) {
        // Insert options
        optionsTexts[i] = document.createElement("a");
        dropdownContainer.appendChild(optionsTexts[i]);
    }
    innerContainer.appendChild( textContainer );
    innerContainer.appendChild( dropdownContainer );
    container.appendChild( innerContainer );
    layout.appendChild( container );
    parent.insertBefore( layout, htmlSelect );
    
    
    /** Copy the important styles like : Classification, Box, Positioning and Font Properties **/
    
    //var cssStylesArray = new Array("accelerator", "azimuth", "background", "background-attachment", "background-color", "background-image", "background-position", "background-position-x", "background-position-y", "background-repeat", "behavior", "border", "border-bottom", "border-bottom-color", "border-bottom-style", "border-bottom-width", "border-collapse", "border-color", "border-left", "border-left-color", "border-left-style", "border-left-width", "border-right", "border-right-color", "border-right-style", "border-right-width", "border-spacing", "border-style", "border-top", "border-top-color", "border-top-style", "border-top-width", "border-width", "bottom", "caption-side", "clear", "clip", "color", "content", "counter-increment", "counter-reset", "cue", "cue-after", "cue-before", "cursor", "direction", "display", "elevation", "empty-cells", "filter", "float", "font", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "height", "ime-mode", "include-source", "layer-background-color", "layer-background-image", "layout-flow", "layout-grid", "layout-grid-char", "layout-grid-char-spacing", "layout-grid-line", "layout-grid-mode", "layout-grid-type", "left", "letter-spacing", "line-break", "line-height", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "marker-offset", "marks", "max-height", "max-width", "min-height", "min-width", "-moz-binding", "-moz-border-radius", "-moz-border-radius-topleft", "-moz-border-radius-topright", "-moz-border-radius-bottomright", "-moz-border-radius-bottomleft", "-moz-border-top-colors", "-moz-border-right-colors", "-moz-border-bottom-colors", "-moz-border-left-colors", "-moz-opacity", "-moz-outline", "-moz-outline-color", "-moz-outline-style", "-moz-outline-width", "-moz-user-focus", "-moz-user-input", "-moz-user-modify", "-moz-user-select", "orphans", "outline", "outline-color", "outline-style", "outline-width", "overflow", "overflow-X", "overflow-Y", "padding", "padding-bottom", "padding-left", "padding-right", "padding-top", "page", "page-break-after", "page-break-before", "page-break-inside", "pause", "pause-after", "pause-before", "pitch", "pitch-range", "play-during", "position", "quotes", "-replace", "richness", "right", "ruby-align", "ruby-overhang", "ruby-position", "-set-link-source", "size", "speak", "speak-header", "speak-numeral", "speak-punctuation", "speech-rate", "stress", "scrollbar-arrow-color", "scrollbar-base-color", "scrollbar-dark-shadow-color", "scrollbar-face-color", "scrollbar-highlight-color", "scrollbar-shadow-color", "scrollbar-3d-light-color", "scrollbar-track-color", "table-layout", "text-align", "text-align-last", "text-decoration", "text-indent", "text-justify", "text-overflow", "text-shadow", "text-transform", "text-autospace", "text-kashida-space", "text-underline-position", "top", "unicode-bidi", "-use-link-source", "vertical-align", "visibility", "voice-family", "volume", "white-space", "widows", "width", "word-break", "word-spacing", "word-wrap", "writing-mode", "z-index", "zoom");
    //var cssStylesArray = new Array("bottom", "clear", "display", "filter", "float", "margin-bottom", "margin-left", "margin-right", "margin-top", "opacity", "position", "right", "top", "vertical-align", "visibility", "z-index");
    //var cssStylesArray = new Array("bottom", "clear", "cursor", "direction", "display", "filter", "float", "font", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "height", "left", "letter-spacing", "line-height", "margin-bottom", "margin-left", "margin-right", "margin-top", "max-height", "max-width", "min-height", "min-width", "opacity", "position", "right", "top", "vertical-align", "visibility", "width", "z-index");
    //for( var i = 0; i < cssStylesArray.length; i++ ) {
        //setStyle(layout, cssStylesArray[i], getStyle(htmlSelect, cssStylesArray[i]));
    //}
    
    
    /** Attach events **/
    
    container.onmouseover = function () {
        if( this.className.indexOf("hover") == -1 )
            this.className += " hover";
    };
    
    container.onmouseout = function () {
        if( this.className.indexOf("hover") != -1 )
            this.className = this.className.replace(/hover/gi, "").trim();
    };
    
    container.onmouseup = function () {
        if ( this.className.indexOf("clicked") != -1 ) {
            //document.onmousedown = null;
            this.className = this.className.replace(/clicked/gi, "").trim();
        } else {
            var elems = this.getElementsByTagName("*");
            var count = 0;
            for( var i = 0; i < elems.length; i ++) {
                if( elems[i].className == "combobox-dropdown-option" )
                    count++;
            }
            if( count > 0 ) {
                this.className += " clicked";
                //document.onmousedown = function () {
                    //closeAllDropDowns();
                //};
            }
        }
    };
    
    /*
    var closeAllDropDowns = function () {
        var selects = document.getElementsByTagName("select");
        
        for ( var i = 0; i < selects.length; i ++ ) {
            var container = selects[i].parentNode.parentNode.parentNode;
            container.className = container.className.replace(/clicked/gi, "").trim();
        }
    };
    */
    
    var onOptionClicked = function () {
        var dropdownContainer = this.parentNode;
        var htmlSelect = dropdownContainer.getElementsByTagName("select")[0];
        var textContainer = dropdownContainer.previousSibling;
        var elems = dropdownContainer.getElementsByTagName("*");
        
        for( var i = 0, index = 0; i < elems.length; i++ ) {
            if( elems[i].className == "combobox-dropdown-option" ) {
                if ( elems[i] == this ) {
                    textContainer.innerHTML = elems[i].innerHTML;
                    htmlSelect.selectedIndex = index;
                    htmlSelect.onchange();
                }
                index ++;
            }
        }
    };
    
    
    /** Set the inner elements-properties and styles **/
    
    //layout.style.display = "inline";
    layout.style.position = "relative";
    layout.style.zIndex = 10000 - index;
    
    htmlSelect.className = "";
    container.className = "combobox";
    innerContainer.className = "combobox-inner";
    textContainer.className = "combobox-text";
    dropdownContainer.className = "combobox-dropdown";
    
    textContainer.title = selectedText;
    textContainer.innerHTML = selectedText;
    
    for( var i = 0; i < htmlSelect.options.length ; i++ ) {
        optionsTexts[i].innerHTML = htmlSelect.options[i].text;
        optionsTexts[i].className = "combobox-dropdown-option";
        optionsTexts[i].title = htmlSelect.options[i].text;
        optionsTexts[i].href = "javascript:;";
        optionsTexts[i].onmousedown = onOptionClicked;
    }
    
    dropdownContainer.style.display = "block";
    container.style.width = innerContainer.style.width = dropdownContainer.offsetWidth + "px";
    dropdownContainer.style.overflow = "auto";
    dropdownContainer.style.overflowX = "hidden";
    var height = dropdownContainer.offsetHeight;
    dropdownContainer.style.height = "auto";
    if ( dropdownContainer.offsetHeight > height )
        dropdownContainer.style.height = height + "px";
    dropdownContainer.style.display = "";
    
    hide(htmlSelect);
    dropdownContainer.appendChild(htmlSelect);
}
/* insertNewComboBox end */





/*
function MessageBox(messageBoxElem) {
    var _box = messageBoxElem;
    var _childNodes = _box.getElementsByTagName("*");
    var _isMovable = false;
    var _mouseClickedOffsetX = 0;
    var _mouseClickedOffsetY = 0;
    var _offsetLeft = 0;
    var _offsetTop = 0;
    
    init();
    
    centerElement(_box);
    _box.style.visibility = "visible";
    _box.style.display = "block";
    
    ///// functions
    
    function init() {
        for ( var i = 0; i < _childNodes.length; i++ ) {
            if ( _childNodes[i].className.indexOf("messagebox-fadeinout") != -1 )
                _childNodes[i].onclick = fadeInOut;
            else if ( _childNodes[i].className.indexOf("messagebox-drag") != -1 ) {
                _childNodes[i].onmousedown = onmousedown;
                _childNodes[i].ondblclick = fadeInOut;
            }
        }
    };
    
    // events functions
    
    function fadeInOut() {
        if ( _box.className.indexOf("messagebox-faded") != -1 ) {
            _box.style.width = _box.style.height = ""; // reset the box width and height to default (auto)
            _box.style.left = _offsetLeft + "px"; // return the box left and top to last state
            _box.style.top = _offsetTop + "px";
            _box.className = _box.className.replace(/messagebox-faded/gi, "").trim();
        } else {
            var widthD = 150;
            var heightD = 60;
            var limitWidth = parseInt(getStyle(_box, "min-width")) ? getStyle(_box, "min-width") : "0px";
            var limitHeight = parseInt(getStyle(_box, "min-height")) ? getStyle(_box, "min-height") : "0px";
            
            if( (_box.offsetWidth - widthD) >= parseInt(limitWidth) )
                _box.style.width = (_box.offsetWidth - widthD) + "px";
            else
                _box.style.width = limitWidth;
            
            if( (_box.offsetHeight - heightD) >= parseInt(limitHeight) ) 
                _box.style.height = (_box.offsetHeight - heightD) + "px";
            else
                _box.style.height = limitHeight;
            
            if ( _box.style.width == limitWidth && _box.style.height == limitHeight ) {
                _box.className += " messagebox-faded";
                _offsetLeft = _box.offsetLeft;
                _offsetTop = _box.offsetTop;
                _box.style.left = _box.style.top = "0px";
                return;
            }
            
            if ( !window.messageBoxFadeInOut )
                window.messageBoxFadeInOut = fadeInOut;
            
            setTimeout("window.messageBoxFadeInOut()", 1);
        }
    };
    
    function onmousedown(e) {
        e = e ? e : window.event;
        if ( e.button > 1 ) return false;
        _mouseClickedOffsetX = e.clientX - _box.offsetLeft;
	    _mouseClickedOffsetY = e.clientY - _box.offsetTop;
        _box.style.border = "dashed 1px #777";
        _isMovable = true;
        document.onmousemove = onmousemove;
        document.onmouseup = onmouseup;
        return false;
    };
    
    function onmousemove(e) {
	    if( _isMovable ) {
            e = e ? e : window.event;
	        _box.style.left = (e.clientX - _mouseClickedOffsetX) + "px";
            _box.style.top = (e.clientY - _mouseClickedOffsetY) + "px";
        }
        return false;
    };
    
    function onmouseup(e) {
        _isMovable = false;
        _box.style.border = "";
        document.onmousemove = null;
        document.onmouseup = null;
    };
}
*/