﻿if (typeof(furiousAngel) == 'undefined') {
    var furiousAngel = new Object();
}
if (typeof(furiousAngel.ui) == 'undefined') {
    furiousAngel.ui = new Object();
}
if (typeof(furiousAngel.ui.adapters) == 'undefined') {
    furiousAngel.ui.adapters = new Object();
}

furiousAngel.ui.adapters.linkButtonAdapter = function(clientId, text, href) {
    this._clientId = clientId;
    this._text = text;
    this._href = href;
}

furiousAngel.ui.adapters.linkButtonAdapter.prototype = {
	get_element: function() {
		return document.getElementById(this._clientId);
	},
	get_text: function() {
		return this._text;
	},
	get_href: function() {
		return this._href;
	},
	initialise: function() {
		this.get_element().parentNode.replaceChild(this._createLinkButton(this.get_element()), this.get_element());
	},
	_createLinkButton: function(el) {
		var link = document.createElement('a');
		link.setAttribute('href', this.get_href());
		if (!(link.innerHTML = this.get_text())) {
			link.innerHTML = el.innerHTML;
		}
		return link;
	}
}
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();