__swapAction__ = null;
__swapAddr__ = null;
__swapResult__ = null;

function SwapFunction() {
	this.iframe = null;
	this.domain = /http:\/\/([a-z.]+)\//.exec(BASE_URL).slice(1);
}
SwapFunction.constructor = SwapFunction;

SwapFunction.prototype.sendData = function(currentAction, addr) {
	document.domain = this.domain;
    if(!this.iframe){
        (document.body || document.documentElement).appendChild(
            this.iframe = document.createElement("iframe")
        ).style.position = "absolute";
        this.iframe.style.width = this.iframe.style.height = "1px";
        this.iframe.style.top = this.iframe.style.left = "-10000px";
    };
   	__swapAction__ = currentAction;
   	__swapAddr__ = addr;
    this.iframe.src = BASE_URL;	
}