﻿// Ensure Root Namespaces are existing..

if( aspdnsf == undefined || aspdnsf == null ) {
    var aspdnsf = new function(){};
}

if( aspdnsf.Products == undefined || aspdnsf.Products == null ) {
    aspdnsf.Products = new function(){};
}

aspdnsf.Products.ToolTipControl = Class.create();
aspdnsf.Products.ToolTipControl.prototype = {
    
    initialize : function(id, clientId) {
        this.id = id;
        this.ctrl = $(clientId);
        
        this.backColor = '';
        this.display = '';
        this.width = 300;
    },
    
    setDisplay : function(display) {
        this.display = display;
    },
    
    setBackColor : function(backColor) {
        this.backColor = backColor;
    },
    
    setWidth : function(width) {
        this.width = width;
    },
    
    attach : function() {
        if(this.ctrl) {
            var display = this.display.unescapeHTML();
            var backColor = this.backColor;
            var width = this.width;
            
            if(ddrivetip) {
                this.ctrl.onmouseover = function(){ddrivetip(display, backColor, width)};
            }
            
            if(hideddrivetip) {
                this.ctrl.onmouseout = hideddrivetip;
            }
        }
    }    
    
}
