function initNav()
{
	if (typeof document.body.style.maxHeight == 'undefined')
	{
		var nav = document.getElementById("main-nav");
		if(nav)
		{
			var lis = nav.getElementsByTagName("li");
			for (var i=0; i<lis.length; i++)
			{
				lis[i].onmouseover = function()
				{
					this.className += " hover";
				}
				lis[i].onmouseout = function()
				{
					this.className = this.className.replace(" hover", "");
				}
			}
		}
	}
}
if (document.all && !window.opera)
	attachEvent("onload", initNav);
	
$(document).ready(function(){
	$('#gallery').galleryScroll({
		btPrev: 'a.link-prev',
		btNext: 'a.link-next',
		holderList: 'div.viewport',
		scrollElParent: 'div.viewport ul',
		disableClass: 'disable',
		scrollEl: 'div.viewport ul li',
		slideNum: '#slide-num',
		duration : 600,
		autoSlide : 7000,
		step: false,
		circleSlide: true,
		funcOnclick: null
	});
	HackIssues();
	FooterAddresses();
	resizefonts();
});

function HackIssues()
{
    $('.int-content .pageTitle[id*=IssueTitle] ~ br').remove();
    $('.int-content .pageTitle[id*=IssueTitle]').remove();    
}

function FooterAddresses()
{
    $('.wrap .maitland:first').show();
    PickAddress();
    $('.wrap .locations select').change(function(){
        PickAddress();
    });
}

function PickAddress()
{
        var ofShow = $('.wrap .locations select option:selected').val();
        $('.wrap .maitland').hide();
        $('.wrap .maitland:eq('+ofShow+')').show();
}

function resizefonts () {
 	var fMin = document.getElementById("font-min");
	 var fNormal = document.getElementById("font-normal");
	 var fMax = document.getElementById("font-max");
	 var fSize = 100;

	 var body = document.getElementsByTagName("body")[0];
	 body.style.fontSize = "100%";

	 fNormal.onclick = function (){
		  body.style.fontSize = "100%";
		  return false;
	 }
	 fMin.onclick = function (){
		  fSize = body.style.fontSize.replace("%","");
		  fSize = parseInt(fSize) - 7.5;
		  if (fSize <= 80) fSize = 80;
		  body.style.fontSize = fSize+"%";
		  return false;
	 }
	 fMax.onclick = function (){
		  fSize = body.style.fontSize.replace("%","");
		  fSize = parseInt(fSize) + 7.5;
		  if (fSize >= 133) fSize = 133;
		  body.style.fontSize = fSize+"%";
		  return false;
	 }
}
