BwClasses["BwLinkDC"] = BwLinkDC;

function BwLinkDC ()
{
	this.isa = BwWidget;
	this.isa();
	
    this.dcurl= null;
    
	this.initFromDOM = BwLinkDC.initFromDOM;
	
    this.setUrl = BwLinkDC.setUrl;
//	this.getUrl = BwLinkDC.getUrl;

    this.setValue = BwLinkDC.setValue;
	this.getValue = BwLinkDC.getValue;
}

BwLinkDC.newInstance = function ( LinkDCName, LinkDCUrl, LinkDCValue )
{
	var self = document.createElement ("A");
	
	self.BwClass = BwLinkDC;
	self.BwClass();

	self.className = "BwLinkDC";
	
	if (LinkDCUrl==null) {
		self.setAttribute ("href", "#");
	} else {
		self.setAttribute ("href", "javascript:onchangetable(" + LinkDCUrl + ","+LinkDCValue+")");
		self.dcurl="javascript:onchangetable(" + LinkDCUrl + ","+LinkDCValue+")";
	}
	
	if (LinkDCName) {
		self.setAttribute ("title", LinkDCName);
	}
	
	self.initFromDOM();
	
	return self;
};

BwLinkDC.initFromDOM = function ()
{
	BwWidget.initFromDOM.call (this);
	
	this.style.cursor="pointer";
	var LinkDCName = this.getAttribute ("title");

	if (LinkDCName != null)
		this.setValue (LinkDCName);
	if( this.dcurl != null )
		this.setUrl( this.dcurl );

    return false;
};

BwLinkDC.setUrl = function (u)
{
    this.dcurl = u;
    this.href=u;
};
/*
BwLinkDC.getUrl = function ()
{
    var u = this.url;
    if (u==null) return null;
	return u;
};
*/
BwLinkDC.getValue = function ()
{
	return this.innerHTML;
};

BwLinkDC.setValue = function (LinkDC)
{
	this.innerHTML = LinkDC;
};


