function changeFontSize(inc)
{
	var p = document.getElementsByTagName('p');
	//var li = document.getElementsByTagName('li');
	if(inc == 1 || -1) {
		updateElements(p, inc);
		//updateElements(li, inc);
	}
	if(inc == 0) {
		updateElementsBasic(p);
		//updateElementsBasic(li);
	}
}

function updateElements(elements, inc)
{
	for(n=0; n<elements.length; n++) {
		if(elements[n].style.fontSize) {
			var size = parseInt(elements[n].style.fontSize.replace("pt", ""));
		} else {
			var size = 12;
		}
		elements[n].style.fontSize = size+inc + 'pt';
	}
}

function updateElementsBasic(elements)
{
	for(n=0; n<elements.length; n++) {
		elements[n].style.fontSize = 12 + 'pt';
	}
}

function toggleLayer( whichLayer )
{
	var elem, vis;
	if( document.getElementById ) // this is the way the standards work
	elem = document.getElementById( whichLayer );
	else if( document.all ) // this is the way old msie versions work
	  elem = document.all[whichLayer];
	else if( document.layers ) // this is the way nn4 works
	elem = document.layers[whichLayer];
	vis = elem.style;
	// if the style.display value is blank we try to figure it out here
	if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
	vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

document.observe('dom:loaded', function(event){
	$$('a[href*="#"]').each(function(anchor){
		anchor.observe('click', function(event) {
		  var pageAnchor   = $$('a[name~="#{href}"]'.interpolate({href: this.href.split('#')[1]})).first();
		  var delta        = pageAnchor.offsetTop - document.viewport.getScrollOffsets().top;
		  var updateUrl    = function(){ location.href = this.href }.bind(this);
		
		  new Effect.Scroll(window, { y: delta, afterFinish: updateUrl, duration: 0.4 });
		  Event.stop(event);
		});
	});
	colorFade('reg_bread','background','eeeeee','d92525');
	colorFade('bread_container','border','dddddd','c41a1a');
	Lightbox.initialize();
});