var webtv, Webtv, Webtv_reg = [], Wlog, WDebug = false;

Webtv = function ()
{
	settings = {};
	usersettings = {};
	
	this.init = function ()
	{
		var i, set;
		
		try {
			if(set = window['webtv_settings']){
				for(i in set){
					if(set.hasOwnProperty(i)){
						settings[i] = set[i];
					}
				}
			}
		} catch(e){Wlog('webtv:: could not retrieve and apply settings');}
		
		load_components();
		
		Wlog('webtv:: init');
	};
	
	load_components = function ()
	{
		var i;
		for(i=0;i<Webtv_reg.length;i++){
			try{webtv[Webtv_reg[i]].init();}catch(e){Wlog('webtv:: could not init component | '+e)}
		}
	}
	
};
document.observe('dom:loaded', function () {
	webtv.init();
});
webtv = new Webtv();

if(!window.Wlog){
	Wlog = function ()
	{
		if (!WDebug) return;
		var msg = arguments && arguments[0];
		try{
			console.log(msg);
		}catch(e){}
	}
}


