﻿// JScript File


    function ImageName(s)
    {
        this.Path = "";
        this.Name = "";
        this.Extension = "";
        
        this.Initialize = function(s)
        {
            var s = new String(s);
            var iPoint = s.lastIndexOf(".");
            var iSlash = s.lastIndexOf("/");
                        
            this.Name = s;
            
            if(iPoint > -1)
            {
                this.Extension = s.substring(iPoint + 1);
                this.Name = this.Name.substring(0, iPoint);
            }
            
            if(iSlash > -1)
            {
                this.Path = s.substring(0, iSlash + 1);
                this.Name = this.Name.substring(iSlash + 1);
            }
        }
        
        this.Initialize(s);
    }
    
    function xl_AttachEvent(obj, evType, fn, useCapture)
    {
        if (!useCapture) var useCapture = true;
        if (obj.addEventListener)
        {
            obj.addEventListener(evType, fn, useCapture);
            return true;
        } 
        else 
            if (obj.attachEvent)
            {
                var r = obj.attachEvent("on"+evType, fn);
                return r;
            } 
            else 
            {
                return false;
            }
    }
    
    
    var _ResizeObject = null;
    
    //function ResizeObject(sObjectID, Padding)
    //{
    //    this.Object = window.document.getElementById(sObjectID);
    //    this.Padding = Padding;
    //}
    
    function Resize(sObjectID)
    {
        if(_ResizeObject == null)
            _ResizeObject = window.document.getElementById(sObjectID);
            
        var xOffset = window.document.body.offsetWidth;
        xOffset = xOffset / 2;
        xOffset -= _ResizeObject.offsetWidth / 2; //380; // 380 is the size of the 
       
        if(xOffset > 0)
            _ResizeObject.style.pixelLeft = xOffset;
        else
            _ResizeObject.style.pixelLeft = 20;
    }


