function onlogin(){
	
	G.each([document, window], function(target){
		G.addEvent(target, "resize", function(){
			if (MP._resizeTimer) {
				return;
			}
			MP._resizeTimer = setTimeout(function(){
				fitelements();
				delete MP._resizeTimer;
			}, 200);
		});
	});
	
	fitelements.later(2000);
	loadIframe();
	
	
}

function fitelements(){
	var cs = G.clientSize();
	var fp = G.pos(G.$("foot-area"));
	var mlp = G.pos(G.$("main-left-area"));
	var mh = cs.height - fp.height - mlp.top; // main-area,right-area,left-area
	var margins = 7 * 2 + 5 * 2;
	G.each(["main", "right"], function(v){
		G.$(v + "-area").style.height = mh + "px";
		var deco = MP.decorated[v];
		if (deco) {
			var did = deco.id;
			G.$(did + "-cont").style.height = mh - margins + "px";
			if (v != "main") {
				G.$(did + "-cont").style.overflow = "auto";
			}
		}
	});
	
	G.each(["feemetrixarea"],function(v){
		try{
			G.$(v).style.height=Math.max(50,mh-margins-G.$(v).offsetTop)+"px";
		}catch(ex){CONSOLE.error("fitelements:"+v+"\n"+G.dump(ex)+"\n"+margins);}
	});
	
	// for ie6 bug
	if (G.isMSIE6) {
		G.refreshElement(document.body).later(2000);
	}
}

function loadIframe(){
	var ifr = new G.IFrame(G.$("ifr-feedmetrix"));
	ifr.load("js/dummy.html?"+(new Date().valueOf()));
	var base = location.protocol+"//"+location.hostname+"/mf/m/"+MP.login.member_id+"/fmx";
	ifr.load.later(200,ifr,base);
}

function logout(){
	MP.doLogout(function(){
		location.reload();
	});
}
