//if (option('test')) alert('found test')

if (!option('stay')){
	dest=location.href.replace(location.search,'')
	if (!option('(leave|keep)_frames') && top.location!=location) bustframes=1
	//if (!option('(leave|keep)_(ugly_)?fm_url') && !location.hostname.match(/^file.autohotkey.net$/)) dest=(match=dest.replace(/\/$/,'').match('([^\/]*\/\/)([^\/]*)/file/users/Members(.*)'))[1]+'file.'+match[2]+match[3]
	if (!option('(leave|keep)_index') && location.href.match(/index\.[^\/]*$/)) dest+='/..'
	dest+=location.search

	if (location!=dest){void(location + ' ---> '+dest);if (window.bustframes) top.location.replace(dest); else location.replace(dest)} else delete(dest)
}

function option(o){
	if (location.search.match(o+'(?:[\&\=].*)?$'))
		o=1
	else if (eval(window.o)) o=1; else o=0
	//alert('return '+o)
	return o
}
