// JavaScript Document
function switchimage(newimg, oldimg) {
	var img = document.getElementById(oldimg);
	img.setAttribute('src', 'assets/images/' + newimg);
}

function setimage(src, caption)
{
	document.getElementById('mainpic').src = src;
	if(caption != ""){document.getElementById('mainpiccap').setAttribute("class","greybox");}
	else{document.getElementById('mainpiccap').removeAttribute("class");}
	document.getElementById('mainpiccap').innerHTML = caption;
}
function showhide(divname, doit){
	document.getElementById(divname).style.display=doit;	
}

var min=10;
var max=18;
function increaseFontSize(divname) {
	var p = document.getElementById(divname);

	if(p.style.fontSize) {
		var s = parseInt(p.style.fontSize.replace("px",""));
	} else {
		var s = 12;
	}
	if(s!=max) {
		s += 1;
	}
	p.style.fontSize = s+"px"

}
function decreaseFontSize(divname) {
	var p = document.getElementById(divname);
	if(p.style.fontSize) {
		var s = parseInt(p.style.fontSize.replace("px",""));
	} else {
		var s = 12;
	}
	if(s!=min) {
		s -= 1;
	}
	p.style.fontSize = s+"px"

}


/// SLIDER
var sliderInUse		= false;
var sliderDiv		= false;
var sliderNext		= false;
var interval		= false;

function sliderUp()
{
	if(sliderDiv.offsetTop > 10) {
		sliderDiv.style.marginTop = sliderDiv.offsetTop - 10 + 'px';
	} else {
		sliderDiv.style.marginTop = '0px';
		clearInterval(interval);
		interval = false;
	}
}
