/*
 * Copyright (c) 2006-2007 Collactive. All rights reserved.
 */
if (typeof(Collactive) == 'undefined') {
	Collactive = {};
}

Collactive.SSAUtils = {
    _active: false,
    
    getWindow: function() {
		return window.top;
    },

    init: function(callback, contentIframe) {
		this._userCallback = callback;
        this._contentIframe = contentIframe;
    },

    activateProxy: function() {
        document.domain = "collactive.com";
        if (this._contentIframe != null && this._contentIframe.src != null) {
	        this._contentIframe.src = Collactive.ProxyUtils.proxify(this._contentIframe.src);
        }
        this._active = true;
    },
    
    isActive: function() {
        return this._active;
    },

	_callback: function(args) {
		if (this._userCallback) {
			this._userCallback.apply({}, args);
		}
	},

	notifyOperation: function(operationName) {
	   // TODO: call top frame's notifyOperation??
	   if (notifyOperation) {
	       notifyOperation(operationName);
	   }
	}
};
