


function init() {
	
	// Forms
	$$('.autocomplete').each(function (field, index) {var myCompleter = new autoCompleter(field);}.bind(this));
	$$('input[type=text]').each(function (field, index) {var myField = new Field(field);}.bind(this));
	$$('input[type=password]').each(function (field, index) {var myField = new Field(field);}.bind(this));
	$$('.select').each(function (field, index) {var mySelectBox = new SelectBox(field);}.bind(this));
	$$('.vote').each(function (field, index) {var myField = new voteBoxes(field);}.bind(this));
	$$('.manageable').each(function (field, index) {var myManager = new listManager(field);}.bind(this));

	// share
	if($('shareTip')) $('shareTip').hide();
	
	
	// widgets
	$$('.widgets').each(function (el, index) {var myWidgets = new Widgets(el);}.bind(this));
	
}

function start() {

	// Bookmarks
	$$('div.bookmarkImage').each(function(element, index) {myBookmark = new Bookmark(element);});
	$$('div.bookmarkImage a').each(function(anchor) {
		anchor.writeAttribute('alt',anchor.readAttribute('href'));
		anchor.setAttribute('href','#');
		Event.observe(anchor,'dblclick', function(ev) {
			document.location.href = Event.element(ev).parentNode.readAttribute('alt');
		});
	});

	// overlay
	Popup.load();
	
	// rollovers
	$$('.rollover').each(function (el, index) {var myRollover = new Rollover(el);}.bind(this));
	
	// tooltips
	$$('.tooltip').each(function (el, index) {var myToolTip = new toolTip(el);}.bind(this));
	
	//tabs
	$$('.tabs').each(function(el, index) {var myTabs = new tabsList(el);}.bind(this));
	
	// share
	$$('a.share').each(function (el, index) {var myShareLink = new shareLink(el);}.bind(this));
	
}

Event.observe(document, 'dom:loaded', init, false);
Event.observe(window, 'load', start, false);

