-- change scripts path

package.path  = package.path  .. ";" .. PREFPATH .. "\\lua\\?.lua;" .. PREFPATH .. "\\lua\\?.lc"
-- BUG FIX: this used to set cpath = package.PATH .. ?.dll  which clobbered the
-- C side's cpath append (sLuaDir\?.dll) AND polluted cpath with all the .lua
-- search patterns. Result: require"agentlib" never found <sLuaDir>\agentlib.dll,
-- the agent module errored out at require time, agent_toggle_sidebar was
-- never defined, and the toolbar AI button was silent.
package.cpath = package.cpath .. ";" .. PREFPATH .. "\\lua\\?.dll"


function downloadpath()
	local dposition=getpref(TYPE_STRING,"download.manager.position");
	local dposition=prompt("Enter Position for Download Manager","Download Manager Position",dposition);
	setpref(TYPE_STRING, "download.manager.position", dposition);
end

function cyberarticlepath()
	local CAposition=getpref(TYPE_STRING,"cyberarticle.path.position");
	local CAposition=prompt("Enter Position for CyberArticle","CyberArticle Position",CAposition);
	setpref(TYPE_STRING, "cyberarticle.path.position", CAposition);
end	

function cyberarticle()
	local title, url = GetDocInfo(hwnd)
	local CApath=getpref(TYPE_STRING, "cyberarticle.path.position")
	CApath=CApath.."addlink.exe"
--	CApath=CApath.."URL2Book.exe"
--	alert(CApath)
	exec(CApath.." "..url)
end