    //
    //  Browser Information
    // 

    var isIE = 0;		// Are we running under Internet Explorer?
    var isNav = 0;		// Are we running under Netscape Navigator?
    var Vnum  = 0;		// What version browser do we have?
    
    //  Determine our browser
    if (navigator.appName == 'Netscape'){
	if (document.layers) {
            layerRef = 'document.layers';
            styleSwitch = '';
	}
	isNav = 1;
	Vnum = navigator.appVersion.substring(0, 1);
    }
    else if (navigator.appName == 'Microsoft Internet Explorer'){
        if( document.all) {
	    layerRef = 'document.all';
            styleSwitch = '.style';
	}
	isIE = 1;
	Vnum = navigator.userAgent.substring(30, 31);
    }


	//
	//  Drag and Drop JavaScript routines
	//  These routines work with the 4.0 browsers: IE and Navigator
	//

	//  Set defaults
        currentX = currentY = 0;
        whichEl = null;

	//
	//  Move the object (onMouseMove)
	//
        function moveEl(e) {
             if (whichEl == null) { return false };
         
             if (isIE) {
                 newX = (event.clientX + document.body.scrollLeft);
                 newY = (event.clientY + document.body.scrollTop);
             }
             else {
                 newX = e.pageX;
                 newY = e.pageY;
             }
	
	     // Keep the objects within the styling area...
	     if (newX < 90) newX = 90;
	     if (newX > 750) newX = 750;
	     if (newY < 50) newY = 50;
	     if (newY > 450) newY = 450;


             distanceX = (newX - currentX);
             distanceY = (newY - currentY);
             currentX = newX;
             currentY = newY;
         
             if (isIE) {
                 whichEl.style.pixelLeft += distanceX;
                 whichEl.style.pixelTop += distanceY;
                 event.returnValue = false;
             }
             else { whichEl.moveBy(distanceX,distanceY); }
	
	     return false;
        }
         
	//
	// Grab the object  (onMouseDown)
	//
        function grabEl(e) {
            if (isIE) {
                 whichEl = event.srcElement;
         
                 while (whichEl.id.indexOf("DRAG") == -1) {
                     whichEl = whichEl.parentElement;
                     if (whichEl == null) { return true }
                 }
            }
            else {
                 mouseX = e.pageX;
                 mouseY = e.pageY;
         
		for ( i=0; i<document.layers.length; i++ ) {
		    tempLayer = document.layers[i];
		    if ( tempLayer.id.indexOf("DRAG") == -1 ) { continue }
		    if ( (mouseX > tempLayer.left) &&
				(mouseX < (tempLayer.left + tempLayer.clip.width)) 
			 && (mouseY > tempLayer.top) &&
				(mouseY < (tempLayer.top + tempLayer.clip.height)) ) {
			 whichEl = tempLayer;
		    }
		}
		if (whichEl == null) { return true };
            }
             if (whichEl != activeEl) {
                 if (isIE) { whichEl.style.zIndex = activeEl.style.zIndex + 1 }
                 else { whichEl.moveAbove(activeEl) };
                 activeEl = whichEl;
             }
         
             if (isIE) {
                 whichEl.style.pixelLeft = whichEl.offsetLeft;
                 whichEl.style.pixelTop = whichEl.offsetTop;
         
                 currentX = (event.clientX + document.body.scrollLeft);
                 currentY = (event.clientY + document.body.scrollTop); 
             }
             else {
                 currentX = e.pageX;
                 currentY = e.pageY;
         
                 document.captureEvents(Event.MOUSEMOVE);
                 document.onmousemove = moveEl;
             }
	     return false;
        }
         
	//
	//  Do we have a current object?  (only called for IE at startup)
	//
        function checkEl() {
             if (whichEl!=null) { return false }
        }
         
	//
	//  Let go of the object (onMouseUp)
	//
        function dropEl() {
	    if (whichEl != null){
		    if (isNav) { 
			document.releaseEvents(Event.MOUSEMOVE);
			document.onmousemove = void(0);
		    }
		    whichEl = null;
	    }
	    return false;
        }
         
	//
	//  Set the cursor image (IE only at this time)
	//
        function cursEl() {
	    //
	    //  Our DIV may have other elements within it (e.g. images);
	    //  we still want to turn the cursor into a hand.  Check if
	    //  we are withing a DRAGable div.
	    //
	    tmp = event.srcElement;

	    while (tmp.id.indexOf("DRAG") == -1) {
		 tmp = tmp.parentElement;
		 if (tmp == null) { return }
	    }
	    tmp.style.cursor = "hand";
        }
         
	//
	//  Set up the event management
	//
        if (isNav) {
                 document.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP);
                 //activeEl = document.elementName;		/* set in file */
        }
        else {
                 document.onmousemove = moveEl;
                 document.onselectstart = checkEl;
                 document.onmouseover = cursEl;
                 //activeEl = document.all.elementName;		/* set in file */
        }
        document.onmousedown = grabEl;
        document.onmouseup = dropEl;

