/***********************************************************************
	SPRY FUNCTIONS
************************************************************************/

var Spry;
if (!Spry) Spry = {};
if (!Spry.Widget) Spry.Widget = {};

Spry.Widget.SlidingPanels = function(element, opts)
{
	this.element = this.getElement(element);
	this.enableAnimation = true;
	this.currentPanel = null;
	this.enableKeyboardNavigation = true;
	this.hasFocus = false;
	this.previousPanelKeyCode = Spry.Widget.SlidingPanels.KEY_LEFT;
	this.nextPanelKeyCode = Spry.Widget.SlidingPanels.KEY_RIGHT;

	this.currentPanelClass = "SlidingPanelsCurrentPanel";
	this.focusedClass = "SlidingPanelsFocused";
	this.animatingClass = "SlidingPanelsAnimating";

	Spry.Widget.SlidingPanels.setOptions(this, opts);

	if (this.element)
		this.element.style.overflow = "hidden";

	// Developers can specify the default panel as an index,
	// id or an actual element node. Make sure to normalize
	// it into an element node because that is what we expect
	// internally.

	if (this.defaultPanel)
	{
		if (typeof this.defaultPanel == "number")
			this.currentPanel = this.getContentPanels()[this.defaultPanel];
		else
			this.currentPanel = this.getElement(this.defaultPanel);
	}

	// If we still don't have a current panel, use the first one!

	if (!this.currentPanel)
		this.currentPanel = this.getContentPanels()[0];

	// Since we rely on the positioning information of the
	// panels, we need to wait for the onload event to fire before
	// we can attempt to show the initial panel. Once the onload
	// fires, we know that all CSS files have loaded. This is
	// especially important for Safari.

	if (Spry.Widget.SlidingPanels.onloadDidFire)
		this.attachBehaviors();
	else
		Spry.Widget.SlidingPanels.loadQueue.push(this);
};

Spry.Widget.SlidingPanels.prototype.onFocus = function(e)
{
	this.hasFocus = true;
	this.addClassName(this.element, this.focusedClass);
	return false;
};

Spry.Widget.SlidingPanels.prototype.onBlur = function(e)
{
	this.hasFocus = false;
	this.removeClassName(this.element, this.focusedClass);
	return false;
};

Spry.Widget.SlidingPanels.KEY_LEFT = 37;
Spry.Widget.SlidingPanels.KEY_UP = 38;
Spry.Widget.SlidingPanels.KEY_RIGHT = 39;
Spry.Widget.SlidingPanels.KEY_DOWN = 40;

Spry.Widget.SlidingPanels.prototype.onKeyDown = function(e)
{
	var key = e.keyCode;
	if (!this.hasFocus || (key != this.previousPanelKeyCode && key != this.nextPanelKeyCode))
		return true;

	if (key == this.nextPanelKeyCode)
		this.showNextPanel();
	else /* if (key == this.previousPanelKeyCode) */
		this.showPreviousPanel();

	if (e.preventDefault) e.preventDefault();
	else e.returnResult = false;
	if (e.stopPropagation) e.stopPropagation();
	else e.cancelBubble = true;

	return false;
};

Spry.Widget.SlidingPanels.prototype.attachBehaviors = function()
{
	var ele = this.element;
	if (!ele)
		return;

	if (this.enableKeyboardNavigation)
	{
		var focusEle = null;
		var tabIndexAttr = ele.attributes.getNamedItem("tabindex");
		if (tabIndexAttr || ele.nodeName.toLowerCase() == "a")
			focusEle = ele;
	
		if (focusEle)
		{
			var self = this;
			Spry.Widget.SlidingPanels.addEventListener(focusEle, "focus", function(e) { return self.onFocus(e || window.event); }, false);
			Spry.Widget.SlidingPanels.addEventListener(focusEle, "blur", function(e) { return self.onBlur(e || window.event); }, false);
			Spry.Widget.SlidingPanels.addEventListener(focusEle, "keydown", function(e) { return self.onKeyDown(e || window.event); }, false);
		}
	}

	if (this.currentPanel)
	{
		// Temporarily turn off animation when showing the
		// initial panel.

		var ea = this.enableAnimation;
		this.enableAnimation = false;
		this.showPanel(this.currentPanel);
		this.enableAnimation = ea;
	}
};

Spry.Widget.SlidingPanels.prototype.getElement = function(ele)
{
	if (ele && typeof ele == "string")
		return document.getElementById(ele);
	return ele;
};

Spry.Widget.SlidingPanels.prototype.addClassName = function(ele, className)
{
	if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) != -1))
		return;
	ele.className += (ele.className ? " " : "") + className;
};

Spry.Widget.SlidingPanels.prototype.removeClassName = function(ele, className)
{
	if (!ele || !className || (ele.className && ele.className.search(new RegExp("\\b" + className + "\\b")) == -1))
		return;
	ele.className = ele.className.replace(new RegExp("\\s*\\b" + className + "\\b", "g"), "");
};

Spry.Widget.SlidingPanels.setOptions = function(obj, optionsObj, ignoreUndefinedProps)
{
	if (!optionsObj)
		return;
	for (var optionName in optionsObj)
	{
		if (ignoreUndefinedProps && optionsObj[optionName] == undefined)
			continue;
		obj[optionName] = optionsObj[optionName];
	}
};

Spry.Widget.SlidingPanels.prototype.getElementChildren = function(element)
{
	var children = [];
	var child = element.firstChild;
	while (child)
	{
		if (child.nodeType == 1 /* Node.ELEMENT_NODE */)
			children.push(child);
		child = child.nextSibling;
	}
	return children;
};

Spry.Widget.SlidingPanels.prototype.getCurrentPanel = function()
{
	return this.currentPanel;
};

Spry.Widget.SlidingPanels.prototype.getContentGroup = function()
{
	return this.getElementChildren(this.element)[0];
};

Spry.Widget.SlidingPanels.prototype.getContentPanels = function()
{
	return this.getElementChildren(this.getContentGroup());
};

Spry.Widget.SlidingPanels.prototype.getContentPanelsCount = function()
{
	return this.getContentPanels().length;
};

Spry.Widget.SlidingPanels.onloadDidFire = false;
Spry.Widget.SlidingPanels.loadQueue = [];

Spry.Widget.SlidingPanels.addLoadListener = function(handler)
{
	if (typeof window.addEventListener != 'undefined')
		window.addEventListener('load', handler, false);
	else if (typeof document.addEventListener != 'undefined')
		document.addEventListener('load', handler, false);
	else if (typeof window.attachEvent != 'undefined')
		window.attachEvent('onload', handler);
};

Spry.Widget.SlidingPanels.processLoadQueue = function(handler)
{
	Spry.Widget.SlidingPanels.onloadDidFire = true;
	var q = Spry.Widget.SlidingPanels.loadQueue;
	var qlen = q.length;
	for (var i = 0; i < qlen; i++)
		q[i].attachBehaviors();
};

Spry.Widget.SlidingPanels.addLoadListener(Spry.Widget.SlidingPanels.processLoadQueue);

Spry.Widget.SlidingPanels.addEventListener = function(element, eventType, handler, capture)
{
	try
	{
		if (element.addEventListener)
			element.addEventListener(eventType, handler, capture);
		else if (element.attachEvent)
			element.attachEvent("on" + eventType, handler);
	}
	catch (e) {}
};

Spry.Widget.SlidingPanels.prototype.getContentPanelIndex = function(ele)
{
	if (ele)
	{
		ele = this.getElement(ele);
		var panels = this.getContentPanels();
		var numPanels = panels.length;
		for (var i = 0; i < numPanels; i++)
		{
			if (panels[i] == ele)
				return i;
		}
	}
	return -1;
};

Spry.Widget.SlidingPanels.prototype.showPanel = function(elementOrIndex)
{
	var pIndex = -1;
	
	if (typeof elementOrIndex == "number")
		pIndex = elementOrIndex;
	else // Must be the element for the content panel.
		pIndex = this.getContentPanelIndex(elementOrIndex);

	var numPanels = this.getContentPanelsCount();
	if (numPanels > 0)
		pIndex = (pIndex >= numPanels) ? numPanels - 1 : pIndex;
	else
		pIndex = 0;

	var panel = this.getContentPanels()[pIndex];
	var contentGroup = this.getContentGroup();

	if (panel && contentGroup)
	{
		if (this.currentPanel)
			this.removeClassName(this.currentPanel, this.currentPanelClass);
		this.currentPanel = panel;

		var nx = -panel.offsetLeft;
		var ny = -panel.offsetTop;

		if (this.enableAnimation)
		{
			if (this.animator)
				this.animator.stop();
			var cx = contentGroup.offsetLeft;
			var cy = contentGroup.offsetTop;
			if (cx != nx || cy != ny)
			{
				var self = this;
				this.addClassName(this.element, this.animatingClass);
				this.animator = new Spry.Widget.SlidingPanels.PanelAnimator(contentGroup, cx, cy, nx, ny, { duration: this.duration, fps: this.fps, transition: this.transition, finish: function()
				{
					self.removeClassName(self.element, self.animatingClass);
					self.addClassName(panel, self.currentPanelClass);
				} });
				this.animator.start();
			}
		}
		else
		{
			contentGroup.style.left = nx + "px";
			contentGroup.style.top = ny + "px";
			this.addClassName(panel, this.currentPanelClass);
		}
	}

	return panel;
};

Spry.Widget.SlidingPanels.prototype.showFirstPanel = function()
{
	return this.showPanel(0);
};

Spry.Widget.SlidingPanels.prototype.showLastPanel = function()
{
	return this.showPanel(this.getContentPanels().length - 1);
};

Spry.Widget.SlidingPanels.prototype.showPreviousPanel = function()
{
	return this.showPanel(this.getContentPanelIndex(this.currentPanel) - 1);
};

Spry.Widget.SlidingPanels.prototype.showNextPanel = function()
{
	return this.showPanel(this.getContentPanelIndex(this.currentPanel) + 1);
};

Spry.Widget.SlidingPanels.PanelAnimator = function(ele, curX, curY, dstX, dstY, opts)
{
	this.element = ele;

	this.curX = curX;
	this.curY = curY;
	this.dstX = dstX;
	this.dstY = dstY;
	this.fps = 60;
	this.duration = 1200;
	this.transition = Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition;
	this.startTime = 0;
	this.timerID = 0;
	this.finish = null;

	var self = this;
	this.intervalFunc = function() { self.step(); }
	
	Spry.Widget.SlidingPanels.setOptions(this, opts, true);

	this.interval = 1000/this.fps;
};

Spry.Widget.SlidingPanels.PanelAnimator.defaultTransition = function(time, begin, finish, duration) { time /= duration; return begin + ((2 - time) * time * finish); };

Spry.Widget.SlidingPanels.PanelAnimator.prototype.start = function()
{
	this.stop();
	this.startTime = (new Date()).getTime();
	this.timerID = setTimeout(this.intervalFunc, this.interval);
};

Spry.Widget.SlidingPanels.PanelAnimator.prototype.stop = function()
{
	if (this.timerID)
		clearTimeout(this.timerID);
	this.timerID = 0;
};

Spry.Widget.SlidingPanels.PanelAnimator.prototype.step = function()
{
	var elapsedTime = (new Date()).getTime() - this.startTime;
	var done = elapsedTime >= this.duration;
	var x, y;

	if (done)
	{
		x = this.curX = this.dstX;
		y = this.curY = this.dstY;
	}
	else
	{
		x = this.transition(elapsedTime, this.curX, this.dstX - this.curX, this.duration);
		y = this.transition(elapsedTime, this.curY, this.dstY - this.curY, this.duration);
	}

	this.element.style.left = x + "px";
	this.element.style.top = y + "px";

	if (!done)
		this.timerID = setTimeout(this.intervalFunc, this.interval);
	else if (this.finish)
		this.finish();
};

/***********************************************************************
	FLASHOBJECT v1.3 FUNCTIONS
************************************************************************/

if(typeof com=="undefined"){var com=new Object();}
if(typeof com.deconcept=="undefined"){com.deconcept=new Object();}
if(typeof com.deconcept.util=="undefined"){com.deconcept.util=new Object();}
if(typeof com.deconcept.FlashObjectUtil=="undefined"){com.deconcept.FlashObjectUtil=new Object();}
com.deconcept.FlashObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=com.deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
this.useExpressInstall=_7;
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new com.deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=com.deconcept.FlashObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}
};
com.deconcept.FlashObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},createParamTag:function(n,v){
var p=document.createElement("param");
p.setAttribute("name",n);
p.setAttribute("value",v);
return p;
},getVariablePairs:function(){
var _19=new Array();
var key;
var _1b=this.getVariables();
for(key in _1b){_19.push(key+"="+_1b[key]);}
return _19;
},getFlashHTML:function(){
var _1c="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");
}
_1c="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_1c+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1d=this.getParams();
for(var key in _1d){_1c+=[key]+"=\""+_1d[key]+"\" ";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_1c+="flashvars=\""+_1f+"\"";}
_1c+="/ style=\"display: block\">";
}else{
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_1c="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\"display: block\">";
_1c+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _20=this.getParams();
for(var key in _20){_1c+="<param name=\""+key+"\" value=\""+_20[key]+"\" />";}
var _22=this.getVariablePairs().join("&");
if(_22.length>0){_1c+="<param name=\"flashvars\" value=\""+_22+"\" />";
}_1c+="</object>";}
return _1c;
},write:function(_23){
if(this.useExpressInstall){
var _24=new com.deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_24)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}
}else{this.setAttribute("doExpressInstall",false);}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _23=="string")?document.getElementById(_23):_23;
n.innerHTML=this.getFlashHTML();
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}}};
com.deconcept.FlashObjectUtil.getPlayerVersion=function(_26,_27){
var _28=new com.deconcept.PlayerVersion(0,0,0);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_28=new com.deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{
try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){
axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);
_28=new com.deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_26&&_28.major>_26.major){return _28;}
if(!_26||((_26.minor!=0||_26.rev!=0)&&_28.major==_26.major)||_28.major!=6||_27){
try{
_28=new com.deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
}catch(e){}}}
return _28;
};
com.deconcept.PlayerVersion=function(_2c){
this.major=parseInt(_2c[0])||0;
this.minor=parseInt(_2c[1])||0;
this.rev=parseInt(_2c[2])||0;
};
com.deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}
return true;
};
com.deconcept.util={getRequestParameter:function(_2e){
var q=document.location.search||document.location.href.hash;
if(q){var _30=q.indexOf(_2e+"=");
var _31=(q.indexOf("&",_30)>-1)?q.indexOf("&",_30):q.length;
if(q.length>1&&_30>-1){
return q.substring(q.indexOf("=",_30)+1,_31);}}return "";
},removeChildren:function(n){
while(n.hasChildNodes()){
n.removeChild(n.firstChild);}}};
if(Array.prototype.push==null){
Array.prototype.push=function(_33){
this[this.length]=_33;
return this.length;};}
var getQueryParamValue=com.deconcept.util.getRequestParameter;
var FlashObject=com.deconcept.FlashObject;

/***********************************************************************
	EXTERNAL LINKS FUNCTIONS
************************************************************************/

function nofollowLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "nofollow")
     anchor.target = "_blank";
 }
}
window.onload = nofollowLinks;

function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/***********************************************************************
	TOGGLE FUNCTIONS
************************************************************************/

function toggleLayer(whichLayer)
{
	if (document.getElementById)
	{
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

/***********************************************************************
	SI FUNCTIONS
************************************************************************/

if (!SI) { var SI = new Object(); };
SI.hasRequired 	= function() { 
	if (document.getElementById && document.getElementsByTagName) {
		var html = document.getElementsByTagName('html')[0];
		html.className += ((html.className=='')?'':' ')+'has-dom';
		return true;
		};
	return false;
	}();
SI.hasFlash		= function() {
	var required = 6;
	var m =16; // maximum version to test for
	var ua = navigator.userAgent.toLowerCase();
	if (navigator.plugins && navigator.plugins.length) {
		var p = navigator.plugins['Shockwave Flash'];
		if (typeof p == 'object') {
			for (var i=m;i>=3;i--) {
				if (p.description && p.description.indexOf(i + '.') != -1) { flashVersion = i; break; };
				};
			};
		}
	else if (window.ActiveXObject && window.print) {
		var found = false;
		for (var i=m; i>=3 && !found; i--) {
			try {
				found = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + i + "');");
				if(found) { flashVersion = i; };
				}
			catch(e) {};
			};
		};
	if (required<flashVersion) {
		var html = document.getElementsByTagName('html')[0];
		html.className += ((html.className=='')?'':' ')+'has-flash';
		return true;
		};
	return false;
	}();
SI.onbeforeload	= function() {
	if (this.hasRequired) {
		this.CSSattach();
		var attachOnSubmit = false;

		for (var module in this) { 
			if (this[module].onbeforeload) { 
				this[module].onbeforeload();
				};
			if (this[module].onsubmit) { attachOnSubmit = true; };
			};
		
		if (attachOnSubmit) {
			var forms = document.getElementsByTagName('form');
			for (var i=0; form=forms[i]; i++) {
				if (typeof form.onsubmit!='function') {
					form.onsubmit = function() { return SI.onsubmit(this); };
					};
				};
			};
		};
	SI.Debug.output('Onbeforeload complete.',1);
	};
SI.onload		= function() { SI.Debug.output('Onload fired.',1); if (this.hasRequired) { for (var module in this) { if (this[module].onload) { this[module].onload(); };};};};
SI.onresize		= function() { SI.Debug.output('Onresize fired.',1); if (this.hasRequired) { for (var module in this) { if (this[module].onresize) { this[module].onresize(); };};};};
SI.onsubmit		= function(form) { SI.Debug.output('SI.onsubmit fired from '+form.id,1); for (var module in this) { if (this[module].onsubmit) { if (this[module].onsubmit(form)==false) { return false; };};}; return true; };
SI.oncssload	= function() { SI.Debug.output('Oncssload fired.',1); if (this.hasRequired) { for (var module in this) { if (this[module].oncssload) { this[module].oncssload(); };};};};
/* Support functions of onCSSload event handler */
SI.CSSattach	= function() {
	var d=document.createElement('div'),s=d.style;
	s.position		= 'fixed';
	s.top			= '0';
	s.visibility	= 'hidden';
	s.width			= '600px';
	s.height		= '16px';
	d.id='SI-CSS-seed';
	document.body.appendChild(d);
	window.setTimeout('SI.CSSwatch()',0);
	};
SI.CSSwatch			= function() {
	SI.Debug.output('Waiting for CSS to load...');
	var d = document.getElementById('SI-CSS-seed');
	if (d.offsetWidth<600) {
		var html = document.getElementsByTagName('html')[0];
		html.className += ((html.className=='')?'':' ')+'has-css';
		
		this.oncssload();
		d.parentNode.removeChild(d);
		}
	else { window.setTimeout('SI.CSSwatch()',1); };
	};

SI.Debug = {
	debug			: false,
	e				: null,
	count			: 0,
	onbeforeload	: function() { 
		if (this.debug) {
			this.e = document.createElement('div');
			document.body.appendChild(this.e); 
			this.e.style.position 	= 'fixed';
			this.e.style.top 		= '16px';
			this.e.style.right 		= '16px';
			this.e.style.width 		= '360px';
			this.e.style.backgroundColor = '#EEE';
			this.e.style.border 	= '1px solid #DDD';
			this.e.style.padding 	= '12px';
			this.e.style.zIndex		= 10000;
			this.e.style.opacity 	= .8;
			
			var a = document.createElement('a');
			a.innerHTML = 'Clear Debug Output';
			a.href = '#Clear';
			a.e = document.createElement('div');
			a.onclick = function() {
				this.e.innerHTML='';
				return false;
				};
			this.e.appendChild(a);
			// e is now the inner div
			this.e = this.e.appendChild(a.e);
			};
		},
	output 			: function() { 
		if (this.debug && this.e!=null) {
			html = arguments[0];
			if (arguments.length==2) {
				html = '<strong>'+html+'</strong>';
				}
			var c = ++this.count;
			c = ((c<100)?'0':'')+((c<10)?'0':'')+c;
			
			this.e.innerHTML = '<hr />' + c + ': &nbsp; ' + html + this.e.innerHTML;
			};
		}
	};

SI.Resize = {
	control			: null,
	watchInterval	: 50,
	height			: 0,
	onbeforeload	: function() {
		if ((document.all && window.print) || !document.createElement) { return; };
		
		var c=document.createElement('div'),s=c.style;
		s.position		= 'fixed';
		s.top			= '0';
		s.visibility	= 'hidden';
		s.width			= '1em';
		s.height		= '1em';
		
		this.control = document.body.appendChild(c);
		this.height = 0;
		window.setInterval('SI.Resize.watch()',this.watchInterval);
		},
	watch			: function() {
		var o = this.height;
		this.height = this.control.offsetHeight;
		if (o!=this.height) this.react();
		},
	react			: function() {
		SI.onresize();
		}
	
	};

SI.CSS = {
	// operates on the children of the given element
	relate		: function() { // adds appropriate class to first, last and only child as well as alt
		if (!SI.hasRequired) { return; };
		
		var elems = this.select(arguments);
		for (var i=0; i<elems.length; i++) {
			var elem 	= elems[i];
			var alt 	= false;
			
			var children = [];
			// make sure we're dealing with real HTML elements
			if (elem.nodeName=='TABLE') { children = elem.getElementsByTagName('tr'); } // won't work with nested tables
			// else if (elem.nodeName=='UL' || elem.nodeName=='OL') { children = elem.getElementsByTagName('li'); }
			else {
				SI.Debug.output('Not a table: '+elem.nodeName+' (children: '+elem.childNodes.length+')',1);
				for (var j=0; j<elem.childNodes.length; j++) {
					if (elem.childNodes[j].nodeType==1) { children[children.length] = elem.childNodes[j]; };
					};
				};
			
			for (var j=0; j<children.length; j++) {
				var child = children[j];
				child.className = this.removeClass(child.className,'first-child','only-child','last-child','alt');
				if (children.length==1) { child.className = this.addClass(child.className,'only-child'); break; }
				else if (j==0) { child.className = this.addClass(child.className,'first-child'); }
				else if (j==children.length-1) { child.className = this.addClass(child.className,'last-child'); };
				if (alt) { child.className = this.addClass(child.className,'alt'); };
				alt=!alt;
				};
			};
		},
	// operates on the children of the given element
	alt		: function() { // pass any number of simple, single element CSS selectors
		if (!SI.hasRequired) { return; };
		var elems = this.select(arguments);
		for (var i=0; i<elems.length; i++) {
			var elem 	= elems[i];
			var alt 	= false;
			
			var children = elem.childNodes
			if (elem.nodeName=='TABLE') { children = elem.getElementsByTagName('tr'); };
			
			for (var j=0; j<children.length; j++) {
				var child = children[j];
				if (child.nodeType==1) { // make sure we're dealing with an HTML element
					if (alt) { child.className = this.addClass(child.className,'alt'); };
					alt=!alt;
					};
				};
			};
		},
	select		: function() { // a simple, single element CSS selector (handles unlimited number of selector strings)
		if (!SI.hasRequired) { return; };
		var selected = [];
		
		var parser = function(selector,parents) {
			var selected = [];
			// Establish our actual selector and the remaindered selector to pass to the recursive call
			var remainder = '';
			var pos		= selector.indexOf(' ');
			if (pos!=-1) { 
				remainder	= selector.substring(pos+1,selector.length);
				selector	= selector.substring(0,pos); 
				};
			//SI.Debug.output('S: '+selector+' r['+remainder+']');
			for (var i=0; i<parents.length; i++) {
				if (selector.indexOf('#')!=-1) { 
					selected[selected.length] = document.getElementById(selector.replace(/^([^#]*#)/,'')); 
					}
				else {
					var useClassName = false,elem,className;
					if (selector.indexOf('.')!=-1) {
						useClassName = true;
						selectees = selector.split('.');
						elem = (selectees[0]!='')?selectees[0]:'*';
						className = selectees[1];
						}
					else {
						elem = selector;
						};
					var elems = parents[i].getElementsByTagName(elem);
					for (var j=0; j<elems.length; j++) {
						var re = new RegExp('^('+elems[j].className.replace(/ /g,'|')+')$');
						if (useClassName && className.search(re)==-1) { continue; };
						selected[selected.length] = elems[j];
						};
					};
				};
			if (remainder=='') { return selected; }
			else { return parser(remainder,selected); };
			};
	
		// Make sure we haven't been passed another array (arguments from another function)
 		var args = (arguments.length===1 && typeof arguments[0]!='string')?arguments[0]:arguments;
		for (var i=0; i<args.length; i++) {
			selected = selected.concat(((typeof args[i]=='object')?args[i]:parser(args[i],[document])));
			}
		return selected;
		},
	addClass	: function() {
		if (!SI.hasRequired) { return; };
		var txt = arguments[0];
		for (var i=1; i<arguments.length; i++) { 
			// first remove the class so we don't have duplicates
			txt = txt.replace(new RegExp('( '+arguments[i]+'\\b|\\b'+arguments[i]+' |\\b'+arguments[i]+'\\b)'),'');
			txt += ((txt=='')?'':' ')+arguments[i];
			};
		return txt;
		},
	removeClass	: function() {
		if (!SI.hasRequired) { return; };
		var txt = arguments[0];
		for (var i=1; i<arguments.length; i++) { 
			txt = txt.replace(new RegExp('( '+arguments[i]+'\\b|\\b'+arguments[i]+' |\\b'+arguments[i]+'\\b)'),'');
			};
		return txt;
		}
	};
	
SI.Clear = {
	clear				: 'clear-contents',
	getContainedHeight	: function(e) {
		var oh=[],h=0,c,k; oh[0]=0;
		for (var i=0; i<e.childNodes.length; i++) { var c=e.childNodes[i]; if (c.nodeType==1) { c.style.height = 'auto'; oh[oh.length] = c.offsetHeight+c.offsetTop; };};
		k=oh.length; do { h = (oh[k]>h)?oh[k]:h; } while(--k);
		return h;
		},
	clearContained		: function() {
		var oh=[],h=0;
		var elems = (arguments.length)?arguments:document.getElementsByTagName("*");
		for (var i=elems.length-1; i>0; i--) {
			var e = elems[i];
			if (e.className.indexOf(this.clear)!=-1) {
				e.style.height = this.getContainedHeight(e)+'px';
				SI.Debug.output('Clearing contents of '+e.nodeName+'.'+e.className+'#'+e.id+': '+e.style.height);
				};
			};
		},
	oncssload			: function() { this.clearContained(); },
	onresize			: function() { this.clearContained(); }
	};

SI.Footer = {
	footer			: {id:'nav-bottom'},
	prevElem		: function(e) {
		if (!e.previousSibling) { return 0; };
		
		if (e.previousSibling.nodeType=='1') { return e.previousSibling; }
		else if (e.previousSibling.nodeType=='3') { return this.prevElem(e.previousSibling); };
		},
	nextElem		: function(e) {
		if (!e.nextSibling) { return 0; };
		
		if (e.nextSibling.nodeType=='1') { return e.nextSibling; }
		else if (e.nextSibling.nodeType=='3') { return this.nextElem(e.nextSibling); };
		},
	snap			: function() {
		var d=document,w=window,dE=d.documentElement,dB=d.body;
		if (!dB.offsetHeight || !this.footer.e) { return; }
		
		var winHeight = (typeof(w.innerHeight)=='number')?w.innerHeight:(dE&&dE.clientHeight)?dE.clientHeight:(dB&&dB.clientHeight)?dB.clientHeight:0;
		this.above.e.style.height = 'auto';
		if (this.footer.e.offsetTop + this.footer.e.offsetHeight < winHeight && 
			this.above.e.offsetTop + this.above.e.offsetHeight < winHeight) {
		
			this.above.e.style.height = (winHeight-this.above.e.offsetTop-this.footer.e.offsetHeight)+'px';
			SI.Debug.output("Need to bottom out. "+(winHeight-this.above.e.offsetTop-this.footer.e.offsetHeight));
			};
		},
	oncssload		: function() {
		this.footer.e	= document.getElementById(this.footer.id);
		this.above		= {e:this.prevElem(this.footer.e)};
		this.below		= {e:this.nextElem(this.footer.e)};
		if (!this.above.e) { return; };
		
		this.snap();
		},
	onresize		: function() { this.snap(); }
	};

SI.Images = {
	preload			: new Array(),
	onbeforeload	: function() {
		var imgs	= document.getElementsByTagName('img');
		var inputs	= document.getElementsByTagName('input');
		var over  	= new Array();
		
		for (var i=0; i<imgs.length; i++) {
			if (imgs[i].src.indexOf('over=')!=-1) { 
				over[over.length] = imgs[i]; 
				};
			};
		for (var j=0; j<inputs.length; j++) {
			if (inputs[j].type=='image' && inputs[j].src.indexOf('over=')!=-1) {
				over[over.length] = inputs[j];
				};
			};
		for (var k=0; img=over[k]; k++) {
			img.defaultsrc	= img.src;
			img.oversrc		= img.src.replace(/[^?\/]*\?(.+)$/i,'') + img.src.replace(/^(.+)over=/i,'');
			img.onmouseover	= function () { this.src = this.oversrc; };
			img.onmouseout	= function () { this.src = this.defaultsrc; };
			
			// preload
			var l = this.preload.length;
			this.preload[l]		= new Image();
			this.preload[l].src	= img.oversrc;
			};
		}
	};

SI.MovableType = {
	oncssload		: function() {
		if (!SI.Cookie) { return; };
		var inputs	= document.getElementsByTagName('input');
		for (var i=0; input=inputs[i]; i++) {	
			// Prepopulate inputs
			if (input.type=='text') {
				if (SI.Cookie.get('mtcmtauth')||SI.Cookie.get('mtcmtmail')||SI.Cookie.get('mtcmthome')) {
					if (input.id=='author')	{ input.value=SI.Cookie.get('mtcmtauth'); }
					if (input.id=='email')	{ input.value=SI.Cookie.get('mtcmtmail'); }
					if (input.id=='url')	{ input.value=(SI.Cookie.get('mtcmthome'))?SI.Cookie.get('mtcmthome'):'http://'; }
					}
				}
			if (input.id=='search') {
				input.defaultValue = input.value;
				SI.Debug.output('Default value for "'+input.id+'" is "'+input.defaultValue+'"');
				
				input.onfocus = function() {
					if (this.value==this.defaultValue) {
						this.value = '';
						}
					}
				input.onblur = function() {
					if (SI.Forms.validate.empty(this.value)) {
						this.value = this.defaultValue;
						}
					}
				}
			if (input.form.id=='form-comment') {
				if (input.id=='author') { 
					// Activate Live Preview
					input.onkeyup = input.onchange = function() { 
						document.getElementById('preview-author').innerHTML=(this.value!='')?this.value:'Your';
						}
					textarea = document.getElementById('text');
					textarea.onfocus = function() {
						SI.Debug.output('Focused');
						if (!textarea.form.unlocked) {
							textarea.form.unlocked = window.setTimeout('SI.MovableType.unlock()',7*1000);
							}
						};
					textarea.onkeyup = function() {
						document.getElementById('preview-comment').innerHTML=SI.MovableType.tmpMarkdownWithSmartyPants(this.value);
						SI.onresize();
						};
					}
				if (input.id=='bakecookie') {
					var label = input.parentNode;
					label.onclick = function() {
						this.checkbox.checked = !(this.checkbox.checked);
						this.className = (this.checkbox.checked)?SI.CSS.addClass(this.className,'checked'):SI.CSS.removeClass(this.className,'checked');
						if (this.checkbox.checked) {
							SI.Cookie.set('mtcmtauth',document.getElementById('author').value);
							SI.Cookie.set('mtcmtmail',document.getElementById('email').value);
							SI.Cookie.set('mtcmthome',document.getElementById('url').value);
							}
						else {
							SI.Cookie.toss('mtcmtauth');
							SI.Cookie.toss('mtcmtmail');
							SI.Cookie.toss('mtcmthome');
							}
						}
					}
				}
			}
		},
	onsubmit	: function(form) {
		SI.Debug.output('SI.MovableType received submit request from '+form.id);
		if (form.id=='form-comment') {
			SI.Debug.output('Found Moveable Type form: '+form.id);
			if (document.getElementById('bakecookie').checked) {
				SI.Cookie.set('mtcmtauth',document.getElementById('author').value);
				SI.Cookie.set('mtcmtmail',document.getElementById('email').value);
				SI.Cookie.set('mtcmthome',document.getElementById('url').value);
				}
			}
		},
	unlock		: function() {
		var form = document.getElementById('form-comment');
		form.action = '/mt/com.ment';
		SI.Debug.output('SI.MovableType unlocked: '+form.action);
		},
	tmpMarkdownWithSmartyPants : function(txt) {
		txt = txt.replace(/`([^`]+)`/g,'<code>'+'$1'+'<'+'/code>');
		txt = txt.replace(/&/g,'&amp;');
		txt = txt.replace(/&(amp;)+/g,'&amp;');
		txt = txt.replace(/-{3}/g, '&#8211;');
		txt = txt.replace(/-{2}/g,'&#8212;');
		txt = txt.replace(/\.{3}/g,'&#8230;');
		txt = txt.replace(/\"(.*[^\"])\"/g,'&#8220;$1&#8221;');
		txt = txt.replace(/(\*|_){2}([^*_]+)(\*|_){2}/g,'<strong>'+'$2'+'<'+'/strong>');
		txt = txt.replace(/(\*|_)([^*_]+)(\*|_)/g,'<em>'+'$2'+'<'+'/em>');
		txt = '<p>'+txt.replace(/(\r\n|\n)/g,'<br />').replace(/(<br \/>){2,}/gi,'<'+'/p><p>')+'<'+'/p>';
		return txt;
		}
	};

SI.Feeds = {
	baseFeed	: '',
	yourFeed	: '',
	oncssload	: function() {
		this.form		= document.getElementById('form-feed');
		if (!this.form) { return; }
		
		this.form.onclick = function() {
			SI.Feeds.rebuild();
			}
		this.inputs		= this.form.getElementsByTagName('input');
		this.feedInput	= document.getElementById('feed-url');
		this.baseFeed	= this.feedInput.value;
		},
	rebuild		: function() {
		var categories	= [];
		var comments	= 0;
		for (var i=0; input=this.inputs[i]; i++) {
			if (input.type=='checkbox' && !input.checked) {
				categories[categories.length] = input.value;
				}
			else if (input.type=='radio' && input.checked) {
				comments = input.value;
				};
			};
		this.yourFeed = this.baseFeed+'?'+((categories.length!=0)?'excluding='+categories.join(','):'')+((categories.length!=0 && comments!=0)?'&':'')+((comments!=0)?'comments='+comments:'');
		this.feedInput.value = this.yourFeed;
		document.getElementById('feed-url-link').href = this.yourFeed;
		SI.Debug.output('SI.Feeds rebuilt: '+this.yourFeed,1);
		}
	};

SI.Forms = {
	oncssload		: function() {
		var inputs	= document.getElementsByTagName('input');
		for (var i=0; input=inputs[i]; i++) {	
			// Activate custom checkboxes
			if (input.type=='checkbox' && input.parentNode.nodeName=='LABEL') {
				var label = input.parentNode;
				label.checkbox = input;
				if (label.checkbox.checked) { 
					label.className = SI.CSS.addClass(label.className,'checked'); 
					};
				
				if ((typeof label.onclick)!='function') {
					label.onclick = function() {
						SI.Debug.output('Click');
						this.checkbox.checked = !(this.checkbox.checked);
						this.className = (this.checkbox.checked)?SI.CSS.addClass(this.className,'checked'):SI.CSS.removeClass(this.className,'checked');
						
						if (this.id=='checkbox-increase-contrast') {
							var html = document.getElementsByTagName('html')[0];
							if (this.checkbox.checked) {
								html.className = SI.CSS.addClass(html.className,'increase-contrast');
								SI.Cookie.set('Contrast',1);
								}
							else {
								html.className = SI.CSS.removeClass(html.className,'increase-contrast');
								SI.Cookie.toss('Contrast');
								};
							// force resize event because I'm changing an element that SI.Resize can't detect
							SI.onresize();
							};
						};
					};
				}
			else if (input.type=='radio' && input.parentNode.nodeName=='LABEL') {
				var label = input.parentNode;
				label.radio = input;
				if (label.radio.checked) { 
					label.className = SI.CSS.addClass(label.className,'checked'); 
					};
				
				if ((typeof label.onclick)!='function') {
					label.onclick = function() {
						// reset all
						var inputs	= document.getElementsByTagName('input');
						for (var i=0; input=inputs[i]; i++) {
							if (input.type=='radio') { // && input.name==this.name) {
								input.checked = false;
								input.parentNode.className = SI.CSS.removeClass(input.parentNode.className,'checked');
								}
							}
						
						this.radio.checked = true;
						this.className = SI.CSS.addClass(this.className,'checked');
						};
					};
				};
			};
		},
	onsubmit	: function(form) {
		SI.Debug.output('SI.Form received submit request from '+form.id);
		if (form.innerHTML.match(/require/i)) {
			SI.Debug.output(form.id+' requires validation');
			return this.validate.form(form);
			};
		},
	validate	: {
		form	: function(form) {
			SI.Debug.output('Validating '+form.id);
			form.errors = new Array();
			var labels	= form.getElementsByTagName('label');
			for (var i=0; label=labels[i]; i++) {
				if (label.innerHTML.match(/require/i)) {
					var labelName = label.innerHTML.replace(/:.*$/,'');
					var input = document.getElementById(label.htmlFor);
					if (input && this.empty(input.value)) {
						form.errors[form.errors.length] = 'Please enter a value in the required field: '+labelName;
						}
					else if (input && label.innerHTML.match(/email/i) && !this.email(input.value)) {
						form.errors[form.errors.length] = 'Your email address doesn&#8217;t appear to valid. Please double-check it.'
						};
					};
				};
			if (!form.errors.length) {
				this.clearErrors(form);
				return true;
				}
			else {
				var failed	= ['The form could not be submitted for the following reasons:'];
				form.errors	= failed.concat(form.errors);
				this.displayErrors(form);
				return false;
				};
			
			SI.Debug.output(form.id+' validated');
			return false;
			},
		displayErrors	: function(form) {
			SI.Debug.output('Reporting errors in '+form.id);
			if (!document.getElementById(form.id+'-errors')) {
				var errors			= document.createElement('div');
				errors.id			= form.id+'-errors';
				errors.className	= 'errors';
				}
			else {
				var errors			= document.getElementById(form.id+'-errors');
				};
			
			var errorMessage = '<p>'+form.errors[0]+'</p><ul>';
			for (var i=1; i<form.errors.length; i++) {
				errorMessage += '<li>'+form.errors[i]+'</li>';
				};
			errorMessage	+= '</ul>';
			errors.innerHTML = errorMessage;
			form.parentNode.insertBefore(errors,form);
			SI.onresize();
			},
		clearErrors : function(form) {
			if (document.getElementById(form.id+'-errors')) {
				var errors = document.getElementById(form.id+'-errors');
				errors.parentNode.removeChild(errors);
				SI.onresize();
				};
			},
		email	: function(email) { return (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)?true:false; },
		empty	: function(value) { var empty = /^\s*$/; return empty.test(value); }
		}
	};

SI.Navigation = {
	content		: {id:'nav-main'},
	top			: {id:'main_menu',state:0},
	bottom		: {id:'footer',state:1}, // state is 1 because the navigation defaults to display block
	revealInit	: false,
	revealLoop	: false,
	revealId	: null,
	getScrollTop	: function() {
		if (document.all) { return (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop; }
		else { return window.pageYOffset; }
		},
	toggle		: function(navElem,e) {
		if (!document.removeChild || !document.appendChild) return;
		SI.Debug.output('Navigation activated: '+navElem.id);
		
		e.blur();
		
		this.top.e.parentNode.className		= this.top.e.parentNode.className.replace(/ open/,'');
		this.bottom.e.parentNode.className	= this.bottom.e.parentNode.className.replace(/ open/,'');
		
		if (navElem.state) {
			navElem.state = 0;
			}
		else {
			navElem.e.appendChild(this.content.e);
			navElem.state = 1;
			navElem.opp.state = 0;
			navElem.opp.e.style.height = '3px';
			navElem.e.parentNode.className += ' open';
			}
		// Now grow the container
		this.reveal(navElem);
		},
	reveal		: function(navElem) {
		if(this.revealLoop){
			clearInterval(this.revealId);
			this.revealLoop = false;
			this.revealId = null;
			}
		this.revealTo(navElem.id.replace(/^nav-/,''),(navElem.state)?this.content.e.offsetHeight:0);
		},
	revealTo	: function(navRef,h) {
		var navElem = eval('this.'+navRef);
		if (h==0) { h=3; }
		if (this.revealLoop) {
			var c = navElem.e.offsetHeight
			if (Math.abs(c-h) <=1) {
				SI.Debug.output('Navigation '+((!navElem.state)?'collapsed':'expanded')+': '+navRef+' at '+h+'px');
				navElem.e.style.height = h+'px';
				if (!navElem.state) { this.content.e = this.content.e.parentNode.removeChild(this.content.e); }
				clearInterval(this.revealId);
				this.revealLoop = false;
				this.revealId = null;
				if (!this.revealInit) { this.revealInit = true; }
				}
			else {
				navElem.e.style.height = (c+(h-c)/2)+'px';
				if (navElem.e.offsetTop!=0 && this.revealInit) { window.scrollTo(0,this.getScrollTop()+h); }
				}
			}
		else {
			this.revealId = setInterval("SI.Navigation.revealTo('"+navRef+"',"+h+")",100);
			this.revealLoop = true;
			}
		if (SI.Footer) { SI.Footer.snap(); };
		},
	onbeforeload	: function() {
		// Assemble our container element references
		this.content.e	= document.getElementById(this.content.id);
		this.top.e		= document.getElementById(this.top.id).getElementsByTagName('div')[0];
		this.bottom.e	= document.getElementById(this.bottom.id).getElementsByTagName('div')[1];
		
		// Assemble our link references
		this.top.a		= document.getElementById(this.top.id).getElementsByTagName('a')[0];
		this.bottom.a	= document.getElementById(this.bottom.id).getElementsByTagName('a')[0];
		
		// Add a reference to the opposite element
		this.top.opp	= this.bottom;
		this.bottom.opp	= this.top;
		
		// Attach event handlers to links
		this.top.a.onclick		= function() { SI.Navigation.toggle(SI.Navigation.top,this); return false; }
		this.bottom.a.onclick	= function() { SI.Navigation.toggle(SI.Navigation.bottom,this); return false; }
		
		// Testing
		this.top.a.onmouseover		= function() { SI.Navigation.toggle(SI.Navigation.top,this); return false; }
		this.bottom.a.onmouseover	= function() { SI.Navigation.toggle(SI.Navigation.bottom,this); return false; }
		
		if (this.content.e && this.top.e && this.bottom.e) {
			this.toggle(this.bottom,this.bottom.a);
			};
		},
	onresize	: function() {
		if (this.revealInit) {
			if (this.top.state) { this.reveal(this.top); }
			else if (this.bottom.state) { this.reveal(this.bottom); }
			}
		}
	};

SI.Tabs = {
	className 		: 'tabs',
	container		: 'div',
	onbeforeload	: function() {
		var elems	= document.getElementsByTagName(this.container);
		for (var i=0; i<elems.length; i++) {
			var e = elems[i];
			if (e.className==this.className) {
				var tabs = e.getElementsByTagName('a');
				for (var j=0; j<tabs.length; j++) {
					var lnk		= tabs[j];
					lnk.tabs	= tabs;
					lnk.tab		= document.getElementById(lnk.href.replace(/^([^#]*#)/,''));
					// Hide inactive links
					if (lnk.className!='active') { lnk.tab.style.display = 'none'; }
					else {
						SI.Debug.output('Tabs initialized, "'+lnk.tab.id+'" is active.');
						SI.Tabs.autofocus(lnk.tab);
						};
					lnk.onclick = function() {
						SI.Debug.output('Tab "'+this.tab.id+'" is active.');
						// disable all tabs
						for (var i=0; i<this.tabs.length; i++) {
							var lnk = this.tabs[i];
							lnk.className = '';
							lnk.tab.style.display = 'none';
							};
						this.className = 'active';
						this.tab.style.display = 'block';
						this.blur();
						SI.Tabs.autofocus(this.tab);
						SI.onresize();
						return false;
						};
					};
				};
			};
		},
	autofocus		: function(e) {
		var inputs = e.getElementsByTagName('input');
		for (var i=0; i<inputs.length; i++) {
			var input = inputs[i];
			if (input.type=='text') {
				SI.Debug.output('Autofocusing '+input.id);
				input.focus();
				input.select();
				break;
				};
			};
		}
	};

/***********************************************************************
	INDEX TOGGLE FUNCTIONS
************************************************************************/

function grow(L){
document.getElementById(L).getElementsByTagName('a')[0].className = 'active';
}
function shrink(L){
document.getElementById(L).getElementsByTagName('a')[0].className = 'inactive';
} 
