function qsaver(hwnd)
	local title, url = GetDocInfo(hwnd)
	local savedir=getpref(TYPE_STRING,"cyberarticle.path.position")
	km.setpref(TYPE_STRING,"kmeleon.download.saveDir",savedir)
	km.setpref(TYPE_BOOL,"kmeleon.download.useSaveDir",true)
	km.id("ID_FILE_SAVE_AS")
	km.setpref(TYPE_BOOL,"kmeleon.download.useSaveDir",false)
	km.SetStatusBarText(title.." is Saved")
end

function qsaver1(hwnd)
	savepref=km.getpref(TYPE_INT,"kmeleon.general.saveType")
	km.setpref(TYPE_INT,"kmeleon.general.saveType",1)
	qsaver(hwnd)
	km.setpref(TYPE_INT,"kmeleon.general.saveType",savepref)	
end

function qsaver2(hwnd)
	savepref=km.getpref(TYPE_INT,"kmeleon.general.saveType")
	km.setpref(TYPE_INT,"kmeleon.general.saveType",2)
	qsaver(hwnd)
	km.setpref(TYPE_INT,"kmeleon.general.saveType",savepref)	
end

function setsave1(hwnd)
	km.setpref(TYPE_INT,"kmeleon.general.saveType",1)
	sync()
end

function setsave2(hwnd)
	km.setpref(TYPE_INT,"kmeleon.general.saveType",2)
	sync()
end

function qsavermht(hwnd)
	local title, url = GetDocInfo(hwnd)
	--local savedir=getpref(TYPE_STRING,"cyberarticle.path.position")
	local savedir="c:\\"
	local mhtsug1 = string.gsub(title,":","");
	local mhtsug2 = string.gsub(mhtsug1,"|","");
	local mhtsug3 = string.gsub(mhtsug2,"?","");
	local mhtsug4 = string.gsub(mhtsug3," ","_");
	local mhtsug5 = string.gsub(mhtsug4,"\,","");
	local command=BROWSERPATH.."oGet\\SavePage.exe ".."\"".."1".."\" ".."\""..url.."\" ".."\""..savedir.."\"";
	--exec(BROWSERPATH.."oGet\\SavePage.exe ".."\""..title.."\" ".."\""..url.."\" ".."\""..savedir.."\"")
	--exec(command)
	alert(command)
	exec(command)
end	