<!--

function toggleDiv(divid)
{

	if (divid == "none")
	{
		ShowNone();
	}

	if (divid == "all")
	{
		ShowAll();			
	}

	if (divid != 'all')
	{

		var img;
		var imgs;

		for (a = 1; a < 30; a=a+1)
		{
			if (divid == "mydiv" + a)
			{		
				img = a;
			}
			if (divid == "mydivs" + a)
			{		
				imgs = a;
			}

		}

		if (document.getElementById(divid).style.display == 'none')
		{
			document.getElementById(divid).style.display = 'block';
			if (img)
			{
				document.getElementById('img' + img).src='scripts/images/divs.png';
				//document.getElementById('imgd' + img).src='scripts/images/div.png';
				//document.getElementById('imgd' + img).style.display='block';
			}
			else
			{
				document.getElementById('imgs' + imgs).src='scripts/images/divs.png';
			}
		}

		else
		{
			document.getElementById(divid).style.display = 'none';
			if (img)
			{
				document.getElementById('img' + img).src='scripts/images/divr.png';
				//document.getElementById('imgd' + img).src='';
				//document.getElementById('imgd' + img).style.display='none';			
			}
			else
			{
				document.getElementById('imgs' + imgs).src='scripts/images/divr.png';
			}
		}
	}

}

function ShowAll()
{

	for (a = 1; a < 10; a=a+1)
	{

		document.getElementById('mydiv' + a).style.display = 'block';
		document.getElementById('img' + a).src='scripts/images/divs.png';

		if (a < 3 || (a > 5 && a < 8)) 
		{
			document.getElementById('imgd' + a).src='scripts/images/div.png';
			//document.getElementById('imgd' + a).style.display='block';
		}

	}

	for (a = 1; a < 30; a=a+1)
	{

		document.getElementById('mydivs' + a).style.display = 'block';
		document.getElementById('imgs' + a).src='scripts/images/divs.png';

	}

	ChangeLink1();

}

function ShowNone()
{

	for (a = 1; a < 10; a=a+1)
	{

		document.getElementById('mydiv' + a).style.display = 'none';
		document.getElementById('img' + a).src='scripts/images/divr.png';

		if (a < 3 || (a > 5 && a < 8))
		{
			document.getElementById('imgd' + a).src='';
			//document.getElementById('imgd' + a).style.display='none';
		}
	}

	for (a = 1; a < 30; a=a+1)
	{

		document.getElementById('mydivs' + a).style.display = 'none';
		document.getElementById('imgs' + a).src='scripts/images/divr.png';
	}

	ChangeLink2();

}

function ChangeLink1()
{
	var head1 = document.getElementById("ShowAll");
	head1.firstChild.nodeValue="Default view";


	document.getElementById('ShowAll').onmousedown = function() 
	{
		toggleDiv('none');
	};

}

function ChangeLink2()
{
	var head1 = document.getElementById("ShowAll");
	head1.firstChild.nodeValue="Expand all links";


	document.getElementById('ShowAll').onmousedown = function() 
	{
		toggleDiv('all');
	};

}

var floatingMenuId = 'floatdiv';

var floatingMenu =
{
	targetX: -550,
	targetY: 10,

	hasInner: typeof(window.innerWidth) == 'number',
	hasElement: document.documentElement
	&& document.documentElement.clientWidth,

	menu:
		document.getElementById
		? document.getElementById(floatingMenuId)
		: document.all
		? document.all[floatingMenuId]
		: document.layers[floatingMenuId]
};

floatingMenu.move = function ()
{

	if (document.layers)
	{
		floatingMenu.menu.left = floatingMenu.nextX;
		floatingMenu.menu.top = floatingMenu.nextY;
	}
	else
	{
		if (getScrollXY() > 189) 
		{
			//floatingMenu.menu.style.left = floatingMenu.nextX + 'px';
			floatingMenu.menu.style.top = floatingMenu.nextY + 'px';
		}
			
		else
		{
			if (floatingMenu.nextY < 190)
			{
				floatingMenu.menu.style.top = '190px';
			}
		}
	}
}

floatingMenu.computeShifts = function ()
{
	var de = document.documentElement;

	floatingMenu.shiftX =
	floatingMenu.hasInner
	? pageXOffset
	: floatingMenu.hasElement
	? de.scrollLeft
	: document.body.scrollLeft;

	if (floatingMenu.targetX < 0)
	{
		if (floatingMenu.hasElement && floatingMenu.hasInner)
		{
			// Handle Opera 8 problems
			floatingMenu.shiftX +=
			de.clientWidth > window.innerWidth
			? window.innerWidth
			: de.clientWidth
		}
		else
		{
			floatingMenu.shiftX +=
			floatingMenu.hasElement
			? de.clientWidth
			: floatingMenu.hasInner
			? window.innerWidth
			: document.body.clientWidth;
		}
	}

	floatingMenu.shiftY =
	floatingMenu.hasInner
	? pageYOffset
	: floatingMenu.hasElement
	? de.scrollTop
	: document.body.scrollTop;
	if (floatingMenu.targetY < 0)
	{
		if (floatingMenu.hasElement && floatingMenu.hasInner)
		{
			// Handle Opera 8 problems
			floatingMenu.shiftY +=
			de.clientHeight > window.innerHeight
			? window.innerHeight
			: de.clientHeight
		}
		else
		{
			floatingMenu.shiftY +=
			floatingMenu.hasElement
			? document.documentElement.clientHeight
			: floatingMenu.hasInner
			? window.innerHeight
			: document.body.clientHeight;
		}
	}
}

floatingMenu.doFloat = function()
{
	var stepX, stepY;

	floatingMenu.computeShifts();

	stepX = (floatingMenu.shiftX +
	floatingMenu.targetX - floatingMenu.nextX) * .07;

	if (Math.abs(stepX) < .5)
	{
		stepX = floatingMenu.shiftX +
		floatingMenu.targetX - floatingMenu.nextX;
	}

	stepY = (floatingMenu.shiftY +
	floatingMenu.targetY - floatingMenu.nextY) * .07;

	if (Math.abs(stepY) < .5)
	{
		stepY = floatingMenu.shiftY +
		floatingMenu.targetY - floatingMenu.nextY;
	}

	if (Math.abs(stepX) > 0 || Math.abs(stepY) > 0)
	{
		floatingMenu.nextX += stepX;
		floatingMenu.nextY += stepY;
		floatingMenu.move();
	}

	setTimeout('floatingMenu.doFloat()', 0);
};

// addEvent designed by Aaron Moore
floatingMenu.addEvent = function(element, listener, handler)
{

	if(typeof element[listener] != 'function' || typeof element[listener + '_num'] == 'undefined')
	{
		element[listener + '_num'] = 0;

		if (typeof element[listener] == 'function')
		{
			element[listener + 0] = element[listener];
			element[listener + '_num']++;
		}

		element[listener] = function(e)

		{
			var r = true;
			e = (e) ? e : window.event;

			for(var i = element[listener + '_num'] -1; i >= 0; i=i-1)
			{
				if(element[listener + i](e) == false)
					r = false;
			}

		return r;
		}
	}

	//if handler is not already stored, assign it
	for(var i = 0; i < element[listener + '_num']; i=i+1)
	{
		if(element[listener + i] == handler)
			return;
	}

		element[listener + element[listener + '_num']] = handler;
		element[listener + '_num']++;
};

floatingMenu.init = function()
{
	floatingMenu.initSecondary();
	floatingMenu.doFloat();
};

// Some browsers init scrollbars only after
// full document load.
floatingMenu.initSecondary = function()
{
	floatingMenu.computeShifts();
	floatingMenu.nextX = floatingMenu.shiftX +
	floatingMenu.targetX;
	floatingMenu.nextY = floatingMenu.shiftY +
	floatingMenu.targetY;
	floatingMenu.move();
}

if (document.layers)
	floatingMenu.addEvent(window, 'onload', floatingMenu.init);
else
{
	floatingMenu.init();
	floatingMenu.addEvent(window, 'onload',
	floatingMenu.initSecondary);
}

function getScrollXY() 
{
	var scrOfX = 0, scrOfY = 0;

	if( typeof( window.pageYOffset ) == 'number' ) 
	{
		//Netscape compliant
		scrOfY = window.pageYOffset;
		scrOfX = window.pageXOffset;
	}
 	else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
	{
		//DOM compliant
		scrOfY = document.body.scrollTop;
		scrOfX = document.body.scrollLeft;
	} 
	else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
	{
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
		scrOfX = document.documentElement.scrollLeft;
	}

	return scrOfY;
}

//-->