if (!self[/*{*/"_loadhandlers"/*}*/])
{
	// Try to fix IE image caching issues. (IE7 doesn't need it but doesn't mind. Anything else before IE6SP1 doesn't understand it.)
	try { document.execCommand("BackgroundImageCache",!1,!0); } catch(e){};
	
	document.write("<style>.hideforjs"+(document.createElement?",.hidefordom":"")+"{position:absolute;left:-249em;width:1em;}</style>");

	///////////////////////////////////////////////////////////////////////
	// Obfuscation and utility functions
	///////////////////////////////////////////////////////////////////////
	_SetTimeout = setTimeout;
	($_=_nullfunction=function(){})(_isIE=_sizelocked=_bwswatchnavig=_bwsnavig=_false=!(_true=!(_keypressed=_body=_null=(_document=document)&&null)),_window=this);
	_clickhandlers={};
	_overhandlers={};
	_outhandlers={};
	_parseInt=parseInt;
	if (!self.hbloc) hbloc = _null;
	var controldest={};
	var controlsrc={};
	
	function arraypush(a,o)
	{
		var r = getlength(a);
		a[r]=o;
		return r;
	}
	function arrayadd(a,o)
	{
		if (!a) return [o];
		else arraypush(a,o);
		return a;
	}
	function arrayrem(a,o)
	{
		if (!a) return [];
		for (var i=getlength(a);i-->0;)
			if (a[i]==o)
			{
				a[i]=arraypop(a);
				return a;
			}
	}
	function arraypop(a)
	{
		var r = lastel(a);
		--a.length;
		return r;
	}
	function getlength(a)
	{
		return a.length;
	}
	function lastel(a)
	{
		return a[getlength(a)-1];
	}
	
	///////////////////////////////////////////////////////////////////////
	// DHTML Helper functions
	///////////////////////////////////////////////////////////////////////
	
	function ge(o,n)
	{
		return o.getAttribute?o.getAttribute(n):o[n];
	}
	// Get an element, by name
	function getel(n)
	{
		var o=_document.getElementById?_document.getElementById(n):(_document.all||_document.layers)[n];
		if (!o) o=_document.getElementsByName(n)[0];
		return o;
	}
	// Get the parent element/node of an element/node
	function getParent(o)
	{
		return o.parentNode||o.parentElement;
	}
	// Returns a closure (that merely calls the given closure) that can be
	// assigned to DOM objects without IE leaking memory.
	// Using the undoer correctly will prevent significant memory leaks.
	_closures = {};
	function closure2(closure)
	{
		var name = "bws"+Math.random();
		_closures[name] = closure;
		closure = null;
		return {
		maybefn:function()
		{
			if (_closures[name])
				return _closures[name].apply(this, arguments);
		},
		fn:function()
		{
			return _closures[name].apply(this, arguments);
		},
		undo:function()
		{
			delete _closures[name];
		}};
	}
	// Please use closure2 and propagate/use undo functions correctly, instead.
	function closure(fn) { return closure2(fn).fn; }
	// Get information about the document and its visible area
	// _x, _y are the scroll left-top coords
	// _w, _h are the full document width/height
	// _cw, _ch are the visible area's width/height
	// _x2, _y2 are the scroll bottom-right coords
	function getScroll()
	{
		if (!_document.all||_document.compatMode=='CSS1Compat') var o=_document.documentElement;
		if (!o||o.scrollWidth==_null) o=_body||{};
		var r={_o:o, _x:o.scrollLeft||0, _y:o.scrollTop||0, _w:o.scrollWidth||0, _h:o.scrollHeight||0, _cw:o.clientWidth||_window.innerWidth||0, _ch:o.clientHeight||_window.innerHeight||0};
		if (!_sizelocked) rightx=r._w;bottomy=r._h;
		r._x2=r._x+r._cw;
		r._y2=r._y+r._ch;
		return r;
	}
	// To allow the clicking of multiple submits...
	var eventCount = 0;
	function eventStarted()
	{
		++eventCount;
	}
	function eventFinished()
	{
		if (!--eventCount && buttonsclicked.length>0)
		{
			setTimeout(function(){
				var b = buttonsclicked;
				buttonsclicked=[];
				for (var i=0;i<b.length;++i)
				{
					var e = b[i];
					if (e.reset)
					{
						var f = e;
						continue;
					}
					if (!e.click||!e.form)
						continue;
					var olde=e;
					var f=e.form;
					var name = e.name;
					e = document.createElement("input");
					e.type = "text";
					e.name = name;
					e.value = "1";
					e.style.display = "none";
					e._fakeSubmit = _true;
					f.appendChild(e);
				}
				if (f)
				{
					_bwsnavig = true;
					// Browsers try to prevent us from clicking buttons, for some reason, but
					// we can submit the form...
					if (f.onsubmit) f.onsubmit(null,olde);
					if (!_window.SubmitPartial) f.submit();
				}
			}, 1);
		}
	}
	// Click a submit or submit a form (returning true on success)
	// Also avoids nav nags.
	var buttonsclicked=[];
	function $c(o)
	{
		if (typeof o=='string') o = getel(o);
		if (!o.click) return _false;
		if (eventCount>0||buttonsclicked.length>0)
			arraypush(buttonsclicked, o);
		else
		{
			_bwsnavig = true;
			if (o.click)
			{
				if (_window.SubmitPartial) SubmitPartial(null,o);
				else
				{
					if (o.onclick) o.onclick();
					o.click();
				}
			}
			else if (o.onsubmit)
			{
				o.onsubmit();
				if (!_window.SubmitPartial) o.submit();
			}
		}
		return _true;
	}
	
	///////////////////////////////////////////////////////////////////////
	// Heartbeat functionality - Lets the server know we're still here.
	///////////////////////////////////////////////////////////////////////
	function genhbloc(force)
	{
		if (!force&&hbloc) return;
		var f = _document.forms;
		for (var i=getlength(f);i-->0;)
			if (f[i].action.indexOf("fs2s=")!=-1)
				hbloc=f[i].action.split("fs2s=").join("fs2hb=");
	}
	_hbfailed = false;
	var _timeoutat;
	var _to;
	function hb()
	{
		genhbloc();
		if (hbloc)
		{
			var _started = +new Date();
			getXML(hbloc+(_keypressed?"&keypressed=1":"")+"&random="+Math.random(),function(xml)
			{
				if(xml&&xml.lastChild&&xml.lastChild.nodeName=="redirect")
					location=xml.lastChild.lastChild.nodeValue;
				else if (xml&&xml.firstChild&&xml.firstChild.nodeName=="failure")
					hbfailed();
				else if (xml&&xml.firstChild&&xml.firstChild.nodeName=="success")
				{
					if (_to) {clearTimeout(_to);_to=null;}
					var delay = _started+60*1000-new Date();
					_to = _SetTimeout(hb, Math.max(0,delay));
					_timeoutat = _started + 120*1000;
				}
				else if (!_timeoutat&&!_bwsnavig)
					alert("Javascript failure");
			});
			_keypressed=_null;
			if (_timeoutat && +new Date()>_timeoutat)
				setTimeout(function(){if (_timeoutat && +new Date()>_timeoutat) hbfailed();}, 1000);
			else if (!_hbfailed)
				_to = _SetTimeout(hb,10000);
		}
	}
	
	function hbfailed()
	{
		if (!_hbfailed)
		{
			_hbfailed = true;
			alert("Your session has expired. Choose a toolbar item to start again.");
		}
	}
	
	///////////////////////////////////////////////////////////////////////
	// Page-load handling - tries to run delayed JS functions on page-load,
	//                      but before in-page objects necessarily have.
	///////////////////////////////////////////////////////////////////////
	_loadhandlers = [];
	_LoadDone = _LoadTimer = 0;
	_LoadObject = _document;
	function init()
	{
		if (_LoadDone++) return;
		_body=_document.body;
		_body.className=(_body.className||'')+' bwsjsisactive';
		getScroll()._o.onkeypress=ddkeypress;
		
		hb();
		
	    var lh = _loadhandlers;
		_loadhandlers = [];
		for (var i=0;i<lh.length;++i)
			lh[i]();
		
		var o={};
		for (var i=0;i<pending.length;++i)
			o[pending[i][0]]=1;
		for (i in o) loadjs(i);
		nowloaded("$");
	}
	
	if (_document.addEventListener)
	{
		_document.addEventListener("load", init, false);
		_document.addEventListener("DOMContentLoaded", init, false);
	}
	/*!*/
	/*@cc_on @if (@_win32||@_win64||@_win128||@_win256)
	else
	{
		_document.write('<script src="//:" defer id=bwsload><\/script>');
		_LoadObject = getel("bwsload");
		_LoadObject.onreadystatechange=LoadReadyCheck;
	}
	_isIE=_true;
	/*@end @*/
	/*!*/
	_LoadTimer=navigator.userAgent.indexOf("KHTML")!=-1&&setInterval(LoadReadyCheck,10);
	function LoadReadyCheck()
	{
		if (_LoadObject.readyState=="complete")
		{
			_LoadTimer&&clearInterval(_LoadTimer);
			init();
		}
	}
	if (_PrevOnload=_document.onload) OnLoad(_PrevOnload);
	onload = init;
	
	// Runs the provided function after the page has finished loading.
	function OnLoad(fn)
	{
		if (_LoadDone) fn();
		else arraypush(_loadhandlers, fn);
	}
	
	///////////////////////////////////////////////////////////////////////
	// Easy part of Request-based dynamic HTML
	///////////////////////////////////////////////////////////////////////
	
	// Gets an XMLHTTPRequest object (can reuse old ones)
	_prevXHR=[];
	function geXHR()
	{
		if (getlength(_prevXHR)>0) return arraypop(_prevXHR);
		try{ return new XMLHttpRequest(); }catch(e){}
		try{ return new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){}
		try{ return new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){}
	}
	// Accepts an XMLHTTPRequest object for reuse
	function puXHR(o){arraypush(_prevXHR,o);}
	
	
	// Do a GET, using XMLHTTPRequest, calling fn(resp, code) on
	// completion or failure, where resp is the response XML (or
	// null, on failure) and code is the status-code received
	// from the server.
	function getText(URL, fn, data, ctype){return getData(URL, fn, data, ctype, "responseText");}
	function getXML(URL, fn, data, ctype){return getData(URL, fn, data, ctype, "responseXML");}
	function getData(URL, fn, data, ctype, propname)
	{
		var XHR = geXHR();
		XHR.open(data?"POST":"GET", URL, true);
		XHR.setRequestHeader('X-FS2JS', '1.0');
		if (data||ctype)
			XHR.setRequestHeader('Content-Type', ctype||'application/x-www-form-urlencoded');
		var ch = closure2(function()
		{
			if (XHR.readyState!=4) return;
			ch.undo(); // This stops the event handler being run again. Simply reassigning onreadystatechange would make IE crash.
			fn&&fn(XHR.status==200?XHR[propname]:null,XHR.status);
			puXHR(XHR);
		});
		XHR.onreadystatechange=ch.maybefn;
		XHR.send(data);
	}
	_timedthings={};
	function runfunctionafter(fn,o,t)
	{
		_SetTimeout(function(){fn(o);}, t||1);
	}
	_loaded=0;
	_basefns={};
	_loadcount=1;
	_parseInt=parseInt;
	var iframeid;
	function nowloaded(a,b)
	{
		if (js[a]==1)
		{
			_loadcount--;
			js[a]=2;
			_basefns[a]=b;
		}
		if (_loadcount==0)
		{
			if (!iframeid&&parent!=window)
			{
				try
				{
					parent[/*{*/"JS07Refresh"/*}*/]();
					checkSize();
					if (iframeid) parent[/*{*/"JS07LoadComplete"/*}*/](iframeid);
					setInterval(/*{*/"checkSize()"/*}*/,55);
				}catch(e){}
			}
			for (var i=0;i<pending.length;++i)
			{
				var s = pending[i];
				if (!undoers[s.s]) undoers[s.s]=[];
				arraypush(undoers[s.s], _basefns[s[0]](s));
			}
			pending=[];
		}
	}

	var js={$:1};
	OnLoad($_);
	OnLoad(function(){
		if (_window.VBArray&&!_window.XMLHttpRequest)
			document.body.onclick = IE6LabelHandler;
	});
		
	function IE6LabelHandler()
	{
		if (_window.lastwashandled) return false;
		var ev = _window.event;
		var el = ev.targetElement||ev.srcElement;
		while (el&&!(el.tagName&&el.tagName.toLowerCase()=="label")) el=el.parentElement;
		el=el&&getel(el.htmlFor);
		if (!el||el.tagName.toLowerCase()!="select") return true;
		el.focus();
		return false;
	}
	function ddkeypress(ev)
	{
		_keypressed=_true;
		var evv=ev||event;
		var el=evv.srcElement||evv.target;
		
		if ((evv.charCode||evv.keyCode||evv.which)==13&&(el.type=="text"||el.type=="password"))
		{
			var f=_document.all;
			var i=el.sourceIndex;
			var dest = controldest[el.id]||controldest[el.name];
			if (dest)
			{
				var del = getel(dest);
				if (del.type=='text'||del.type=='password'||del.tagName.toLowerCase()=='textarea') {del.focus();return _false;}
			if (del.type=='submit'||del.type=='image') {return !$c(del);}
			}
			if (!f||!i)
			{
				f=el.form.elements;
				for (i=0;i<getlength(f);++i)
					if (f[i]==el) break;
			}
			while (++i<getlength(f))
			{
				if (controldest[f[i].id||f[i].name]||controlsrc[f[i].id||f[i].name]) continue;
				if (f[i].type=='text'||f[i].type=='password'||f[i].tagName.toLowerCase()=='textarea') {f[i].focus();return _false;}
			if ((f[i].type=='submit'||f[i].type=='image')&&!ge(f[i],'ignore')) {return !$c(f[i]);}
			}
		}
		else if (_window[/*{*/"ddkeypress2"/*}*/]) return ddkeypress2(ev);
	}
	// This function adds pending events
	var pending=[];
	function $$(s)
	{
		// Allow people to call with as many instructions as they like
		for (var i=1;i<arguments.length;++i) $$(arguments[i]);
		var p = s.split("~");p.s=s;
		pending[pending.length]=p;
		if (!js[p[0]]) loadjs(p[0]);
		if (_loadcount==0) nowloaded();
	}
	var undoers={};
	function $$undo(s)
	{
		// Allow people to call with as many instructions as they like
		for (var i=1;i<arguments.length;++i) $$undo(arguments[i]);
		
		var o = undoers[s];
		if (o==null||!getlength(o)) return;
		o = arraypop(o);
		if (o) o();
	}
	function loadjs(s)
	{
		if (js[s]) return;
		var o=getel("bwsjs");
		if (!o) return;
		_loadcount+=1;
		js[s]=1;
		var s2=o.src.replace("0.js","0"+s+".js");
		if (_document.createElement)
		{
			if (_LoadDone)
			{
				var el=_document.createElement('script');
				if (!_isIE)
				{
					el.defer=true;
					el.src=s2;
				}
				el.bws=1;
				_document.body.appendChild(el);
				// If we insert a deferred script, here, IE will lose the history
				// when we navigate away from this page (if we're using dynamic
				// updates). Instead, we use a hack.
				if (_isIE) el.src=s2;
			}
			else
				document.write("<script bws=bws src='"+s2+"' type='text/javascript'></script>");
		}
		else o.src=s2;
	}
	var lastsize;
	function checkSize()
	{
		var thissize={};
		var o=getScroll()._o;
		thissize._w=o.scrollWidth;
		thissize._h=o.scrollHeight;
		if (!lastsize||lastsize._w!=thissize._w||lastsize._h!=thissize._h)
			parent["JS07SetSize"](iframeid,thissize._w,thissize._h);
		lastsize=thissize;
	}
	
	function ElsByName(name)
	{
		var a=_document.getElementsByName(name);
		var ret = {};
		for (var i=0;i<a.length;++i)
		{
			if (!a[i]._nw)
				a[i]._nw = "nw"+Math.random();
			ret[a[i]._nw] = a[i];
		}
		return ret;
	}
	
	function ElByID(id)
	{
		var o = _document.getElementById(id);
		if (o&&!o._nw) o._nw="nw"+Math.random();
		return o;
	}
	
	function getels(n, norecurse)
	{
		var all = {};
		if (norecurse)
			all[n] = 1;
		else
			all = AddDests(n,namemap);
		var ret = {};
		for (var i in all)
		{
			var o = ElByID(i);
			if (o)
				ret[o._nw] = o;
			var a = ElsByName(i);
			for (var j in a)
				ret[a[j]._nw] = a[j];
		}
		return ret;
	}
	
	function AddDests(name, lines, currentset)
	{
		currentset = currentset||{};
		currentset[name]=1;
		if (lines[name])
			for (var i in lines[name])
			{
				if (currentset[lines[name][i]]) continue;
				AddDests(i, lines, currentset);
			}
		return currentset;
	}

	// Find all of the destinations, through lines, of all of the given names.
	// Not especially efficient, but that doesn't matter.
//	function Complete(names, lines, current)
//	{
//		current = current||{};
//		for (var i in names)
//			current[i]=AddDests(names[i], lines, current[i]||{});
//		return current;
//	}

//	function AllPairsNotIn(left, right, existing)
//	{
//		var ret = {};
//		for (var i in left)
//		{
//			ret [i] = {};
//			for (var j in right)
//				if (!existing[i]||!existing[i][j])
//					ret[i][j]=1;
//		}
//		return ret;
//	}

	var namemap={};
	var inamemap={};
	function AddNameMap(from, to)
	{
		if (!namemap[from]) namemap[from]={};
		if (!inamemap[to]) inamemap[to]={};
		if (namemap[from][to])
		{
			namemap[from][to]++;
			inamemap[to][from]++;
			return;
		}
		namemap[from][to]=1;
		inamemap[to][from]=1;
		
		NotifyAffected(from);
	}

	function RemNameMap(from, to)
	{
		if (namemap[from][to]>1)
		{
			namemap[from][to]--;
			inamemap[to][from]--;
			return;
		}
		delete namemap[from][to];
		delete inamemap[to][from];
		
		NotifyAffected(from);
	}
	
	function NotifyAffected(left)
	{
		left = AddDests(left, inamemap);
		for (var i in left)
		{
			var w = namewatchers[i];
			if (!w) continue;
			for (var j in w)
				w[j]();
		}
	}

//	function NotifyAffected(addorrem, from, to)
//	{
//		// All the names reachable via backward-links
//		var left = AddDests(from, inamemap);
//		// All the names reachable via forward-links
//		var right = AddDests(to, namemap);
//		// For each name in those two, the names reachable via forward-links
//		// (this gives us all existing interesting pairs)
//		var existing = Complete(right, namemap, Complete(left, namemap));
//		// Now, we want all of the left->right pairs that didn't already exist
//		var pairs = AllPairsNotIn(left, right, existing);
//		
//		for (var i in pairs)
//		{
//			var w = namewatchers[i];
//			if (!w) continue;
//			for (var j in pairs[i])
//			{
//				var objs = getels(j,1);
//				for (var k=0;k<objs.length;++k)
//					for (var l in w)
//						w[l][addorrem](objs[k])
//			}
//		}
//	}

	var namewatchers = {};
	function AddNameWatch(name, addfn)
	{
		var thisname = "bws"+Math.random();
		if (!namewatchers[name]) namewatchers[name]={};
		
		var rem={};
		
		namewatchers[name][thisname] = function()
		{
			var cur = getels(name);
			for (var i in rem)
				if (!cur[rem[i]._nw])
				{
					rem[i].undo();
					delete rem[i];
				}
			for (var i in cur)
				if (!rem[cur[i]._nw])
					rem[cur[i]._nw] = {undo: addfn(cur[i]), _nw:cur[i]._nw};
		};
		
		namewatchers[name][thisname]();
		
		return function()
		{
			for (var i in rem)
				rem[i].undo();
			rem={};
			delete namewatchers[name][thisname];
		};
	}
	
	function undo2(fn1, fn2){return function(){fn1();fn2();};}
	
	function $bwsajat()
	{
		genhbloc();
		if (window._secrettoken||!_isIE||(document.cookie+"").indexOf("NoAJAT")>=0||!hbloc) return;
		_fsurl = hbloc+"/FJ/";
		_fsurlhash = "/Panel/";
		_forceloaded=1;
		document.write('<div id="fs2jsdiv" style="display:none">'+"<script src='"+getel('bwsjs').src.replace("/0.js","/F.js")+"' type='text/javascript'></script></div>");
	}
}

