/*
 * DOM ready esemény
 */
var GadgetsCount = 0;

$(document).ready(function () {
	
	ml.ajax.onComplete(function(){ml.site.convertA();});
	ml.site.convertA();

	ml.ajax.Preloader = new ml.ajax.SitePreloader();
	
	// For history navigation
	$(window).history(function(e, hash) {
		ml.site.getContent_do(hash);
		ml.menu.select(hash);
	});
	if ( window.location.hash.length>0 ) {
		// már létezik egy HASH reloadkor, hívjuk meg!
		// Le kell futnia a jelenlegi szálnak, mert ez az INIT (onReady, Constructors, stb..) szál
		setTimeout( 'ml.site.getContent_do(window.location.hash.substr(1));ml.menu.select(window.location.hash.substr(1));' );
	}
	// END For history navigation
	
	// TODO: ha nincs gadget, akkor nem is kéne!
	if (GadgetsCount>0) {
		ml.ajax.getServer({
			route: '/gadget/gadgetdatas'
			,noAudit:  true
		});
	}
	
	j.fn.jGrowl.prototype.defaults.closer = false;
	
	if (typeof(j.fn.tipsy) == 'function') {
   	j('.tooltip').tipsy({
   		title: 'tooltip',
   		fade: true
   	}).removeClass('tooltip');
   }
	
});

swfs = new Array();
