function home(hwnd)
	local url=getpref(TYPE_STRING,"browser.startup.homepage");
	local pref=getpref(TYPE_INT,"kmeleon.home.open");
	if pref==0 then
		NavigateTo(url,OPEN_NORMAL)
	elseif pref==1 then
		NavigateTo(url,OPEN_NEWTAB)
	elseif pref==2 then
		NavigateTo(url,OPEN_BACKGROUNDTAB)
	end
end

function set_home_normal()
	setpref(TYPE_INT,"kmeleon.home.open",0);
	home_sync()
end

function set_home_new()
	setpref(TYPE_INT,"kmeleon.home.open",1);
	home_sync()
end

function set_home_background()
	setpref(TYPE_INT,"kmeleon.home.open",2);
	home_sync()
end

function home_sync()
	if getpref(TYPE_INT,"kmeleon.home.open")==0 then SetCheck("luamacro(set_home_normal)",true) else SetCheck("luamacro(set_home_normal)",false) end
	if getpref(TYPE_INT,"kmeleon.home.open")==1 then SetCheck("luamacro(set_home_new)",true) else SetCheck("luamacro(set_home_new)",false) end
	if getpref(TYPE_INT,"kmeleon.home.open")==2 then SetCheck("luamacro(set_home_background)",true) else SetCheck("luamacro(set_home_background)",false) end
end