// onverse javascript compiled Sat Mar 13 20:47:11 2010 GMT



// source: ../www.onverse.com/Website/web/js/onverse/sha1.js

/*
 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
 * in FIPS PUB 180-1
 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
 * Distributed under the BSD License
 * See http://pajhome.org.uk/crypt/md5 for details.
 */

/*
 * Configurable variables. You may need to tweak these to be compatible with
 * the server-side, but the defaults work in most cases.
 */
var hexcase = 0;  /* hex output format. 0 - lowercase; 1 - uppercase        */
var b64pad  = ""; /* base-64 pad character. "=" for strict RFC compliance   */
var chrsz   = 8;  /* bits per input character. 8 - ASCII; 16 - Unicode      */

/*
 * These are the functions you'll usually want to call
 * They take string arguments and return either hex or base-64 encoded strings
 */
function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}

/*
 * Perform a simple self-test to see if the VM is working
 */
function sha1_vm_test()
{
  return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
}

/*
 * Calculate the SHA-1 of an array of big-endian words, and a bit length
 */
function core_sha1(x, len)
{
  /* append padding */
  x[len >> 5] |= 0x80 << (24 - len % 32);
  x[((len + 64 >> 9) << 4) + 15] = len;

  var w = Array(80);
  var a =  1732584193;
  var b = -271733879;
  var c = -1732584194;
  var d =  271733878;
  var e = -1009589776;

  for(var i = 0; i < x.length; i += 16)
  {
    var olda = a;
    var oldb = b;
    var oldc = c;
    var oldd = d;
    var olde = e;

    for(var j = 0; j < 80; j++)
    {
      if(j < 16) w[j] = x[i + j];
      else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
      var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
                       safe_add(safe_add(e, w[j]), sha1_kt(j)));
      e = d;
      d = c;
      c = rol(b, 30);
      b = a;
      a = t;
    }

    a = safe_add(a, olda);
    b = safe_add(b, oldb);
    c = safe_add(c, oldc);
    d = safe_add(d, oldd);
    e = safe_add(e, olde);
  }
  return Array(a, b, c, d, e);

}

/*
 * Perform the appropriate triplet combination function for the current
 * iteration
 */
function sha1_ft(t, b, c, d)
{
  if(t < 20) return (b & c) | ((~b) & d);
  if(t < 40) return b ^ c ^ d;
  if(t < 60) return (b & c) | (b & d) | (c & d);
  return b ^ c ^ d;
}

/*
 * Determine the appropriate additive constant for the current iteration
 */
function sha1_kt(t)
{
  return (t < 20) ?  1518500249 : (t < 40) ?  1859775393 :
         (t < 60) ? -1894007588 : -899497514;
}

/*
 * Calculate the HMAC-SHA1 of a key and some data
 */
function core_hmac_sha1(key, data)
{
  var bkey = str2binb(key);
  if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);

  var ipad = Array(16), opad = Array(16);
  for(var i = 0; i < 16; i++)
  {
    ipad[i] = bkey[i] ^ 0x36363636;
    opad[i] = bkey[i] ^ 0x5C5C5C5C;
  }

  var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
  return core_sha1(opad.concat(hash), 512 + 160);
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
 * to work around bugs in some JS interpreters.
 */
function safe_add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left.
 */
function rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * Convert an 8-bit or 16-bit string to an array of big-endian words
 * In 8-bit function, characters >255 have their hi-byte silently ignored.
 */
function str2binb(str)
{
  var bin = Array();
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < str.length * chrsz; i += chrsz)
    bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32);
  return bin;
}

/*
 * Convert an array of big-endian words to a string
 */
function binb2str(bin)
{
  var str = "";
  var mask = (1 << chrsz) - 1;
  for(var i = 0; i < bin.length * 32; i += chrsz)
    str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask);
  return str;
}

/*
 * Convert an array of big-endian words to a hex string.
 */
function binb2hex(binarray)
{
  var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i++)
  {
    str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
           hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8  )) & 0xF);
  }
  return str;
}

/*
 * Convert an array of big-endian words to a base-64 string
 */
function binb2b64(binarray)
{
  var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  var str = "";
  for(var i = 0; i < binarray.length * 4; i += 3)
  {
    var triplet = (((binarray[i   >> 2] >> 8 * (3 -  i   %4)) & 0xFF) << 16)
                | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
                |  ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
    for(var j = 0; j < 4; j++)
    {
      if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
      else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
    }
  }
  return str;
}


// source: ../www.onverse.com/Website/web/js/onverse/inheritance.js

//
// Title:		OnVerse website object inheritance
// File: 		inheritance.js
// Author:	Scott Mitting
// Date:		Feb 12, 2009
// Abstract:
// 	Enable object inheritance in javascript
// 	Original source: http://ejohn.org/blog/simple-javascript-inheritance/
// 	Inspired by base2 and Prototype
//
(function(){
  var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/;

  // The base Class implementation (does nothing)
  this.Class = function(){};
 
  // Create a new Class that inherits from this class
  Class.extend = function(prop) {
    var _super = this.prototype;
   
    // Instantiate a base class (but only create the instance,
    // don't run the init constructor)
    initializing = true;
    var prototype = new this();
    initializing = false;
   
    // Copy the properties over onto the new prototype
    for (var name in prop) {
      // Check if we're overwriting an existing function
      prototype[name] = typeof prop[name] == "function" &&
        typeof _super[name] == "function" && fnTest.test(prop[name]) ?
        (function(name, fn){
          return function() {
            var tmp = this._super;
           
            // Add a new ._super() method that is the same method
            // but on the super-class
            this._super = _super[name];
           
            // The method only need to be bound temporarily, so we
            // remove it when we're done executing
            var ret = fn.apply(this, arguments);       
            this._super = tmp;
           
            return ret;
          };
        })(name, prop[name]) :
        prop[name];
    }
   
    // The dummy class constructor
    function Class() {
      // All construction is actually done in the init method
      if ( !initializing && this.init )
        this.init.apply(this, arguments);
    }
   
    // Populate our constructed prototype object
    Class.prototype = prototype;
   
    // Enforce the constructor to be what we expect
    Class.constructor = Class;

    // And make this class extendable
    Class.extend = arguments.callee;
   
    return Class;
  };
})();







// source: ../www.onverse.com/Website/web/js/onverse/util.js

// File: 		util.js
// Author:	Scott Mitting
// Date:		Feb 9, 2009
// Abstract:
//	Set of utility functions for OnVerse user website.


// converts obj to a string
function debug(obj, depth) {	
	if (!obj) return 'NULL OBJECT';
	if (depth > 2) return 'XXXX';
	var s = '';
	jQuery.each(obj, function(o) { 
		for (var i = 0; i < depth; i++) {
			s += '\t';	
		}
		s += o + ' = ';		
		if (typeof(obj[o]) == 'object') {
			s += '\n';
			s += debug(obj[o], depth + 1);
		}
		else {
			s += obj[o] + '\n';	
		}
	});
	return s;
}

// alerts the contents of an object
function dump(obj) { 
	alert(debug(obj, 0)); 
}

// javascript no-op
function nil() {}

// runs a javascript message unix "nice" style
function gently(f) {
    setTimeout(f, 1);
}

// standard error interface
function reportError(task, msg) {
    // special cases
    if (msg.indexOf('You are not allowed to view profile') > -1) {
        app.loginErrorMessage = 'You must be logged in as a friend to view this avatar\'s profile.';
    }
    else if (msg.indexOf('Conversion Needed') > -1) {
        app.loginErrorMessage = 'Conversion may be needed.';
        $('#v1warning').show();
    }
    else if (msg.indexOf('Sign in failure') > -1) {
        app.loginErrorMessage = 'Incorrect username or password.';
    }
    else { // display error
        var args = { title: 'Error while ' + task, skin: 'alert', icon: 'alert.png' };
        app.openWindow('/web/html/widget/errorWindow.htm', args, function() {
            $('#errorMessage').html(msg);
        });
    }
}

function log(msg) {
//    $('#footer').after('<p style="color:black;">' + msg + '</p><hr/>');
}

// checks if a variable is defined (without js errors)
function isDefined(variable) {
    return eval('(typeof('+variable+') != "undefined");');
}

// String.format - simple javascript port of c# method
// Scott Mitting - 2009-02-25
String.format = function(s) {
    if (arguments.length > 1) {
        for (var i = 1; i < arguments.length; i++) {
            s = s.replace('{' + (i - 1) + '}', arguments[i]);
        }
    }
    return s;
}

// StringBuilder - simple javascript port of c# object
// Scott Mitting - 2009-02-25
var StringBuilder = Class.extend({
    // constructor
    init: function() { 
        this.clear();
    },        
    // methods
    append: function(s) {    
        this._list.push(s);
    },
    appendFormat: function(s) {
        if (arguments.length > 1) {
            for (var i = 1; i < arguments.length; i++) {
                s = s.replace('{' + (i - 1) + '}', arguments[i]);
            }
        }
        this.append(s);
    },
    clear: function() {
        this._list = new Array();
        this._s = '';
    },    
    length: function() {
        return this._process().length;
    },
    build: function() { 
        return this._process(); 
    },
    // private
    _process: function() {
        if (this._list.length > 0) {
            this._s += this._list.join('');
            this._list = new Array();
        }
        return this._s;
    },
    _list: null,
    _s : null
});

// Builds a button
function button(cmd, txt, style) {
    var sb = new StringBuilder();
    sb.appendFormat('<div class="editlink" style="{0}">', style);
    sb.appendFormat('  <a href="javascript:nil()" onclick="{0}">{1}</a>', cmd, txt);
    sb.appendFormat('  <span></span>');
    sb.appendFormat('</div>');    
    return sb.build();
}

// Object allowing widgets requiring data-binding to be notified
// later when the data arrives.
var AsyncDataBinder = Class.extend({	
	
	// constructor	
	init: function() {			
		this.data = null;		// location where data will be loaded
		this.locked = false;	// mutual exclusion (sorta) 		
		this.waiting = [];		// callbacks waiting for return data
	},
	
	// Allows a callback to recieve data to be loaded later.
	addListener: function(callback) {		
		// If the data as been loaded, then the callback is called immediately.
		if (this.data) {
			callback(this.data);
			return false;
		}
		// Returns true iff the calling method should load the data now.
		var ret = false;
		if (this.locked == false)
		{
			this.locked = true;
			ret = true;
		}
		this.waiting.push(callback);
		return ret;
	},
	
	// assigns the loaded data and notifies all waiting listeners
	notify: function(data) {
		this.data = data;
		var callbacks = this.waiting;
		this.waiting = [];
		for (var i in callbacks) {
			callbacks[i](data);
		}
	},
	
	// clears the data, triggering the data to refresh for new callbacks
	reset: function() {
		this.locked = false;
		this.data = null;
	}
});

// types of ads available
var AdSenseType = {
    largeRectangle:     { w: 336, h: 280, source: 'adframe-large-rectangle' },
    mediumRectangle:    { w: 300, h: 250, source: 'adframe-medium-rectangle' },
    wideSkyscraper:     { w: 160, h: 600, source: 'adframe-wide-skyscraper' },
    wideBar:            { w: 728, h: 90, source: 'adframe-wide-bar' }
};

// manages visible ads
var AdSense = {
    placeholder: function(type) {
        var t = AdSenseType[type];
        if (t == null) {
            //   reportError('Placing Ads', 'Invalid Ad Type: ' + type);
        }
        else {
            var sb = new StringBuilder();
            sb.appendFormat('<div class="google-placeholder" source="{0}"', t.source);
            sb.appendFormat('   style="width: {0}px; height: {1}px;">', t.w, t.h);
            sb.appendFormat('   Ad: {0}', type);
            sb.appendFormat('</div>');
            return sb.build();
        }
    },
    place: function(jq, list) {
        this.hide();
        var sb = new StringBuilder();
        for (var i in list) {
            //alert(this.placeholder(list[i]));
            sb.append(this.placeholder(list[i]));
        }
        jq.html(sb.build());
        this.show();
    },
    hide: function() {
        $('.google-adframe').css({ position: 'absolute', left: -2000, top: -2000 });
    },
    show: function() {
        $('.google-placeholder').each(function() {
            var jq = $(this);
            var source = jq.attr('source');
            var pos = jq.position();
            var w = jq.width();
            var h = jq.height();
            $('#' + source).css({ position: 'absolute', left: pos.left, top: pos.top, width: w, height: h });
        });
    }
};

function openImage(url) {

    url = url.replace('small/', '');
    var title = url.substring(url.lastIndexOf('/') + 1);

    // process arguments
    var o = {
        container: 'wnd_' +  String(Math.random()).substring(3),
        style: 'top:100px;left:300px;display:none;',
        title: 'Window',
		width: '850',
		icon: 'restore.png',
		skin: 'black'
    };
    // create html
    var html = '<img src="' + url + '"/>';
    
    var sb = new StringBuilder();
    sb.appendFormat('<div id="{0}" class="containerPlus draggable" width="{1}" style="{2}" buttons="m,c" icon="{3}" skin="{4}" minimized="false">', o.container, o.width, o.style, o.icon, o.skin);
    sb.appendFormat('   <div class="no"><div class="ne"><div class="n">&nbsp;&nbsp;{0}</div></div>', title);
    sb.appendFormat('       <div class="o"><div class="e"><div class="c"><div class="content">{0}</div></div></div></div>', html);
    sb.appendFormat('		<div><div class="so"><div class="se"><div class="s"></div></div></div></div>');
    sb.appendFormat('   </div>');
    sb.appendFormat('</div>');
    $('#windowContainer').append(sb.build());

    // display window and load contents		
    $('#' + o.container)
        .buildContainers({containment:"document", elementsPath:"web/css/elements/" })
        .css('height', '650px').centerInClient()
        .fadeIn()
		;	            
};

// recursively removes the given tag
function removeTag(html, tag) {
    var i = html.indexOf('<' + tag);
    if (i == -1) return html;
    var j = html.indexOf('</' + tag, i);
    if (j == -1) return html.substring(0, i);
    var k = html.indexOf('>', j);
    if (k == -1) return html.substring(0, i);
    return removeTag(html.substring(0, i) + html.substring(k + 1), tag);
}

// removes the script and noscript tags from a chunk of html that has
// been upgraded for SEO.
function removeSEO(html) {
    html = removeTag(html, 'noscript');
    html = removeTag(html, 'script');
    return html;
}

// converts html into viewable contents
function htmlPre(html) {
    return '<pre>' + html.replace(/</g, '&lt;').replace(/>/g, '&gt;');
}


// source: ../www.onverse.com/Website/web/js/onverse/iwidget.js

//
// Title: Onverse Widget Library
// File: iwidget.js
// Author: Scott Mitting
// Date: 2009-02-12
// Abstract:
//	Javascript objects for rendering individual website components.
//

// creates a button for a widget
function widgetButton(hrefTag) {
    var sb = new StringBuilder();
    sb.appendFormat('<div class="editlink button">{0}<span></span></div>', hrefTag);    
    return sb.build();
} 

// styles available for drawing widgets
var WidgetStyles = {
	section: {
	    build: function(jq, widget) {		
			jq.append(
					'<div class="section">' +					
                		'<div class="corner nw"></div><div class="corner ne"></div>' +					
                        '<div id="section-buttons" style="float: right;"></div>' + 
						'<h1>' + widget.title + '</h1><span id="' + widget.containerID + '"></span>' +						
                		'<div class="corner sw"></div><div class="corner se"></div>' +						
					'</div>'
					);				
		}	
	},
	plain: {
		build: function(jq, widget) {
			jq.append('<span id="' + widget.containerID + '"></span>');				
		}					
	}
};


//-------------------------------------------------------------------
// Base class for widgets which render themselves.
//-------------------------------------------------------------------
var IWidget = Class.extend({

    // *** CONSTRUCTORS ***

    // constructor
    //	container - id of element which widget resides within (optional)
    init: function(container) {
        if (container == null) {
            container = 'widget_' + String(Math.random()).substring(2);
        }
        this.containerID = container;
    },

    // *** PROPERTIES ***			

    // Title to display for this widget (when appropriate)
    title: 'Untitled Widget',
    // Command links for widget (when appropriate)
    links: '',
    // Style to use for border
    style: WidgetStyles.section,

    // *** METHODS ***

    // displays widget
    //	data - current data to display within widget
    //  callback - function triggered after binding
    show: function(data) {
        var jq = this._getContainer().show();

        // update display
        this.clear();
        if (data == null || this._isEmpty(data)) {
            this.renderEmpty(jq);
        }
        else {
            this.prerender(jq, data);
            this.render(jq, data);
            this.postrender(jq, data);
        }

        // update edit links
        if (this.links && this.links != '') {
            // separate links
            var s = this.links;
            var list = [];
            for (var x = 0; x < 10; x++) {
                var i = s.indexOf('<a');
                if (i == 0) {
                    i = s.indexOf('<a', 2);
                }
                if (i > 0) {
                    list.push(s.substring(0, i));
                    s = s.substring(i);
                }
                else {
                    list.push(s);
                    break;
                }
            }
            // build buttons
            var sb = new StringBuilder();
            sb.append('<table cellpadding="0" cellspacing="0">');
            for (var i in list) {
                sb.append('<td>');
                sb.append(widgetButton(list[i]));
                sb.append('</td>');
            }
            sb.append('</table>');
            jq.parents('div.section').find('#section-buttons').html(sb.build());
        }
    },
    // hides this widget from view completely
    hide: function() {
        this._getContainer().parents('div.section').hide();
    },
    // erases contents of this widget
    clear: function() {
        this._getContainer().html('');
    },

    // *** PROTECTED ***	

    // event rendering entire widget to html
    //	jq - jquery object for container
    //	data - overall dataset being rendered	
    render: function(jq, data) {
        alert('ERROR: do not call IWidget.render() directly');
    },
    // event which renders a single data item to html
    //	jq - jquery object for container
    //	obj - the current object data to render
    //	id - identifier for this data
    renderItem: function(jq, obj, id) {
        alert('ERROR: do not call IWidget.renderItem() directly');
    },
    // event triggered before render
    //	jq - jquery object for container
    //	data - overall dataset being rendered
    prerender: function(jq, data) {
    },
    // event triggered after render
    //	jq - jquery object for container
    //	data - overall dataset being rendered
    postrender: function(jq, data) {
    },
    // event triggered when data is empty
    //  jq - jquery object for container
    renderEmpty: function(jq) {
    },

    // *** PRIVATE ***			

    // returns the current jquery container for this widget
    _getContainer: function() {
        return jQuery('#' + this.containerID);
    },
    // returns true iff data has no keys
    _isEmpty: function(data) {
        var t = null;
        if (data) {
            for (var k in data) {
                t = k;
                break;
            }
        }
        return t == null;
    }
});

//-------------------------------------------------------------------
// Base class for widgets which render from hashtable data
//-------------------------------------------------------------------
var IListWidget = IWidget.extend({
	render: function(jq, data) {
	    for (var id in data) {
	        if (data[id] != null) {
		        this.renderItem(jq, data[id], id);	
		    }
	    }		
	}
});

//-------------------------------------------------------------------
// Base class for widgets which render from a singe javascript object
//-------------------------------------------------------------------
var IObjectWidget = IWidget.extend({
	render: function(jq, data) {	
		this.renderItem(jq, data, null);	
	}
});


//-------------------------------------------------------------------
// Object maintaining a list of widgets, so they can be updated 
// together.
//-------------------------------------------------------------------
var WidgetList = Class.extend({
    // Constructor
    //	args - array of hashes in format [{ key: ..., widget: ...}]
    init: function(args) {
        this._list = [];
        if (args) {
            for (var i in args) {
                this.addPair(args[i]);
            }
        }
    },
    // Adds a widget to this list
    //	datakey - subelement to use from dataset for this widget
    //	widget - the widget to add to this list
    add: function(datakey, widget) {
        this.addPair({ key: datakey, widget: widget });
    },
    // Adds a widget to this list
    //	p - json in format { key: ..., widget: ... }
    addPair: function(p) {
        this._list.push(p);
    },
    // Updates the widgets in this list, using the data object provided
    show: function(data) {
        for (var i in this._list) {
            var item = this._list[i];
            if (item.widget) {
                if (data) {
                    var arg = item.key == null ? data : data[item.key];
                    item.widget.show(arg);
                }
                else {
                    item.widget.show(null);
                }
            }
        }
    }
});

var LoadedWidgetScripts = {};

//-------------------------------------------------------------------
// Object which manages and contains lists of widgets, so they can
// be swapped out easily rather than resorting to page loads.
//-------------------------------------------------------------------
var WidgetContainer = IWidget.extend({
    // Constructor
    //	container - id of element which widgets will be added to
    init: function(container, list) {
        if (!container) alert('WidgetContainer.init() requires container argument.');
        if (list != null) {
            this.set(list);
        }
        else {
            this.currentList = null;
            this.needsUpdate = false;
        }
        this._super(container);
    },
    // Sets the WidgetList object to display within this container, r
    // removing any existing widgets and building new widget containers.
    //	widgetList - new list of widgets to display
    set: function(widgetList) {
        this.currentList = widgetList;
        this.needsUpdate = true;
    },
    // Draws the current list
    render: function(jq, data) {

        if (this.containerID == 'main') {
            nil();
        }


        if (this.currentList instanceof WidgetList) {
            if (this.needsUpdate) {
                this.clear();

                // load needed widget code
                for (var i in this.currentList._list) {
                    var item = this.currentList._list[i];
                    if (!item.widget) {
                        this.loadWidget(jq, data, item);
                    }
                }

                // draw widgets
                for (var i in this.currentList._list) {
                    var item = this.currentList._list[i];
                    this.build(jq, item.widget, item);
                }
            }
            this.currentList.show(data);
        }
        else {
            alert('WidgetContainer.render() expects this.currentList to be a WidgetList');
        }
    },

    // loads a javascript file to use as a widget
    loadWidget: function(jq, data, item, isRetry) {
        if (item.script && item.type && !item.widget) {
            var me = this;
            if (!isDefined(item.type)) {
                ajaxScript('Loading ' + item.type, item.script, function(js) {
                    // if loaded, add to page
                    eval('item.widget = new ' + item.type + '()');
                    if (item.widget) {
                        LoadedWidgetScripts[item.script] = true;
                    }
                });
            }
            else {
                eval('item.widget = new ' + item.type + '()');
            }
        }
    },
    // Builds a container for a single widget
    //	jq - jquery context for list container
    //	widget - widget to create container for
    build: function(jq, widget, item) {
        if (widget) {
            widget.style.build(jq, widget);
        }
        else {
            alert('null widget passed to WidgetContainer.build()')
        }
    }

});